Adapted backend markup for twitter client for 2.0 backend.

Also fixed a typo in the English lang file.
This commit is contained in:
Matthias Mees 2014-05-23 11:54:48 +02:00
parent e1f4f520be
commit 3cb7962af7
4 changed files with 81 additions and 22 deletions

View file

@ -11,6 +11,8 @@ TODO:
1.61 1.61
-------------------------- --------------------------
* Adapted backend markup (tweeter_client.inc.php) for 2.0 backend (yellowled)
* Fixed a typo in the English lang file (yellowled)
* Added int-casting to str_repeat() to prevent PHP notice * Added int-casting to str_repeat() to prevent PHP notice
* Added additional backend markup (backend_display) for 2.0 backend (yellowled) * Added additional backend markup (backend_display) for 2.0 backend (yellowled)
* Moved backend menu item to proper backend nav section (yellowled) * Moved backend menu item to proper backend nav section (yellowled)

View file

@ -1,4 +1,4 @@
<?php <?php
@define('PLUGIN_TWITTER_TITLE', 'Twitter Timeline'); @define('PLUGIN_TWITTER_TITLE', 'Twitter Timeline');
@define('PLUGIN_TWITTER_DESC', 'Show your current Twitter entries'); @define('PLUGIN_TWITTER_DESC', 'Show your current Twitter entries');
@define('PLUGIN_TWITTER_NUMBER', 'Number of entries'); @define('PLUGIN_TWITTER_NUMBER', 'Number of entries');
@ -39,7 +39,7 @@
@define('PLUGIN_TWITTER_PROBLEM_TWITTER_ACCESS', 'Problem, accessing twitter at the moment. <br/>Please reload later..'); @define('PLUGIN_TWITTER_PROBLEM_TWITTER_ACCESS', 'Problem, accessing twitter at the moment. <br/>Please reload later..');
// Twitter Event Plugin // Twitter Event Plugin
@define('PLUGIN_EVENT_TWITTER_NAME', 'Microblogging (Twitter,Identica)'); @define('PLUGIN_EVENT_TWITTER_NAME', 'Microblogging (Twitter,Identica)');
@define('PLUGIN_EVENT_TWITTER_DESC', 'Adds a twitter/identica client to the admininistration interface, searches for tweetbacks and announces new articles to a microblogging account.'); @define('PLUGIN_EVENT_TWITTER_DESC', 'Adds a twitter/identica client to the admininistration interface, searches for tweetbacks and announces new articles to a microblogging account.');
@ -106,7 +106,7 @@
@define('PLUGIN_EVENT_TWITTER_IDENTITIES', 'Identities'); @define('PLUGIN_EVENT_TWITTER_IDENTITIES', 'Identities');
@define('PLUGIN_EVENT_TWITTER_ACCOUNT_IDCOUNT', 'Number of Accounts'); @define('PLUGIN_EVENT_TWITTER_ACCOUNT_IDCOUNT', 'Number of Accounts');
@define('PLUGIN_EVENT_TWITTER_ACCOUNT_IDCOUNT_DESC', 'After saving this, the configuration will give you inputs for the number of accounts. Perhaps you have to save it twice, to see the inputs.'); @define('PLUGIN_EVENT_TWITTER_ACCOUNT_IDCOUNT_DESC', 'After saving this, the configuration will give you inputs for the number of accounts. Perhaps you have to save it twice, to see the inputs.');
@define('PLUGIN_EVENT_TWITTER_IDENTITY', 'Indentity'); @define('PLUGIN_EVENT_TWITTER_IDENTITY', 'Identity');
@define('PLUGIN_EVENT_TWITTER_ACCOUNT_SERVICE', 'Account Service'); @define('PLUGIN_EVENT_TWITTER_ACCOUNT_SERVICE', 'Account Service');
@define('PLUGIN_EVENT_TWITTER_ACCOUNT_SERVICE_DESC', 'Specify, if this is a twitter or identi.ca account'); @define('PLUGIN_EVENT_TWITTER_ACCOUNT_SERVICE_DESC', 'Specify, if this is a twitter or identi.ca account');
@define('PLUGIN_EVENT_TWITTER_ACCOUNT_SERVICE_TWITTER', 'twitter'); @define('PLUGIN_EVENT_TWITTER_ACCOUNT_SERVICE_TWITTER', 'twitter');

View file

