r104546 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104545‎ | r104546 | r104547 >
Date:09:19, 29 November 2011
Author:varnent
Status:deferred
Tags:
Comment:
improvements(?) to english wording in lang file per r104381 feedback; fix to addthis tag bug from r104407; added missing instance of wgAddThispubid
Modified paths:
  • /trunk/extensions/AddThis/AddThis.body.php (modified) (history)
  • /trunk/extensions/AddThis/AddThis.i18n.php (modified) (history)
  • /trunk/extensions/AddThis/AddThis.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AddThis/AddThis.body.php
@@ -22,9 +22,9 @@
2323 # Output AddThis widget
2424 $output ='<!-- AddThis Button BEGIN -->
2525 <div class="addthis_toolbox addthis_default_style" id="addthistoolbar" style="background:'.$wgAddThisBackground.'; border-color:'.$wgAddThisBorder.';">
26 - <a href="http://www.addthis.com/bookmark.php?v=250&amp;pubid=ra-4eb75def4ec6488b" class="addthis_button_compact">&nbsp;' . $share . '</a><span class="addthis_separator">&nbsp;</span>';
 26+ <a href="http://www.addthis.com/bookmark.php?v=250&amp;pubid='.$wgAddThispubid.'" class="addthis_button_compact">&nbsp;' . $share . '</a><span class="addthis_separator">&nbsp;</span>';
2727
28 - $output = self::makeLinks( $wgAddThisHServ );
 28+ $output .= self::makeLinks( $wgAddThisHServ );
2929 $output .='</div>
3030 <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid='.$wgAddThispubid.'"></script>
3131 <!-- AddThis Button END -->';
@@ -33,36 +33,6 @@
3434 }
3535
3636 /**
37 - * Function for sidebar portlet
38 - *
39 - * @param $skin
40 - * @param $bar
41 - * @return array|bool|string
42 - */
43 - public static function AddThisSidebar( $skin, &$bar ) {
44 - global $wgOut, $wgAddThispubid, $wgAddThisSidebar, $wgAddThisSBServ;
45 -
46 - # Load css stylesheet
47 - $wgOut->addModuleStyles( 'ext.addThis' );
48 - # Check setting to enable/disable sidebar portlet
49 - if ( $wgAddThisSidebar ) {
50 - # Output AddThis widget
51 - $bar['addthis'] = '<!-- AddThis Button BEGIN -->
52 - <div class="addthis_toolbox addthis_default_style" id="addthissidebar">';
53 -
54 - $bar['addthis'] .= self::makeLinks( $wgAddThisSBServ );
55 -
56 - $bar['addthis'] .= '</div>
57 - <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid='.$wgAddThispubid.'"></script>
58 - <!-- AddThis Button END -->';
59 -
60 - // FIXME: This is a hook, should we really be returning a string here?
61 - return $bar;
62 - }
63 - return true;
64 - }
65 -
66 - /**
6737 * Function for article header toolbar
6838 *
6939 * @param $article Article
@@ -93,7 +63,7 @@
9464 # Output AddThis widget
9565 $wgOut->addHTML('<!-- AddThis Button BEGIN -->
9666 <div class="addthis_toolbox addthis_default_style" id="addthistoolbar" style="background:'.$wgAddThisBackground.'; border-color:'.$wgAddThisBorder.';">
97 - <a href="http://www.addthis.com/bookmark.php?v=250&amp;pubid=ra-4eb75def4ec6488b" class="addthis_button_compact">&nbsp;' . $share . '</a><span class="addthis_separator">&nbsp;</span>');
 67+ <a href="http://www.addthis.com/bookmark.php?v=250&amp;pubid='.$wgAddThispubid.'" class="addthis_button_compact">&nbsp;' . $share . '</a><span class="addthis_separator">&nbsp;</span>');
9868
9969 $wgOut->addHTML( self::makeLinks( $wgAddThisHServ ) );
10070
@@ -107,6 +77,36 @@
10878 }
10979
11080 /**
 81+ * Function for sidebar portlet
 82+ *
 83+ * @param $skin
 84+ * @param $bar
 85+ * @return array|bool|string
 86+ */
 87+ public static function AddThisSidebar( $skin, &$bar ) {
 88+ global $wgOut, $wgAddThispubid, $wgAddThisSidebar, $wgAddThisSBServ;
 89+
 90+ # Load css stylesheet
 91+ $wgOut->addModuleStyles( 'ext.addThis' );
 92+ # Check setting to enable/disable sidebar portlet
 93+ if ( $wgAddThisSidebar ) {
 94+ # Output AddThis widget
 95+ $bar['addthis'] = '<!-- AddThis Button BEGIN -->
 96+ <div class="addthis_toolbox addthis_default_style" id="addthissidebar">';
 97+
 98+ $bar['addthis'] .= self::makeLinks( $wgAddThisSBServ );
 99+
 100+ $bar['addthis'] .= '</div>
 101+ <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid='.$wgAddThispubid.'"></script>
 102+ <!-- AddThis Button END -->';
 103+
 104+ // FIXME: This is a hook, should we really be returning a string here?
 105+ return $bar;
 106+ }
 107+ return true;
 108+ }
 109+
 110+ /**
111111 * Converts an array definition of links into HTML tags
112112 *
113113 * @param $links array
Index: trunk/extensions/AddThis/AddThis.i18n.php
@@ -13,7 +13,7 @@
1414 */
1515 $messages['en'] = array(
1616 'addthis' => 'Share',
17 - 'addthis-desc' => 'Adds [http://www.addthis.com AddThis widget] to the sidebar and creates toolbar displayed on page header or by using <nowiki><addthis /></nowiki> tag',
 17+ 'addthis-desc' => 'Adds [http://www.addthis.com AddThis widget] to the sidebar and displays a toolbar on page headers which can be reproduced anywhere by inserting the <nowiki><addthis /></nowiki> tag',
1818 );
1919
2020 /** German (Deutsch)
Index: trunk/extensions/AddThis/AddThis.php
@@ -11,6 +11,8 @@
1212 * Loosely based on the Google Translator extension by Joachim De Schrijver
1313 * Thank you to Unikum111 for Russian translation, bug reporting and feedback
1414 * Thank you to Johnduhart for feedback and cleaning up code
 15+ * Thank you to Raymond, Kghbln, Michawiki, Toliño, McDutchie, Bjankuloski06, SPQRobin, Gucci Mane Burrr,
 16+ * and others mentioned in AddThis.i18n.php for translation work
1517 */
1618
1719 /**

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r104381initial extension commitvarnent23:37, 27 November 2011
r104407very minor fixvarnent07:36, 28 November 2011

Status & tagging log