Changeset 11463


Ignore:
Timestamp:
Jun 21, 2011, 3:35:25 PM (13 years ago)
Author:
mistic100
Message:

add button on index toolbar

Location:
extensions/TweetThis
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/TweetThis/language/ru_RU/plugin.lang.php

    r11437 r11463  
    77$lang['Share on Twitter'] = 'Опубликовать в Twitter';
    88
    9 
    109?>
  • extensions/TweetThis/main.inc.php

    r11419 r11463  
    1515load_language('plugin.lang', TWEET_PATH);
    1616add_event_handler('loc_end_picture', 'tweet_add_button');
     17add_event_handler('loc_end_index', 'tweet_add_button');
    1718
    1819
     
    2223  $conf['TweetThis'] = explode(',', $conf['TweetThis']);
    2324 
    24   $template->assign(array(
    25     'TWEET_IMAGE' => $conf['TweetThis'][0],
    26     'TWEET_POSITON' => $conf['TweetThis'][1],
    27   ));
    28      
    29   $template->set_prefilter('picture', 'tweet_add_button_prefilter');
     25  if (script_basename() == 'picture')
     26  {
     27    $template->assign(array(
     28      'TWEET_IMAGE' => $conf['TweetThis'][0],
     29      'TWEET_POSITON' => $conf['TweetThis'][1],
     30    ));
     31       
     32    $template->set_prefilter('picture', 'tweet_add_button_prefilter');
     33  }
     34  else if (script_basename() == 'index')
     35  {
     36    $template->assign(array(
     37      'TWEET_IMAGE' => $conf['TweetThis'][0],
     38      'TWEET_POSITON' => 'index',
     39    ));
     40       
     41    $template->set_prefilter('index', 'tweet_add_button_prefilter');
     42  }
    3043}
    3144
     
    6275';
    6376      break;
     77     
     78    case 'index':
     79      $search = '<ul class="categoryActions">';
     80      $replace = '
     81<li><a href="http://twitter.com/share" class="twitter-share-button pwg-button" title="{\'Share on Twitter\'|@translate}">
     82  <img src="http://twitter-badges.s3.amazonaws.com/{$TWEET_IMAGE}.png"/>
     83</a></li>
     84';
     85      break;
    6486  }
    6587 
Note: See TracChangeset for help on using the changeset viewer.