@ -1023,6 +1023,7 @@ class serendipity_event_twitter extends serendipity_plugin {
return true; return true;
case 'backend_sidebar_entries_event_display_tweeter': case 'backend_sidebar_entries_event_display_tweeter':
echo '<h2>' . PLUGIN_EVENT_TWITTER_TWEETER_SIDEBARTITLE . '</h2>';
$this->display_twitter_client(true); $this->display_twitter_client(true);
return true; return true;

View file

@ -9,27 +9,83 @@ var twitter_https_length_str = '<?php echo $https_length_str?>';
</script> </script>
<div id="serendipity_admin_tweeter"> <div id="serendipity_admin_tweeter">
<form action="serendipity_admin.php" method="post"> <form action="serendipity_admin.php" method="post">
<?php if ($tweeter_in_sidbar) { ?> <?php if ($tweeter_in_sidbar) { ?>
<input type="hidden" name="serendipity[adminModule]" value="event_display" /> <input type="hidden" name="serendipity[adminModule]" value="event_display" />
<input type="hidden" name="serendipity[adminAction]" value="tweeter" /> <input type="hidden" name="serendipity[adminAction]" value="tweeter" />
<?php }
if ($GLOBALS['serendipity']['version'][0] == '2') {
echo '<div class="form_select">';
}
?>
<label for="tweeter_account"><?php echo PLUGIN_EVENT_TWITTER_IDENTITY;?> </label>
<select id="tweeter_account" name="tweeter_account" onchange="accountChanged()">
<?php foreach($identities as $idkey =>$idtext) {?>
<option value="<?php echo $idkey; ?>" <?php if ($idkey==$val_identitiy) echo 'SELECTED';?>><?php echo $idtext; ?></option>
<?php } ?> <?php } ?>
<label for="tweeter_account"><?php echo PLUGIN_EVENT_TWITTER_IDENTITY;?> </label> </select>
<select id="tweeter_account" name="tweeter_account" onchange="accountChanged()"><?php foreach($identities as $idkey =>$idtext) {?> <?php
<option value="<?php echo $idkey; ?>" <?php if ($idkey==$val_identitiy) echo 'SELECTED';?>><?php echo $idtext; ?></option> if ($GLOBALS['serendipity']['version'][0] == '2') {
<?php } ?></select><?php if ($tweeter_has_timeline) { ?><br /> echo '</div>';
<label for="tweeter_timeline"><?php echo PLUGIN_EVENT_TWITTER_TIMELINE;?> </label> }
<select id="tweeter_timeline" name="tweeter_timeline"><?php foreach($status_timeline as $timeline) {?> if ($tweeter_has_timeline) {
<option value="<?php echo $timeline; ?>" <?php if ($timeline==$pstatus_timeline) echo 'SELECTED';?>><?php echo $timeline; ?></option> if ($GLOBALS['serendipity']['version'][0] == '1') {
<?php } ?></select><?php } ?> echo "<br />";
<input id="tweeter_change_identity" name="tweeter_change_identity" value="change" type="submit" /><br/> } else {
<?php echo PLUGIN_EVENT_TWITTER_TWEETER_FORM; ?><span id="tweeeter_charcount">140</span> <?php echo PLUGIN_EVENT_TWITTER_TWEETER_CHARSLEFT; ?> echo '<div class="form_select">';
<textarea id="tweeter_tweet" rows="3" cols="40" id="tweet" name="tweet" onfocus="tweeter_char_count()" onkeydown="tweeter_char_count()" onkeyup="tweeter_char_count()" onkeypress="tweeter_char_count()"><?php if(isset($val_tweet)){ echo $val_tweet; } ?></textarea><br /> }
<div id="serendipity_admin_tweeter_shorturl"> ?>
<label for="shorturl"><?php echo PLUGIN_EVENT_TWITTER_TWEETER_SHORTEN; ?>: </label><input type="text" id="shorturl" value="<?php echo empty($val_short) ? 'http://' : $val_short; ?>" name="shorturl"/><br /> <label for="tweeter_timeline"><?php echo PLUGIN_EVENT_TWITTER_TIMELINE;?> </label>
</div> <select id="tweeter_timeline" name="tweeter_timeline">
<input id="tweeter_submit" name="tweeter_submit" value="<?php echo PLUGIN_EVENT_TWITTER_TWEETER_SHORTEN_OR_UPDATE; ?>" type="submit" /> <?php foreach($status_timeline as $timeline) {?>
</form> <option value="<?php echo $timeline; ?>" <?php if ($timeline==$pstatus_timeline) echo 'SELECTED';?>><?php echo $timeline; ?></option>
<?php } ?>
</select>
<?php
if ($GLOBALS['serendipity']['version'][0] == '2') {
echo '</div>';
}
}
if ($GLOBALS['serendipity']['version'][0] == '2') {
echo '<div class="form_buttons">';
}
?>
<input id="tweeter_change_identity" name="tweeter_change_identity" value="change" type="submit" />
<?php
if ($GLOBALS['serendipity']['version'][0] == '1') {
echo '<br/>';
} else {
echo '</div>';
echo '<div class="form_area">';
echo '<label for="tweeter_tweet">';
}
?>
<?php echo PLUGIN_EVENT_TWITTER_TWEETER_FORM; ?> <span id="tweeeter_charcount">140</span> <?php echo PLUGIN_EVENT_TWITTER_TWEETER_CHARSLEFT; ?>
<?php
if ($GLOBALS['serendipity']['version'][0] == '2') {
echo '</label>';
}
?>
<textarea id="tweeter_tweet" rows="3" cols="40" name="tweet" onfocus="tweeter_char_count()" onkeydown="tweeter_char_count()" onkeyup="tweeter_char_count()" onkeypress="tweeter_char_count()"><?php if(isset($val_tweet)){ echo $val_tweet; } ?></textarea>
<?php
if ($GLOBALS['serendipity']['version'][0] == '1') {
echo '<br />';
} else {
echo '</div>';
}
?>
<div id="serendipity_admin_tweeter_shorturl">
<label for="shorturl"><?php echo PLUGIN_EVENT_TWITTER_TWEETER_SHORTEN; ?>:</label>
<input type="text" id="shorturl" value="<?php echo empty($val_short) ? 'http://' : $val_short; ?>" name="shorturl"/>
<?php
if ($GLOBALS['serendipity']['version'][0] == '1') {
echo '<br />';
}
?>
</div>
<input id="tweeter_submit" name="tweeter_submit" value="<?php echo PLUGIN_EVENT_TWITTER_TWEETER_SHORTEN_OR_UPDATE; ?>" type="submit" />
</form>
<?php if(isset($notice)) echo $notice; ?> <?php if(isset($notice)) echo $notice; ?>
<script type="text/javascript"> <script type="text/javascript">
// If we shortened a link, recount chars. // If we shortened a link, recount chars.