Index: trunk/extensions/AddThis/AddThis.body.php |
— | — | @@ -13,22 +13,21 @@ |
14 | 14 | * |
15 | 15 | */ |
16 | 16 | public static function parserHook( $parser ) { |
17 | | - global $wgOut, $wgAddThispubid, $wgAddThisHeader, $wgAddThisHServ1, $wgAddThisHServ1set, $wgAddThisHServ2, $wgAddThisHServ2set, $wgAddThisHServ3, $wgAddThisHServ3set, $wgAddThisHServ4, $wgAddThisHServ4set, |
18 | | - $wgAddThisHServ5, $wgAddThisHServ5set, $wgAddThisHServ6, $wgAddThisHServ6set, $wgAddThisHServ7, $wgAddThisHServ7set, $wgAddThisHServ8, $wgAddThisHServ8set, $wgAddThisBackground, $wgAddThisBorder; |
| 17 | + global $wgAddThispubid, $wgAddThisHeader, $wgAddThisMain, $wgAddThisMainpage, $wgRequest, $wgAddThisHServ, $wgAddThisBackground, $wgAddThisBorder; |
19 | 18 | # Localisation for "Share" |
20 | 19 | $share = wfMsg( 'addthis' ); |
21 | 20 | # Output AddThis widget |
22 | 21 | $output .='<!-- AddThis Button BEGIN --> |
23 | 22 | <div class="addthis_toolbox addthis_default_style" id="addthistoolbar" style="background:'.$wgAddThisBackground.'; border-color:'.$wgAddThisBorder.';"> |
24 | 23 | <a href="http://www.addthis.com/bookmark.php?v=250&pubid=ra-4eb75def4ec6488b" class="addthis_button_compact"> ' . $share . '</a><span class="addthis_separator"> </span> |
25 | | - <a class="addthis_button_'.$wgAddThisHServ1.'" '.$wgAddThisHServ1set.'></a> |
26 | | - <a class="addthis_button_'.$wgAddThisHServ2.'" '.$wgAddThisHServ2set.'></a> |
27 | | - <a class="addthis_button_'.$wgAddThisHServ3.'" '.$wgAddThisHServ3set.'></a> |
28 | | - <a class="addthis_button_'.$wgAddThisHServ4.'" '.$wgAddThisHServ4set.'></a> |
29 | | - <a class="addthis_button_'.$wgAddThisHServ5.'" '.$wgAddThisHServ5set.'></a> |
30 | | - <a class="addthis_button_'.$wgAddThisHServ6.'" '.$wgAddThisHServ6set.'></a> |
31 | | - <a class="addthis_button_'.$wgAddThisHServ7.'" '.$wgAddThisHServ7set.'></a> |
32 | | - <a class="addthis_button_'.$wgAddThisHServ8.'" '.$wgAddThisHServ8set.'></a> |
| 24 | + <a class="addthis_button_'.$wgAddThisHServ[1].'" '.$wgAddThisHServ['1set'].'></a> |
| 25 | + <a class="addthis_button_'.$wgAddThisHServ[2].'" '.$wgAddThisHServ['2set'].'></a> |
| 26 | + <a class="addthis_button_'.$wgAddThisHServ[3].'" '.$wgAddThisHServ['3set'].'></a> |
| 27 | + <a class="addthis_button_'.$wgAddThisHServ[4].'" '.$wgAddThisHServ['4set'].'></a> |
| 28 | + <a class="addthis_button_'.$wgAddThisHServ[5].'" '.$wgAddThisHServ['5set'].'></a> |
| 29 | + <a class="addthis_button_'.$wgAddThisHServ[6].'" '.$wgAddThisHServ['6set'].'></a> |
| 30 | + <a class="addthis_button_'.$wgAddThisHServ[7].'" '.$wgAddThisHServ['7set'].'></a> |
| 31 | + <a class="addthis_button_'.$wgAddThisHServ[8].'" '.$wgAddThisHServ['8set'].'></a> |
33 | 32 | </div> |
34 | 33 | <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid='.$wgAddThispubid.'"></script> |
35 | 34 | <!-- AddThis Button END -->'; |
— | — | @@ -41,8 +40,7 @@ |
42 | 41 | * |
43 | 42 | */ |
44 | 43 | static function AddThisSidebar( $skin, &$bar ) { |
45 | | - global $wgOut, $wgAddThispubid, $wgAddThisSidebar, $wgAddThisSBServ1, $wgAddThisSBServ2, $wgAddThisSBServ3, $wgAddThisSBServ4, $wgAddThisSBServ5, $wgAddThisSBServ1set, $wgAddThisSBServ2set, |
46 | | - $wgAddThisSBServ3set, $wgAddThisSBServ4set, $wgScriptPath, $wgAddThisSBServ5set; |
| 44 | + global $wgOut, $wgAddThispubid, $wgAddThisSidebar, $wgAddThisSBServ; |
47 | 45 | # Load css stylesheet |
48 | 46 | $wgOut->addModuleStyles( 'ext.addThis' ); |
49 | 47 | # Check setting to enable/disable sidebar portlet |
— | — | @@ -50,11 +48,11 @@ |
51 | 49 | # Output AddThis widget |
52 | 50 | $bar['addthis'] = '<!-- AddThis Button BEGIN --> |
53 | 51 | <div class="addthis_toolbox addthis_default_style" id="addthissidebar"> |
54 | | - <a class="addthis_button_'.$wgAddThisSBServ1.'" '.$wgAddThisSBServ1set.'></a> |
55 | | - <a class="addthis_button_'.$wgAddThisSBServ2.'" '.$wgAddThisSBServ2set.'></a> |
56 | | - <a class="addthis_button_'.$wgAddThisSBServ3.'" '.$wgAddThisSBServ3set.'></a> |
57 | | - <a class="addthis_button_'.$wgAddThisSBServ4.'" '.$wgAddThisSBServ4set.'></a> |
58 | | - <a class="addthis_button_'.$wgAddThisSBServ5.'" '.$wgAddThisSBServ5set.'></a> |
| 52 | + <a class="addthis_button_'.$wgAddThisSBServ[1].'" '.$wgAddThisSBServ['1set'].'></a> |
| 53 | + <a class="addthis_button_'.$wgAddThisSBServ[2].'" '.$wgAddThisSBServ['2set'].'></a> |
| 54 | + <a class="addthis_button_'.$wgAddThisSBServ[3].'" '.$wgAddThisSBServ['3set'].'></a> |
| 55 | + <a class="addthis_button_'.$wgAddThisSBServ[4].'" '.$wgAddThisSBServ['4set'].'></a> |
| 56 | + <a class="addthis_button_'.$wgAddThisSBServ[5].'" '.$wgAddThisSBServ['5set'].'></a> |
59 | 57 | </div> |
60 | 58 | <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid='.$wgAddThispubid.'"></script> |
61 | 59 | <!-- AddThis Button END -->'; |
— | — | @@ -69,9 +67,7 @@ |
70 | 68 | * |
71 | 69 | */ |
72 | 70 | public static function AddThisHeader( &$article, &$outputDone, &$pcache ) { |
73 | | - global $wgOut, $wgAddThispubid, $wgAddThisHeader, $wgAddThisMain, $wgAddThisMainpage, $wgRequest, $wgAddThisHServ1, $wgAddThisHServ1set, $wgAddThisHServ2, $wgAddThisHServ2set, $wgAddThisHServ3, |
74 | | - $wgAddThisHServ3set, $wgAddThisHServ4, $wgAddThisHServ4set, $wgAddThisHServ5, $wgAddThisHServ5set, $wgAddThisHServ6, $wgAddThisHServ6set, $wgAddThisHServ7, $wgAddThisHServ7set, $wgAddThisHServ8, |
75 | | - $wgAddThisHServ8set, $wgAddThisBackground, $wgAddThisBorder; |
| 71 | + global $wgOut, $wgAddThispubid, $wgAddThisHeader, $wgAddThisMain, $wgAddThisMainpage, $wgRequest, $wgAddThisHServ, $wgAddThisBackground, $wgAddThisBorder; |
76 | 72 | # Localisation for "Share" |
77 | 73 | $share = wfMsg( 'addthis' ); |
78 | 74 | # Check if page is in main namespace |
— | — | @@ -91,14 +87,14 @@ |
92 | 88 | $wgOut->addHTML('<!-- AddThis Button BEGIN --> |
93 | 89 | <div class="addthis_toolbox addthis_default_style" id="addthisheader" style="background:'.$wgAddThisBackground.'; border-color:'.$wgAddThisBorder.';"> |
94 | 90 | <a href="http://www.addthis.com/bookmark.php?v=250&pubid=ra-4eb75def4ec6488b" class="addthis_button_compact"> ' . $share . '</a><span class="addthis_separator"> </span> |
95 | | - <a class="addthis_button_'.$wgAddThisHServ1.'" '.$wgAddThisHServ1set.'></a> |
96 | | - <a class="addthis_button_'.$wgAddThisHServ2.'" '.$wgAddThisHServ2set.'></a> |
97 | | - <a class="addthis_button_'.$wgAddThisHServ3.'" '.$wgAddThisHServ3set.'></a> |
98 | | - <a class="addthis_button_'.$wgAddThisHServ4.'" '.$wgAddThisHServ4set.'></a> |
99 | | - <a class="addthis_button_'.$wgAddThisHServ5.'" '.$wgAddThisHServ5set.'></a> |
100 | | - <a class="addthis_button_'.$wgAddThisHServ6.'" '.$wgAddThisHServ6set.'></a> |
101 | | - <a class="addthis_button_'.$wgAddThisHServ7.'" '.$wgAddThisHServ7set.'></a> |
102 | | - <a class="addthis_button_'.$wgAddThisHServ8.'" '.$wgAddThisHServ8set.'></a> |
| 91 | + <a class="addthis_button_'.$wgAddThisHServ[1].'" '.$wgAddThisHServ['1set'].'></a> |
| 92 | + <a class="addthis_button_'.$wgAddThisHServ[2].'" '.$wgAddThisHServ['2set'].'></a> |
| 93 | + <a class="addthis_button_'.$wgAddThisHServ[3].'" '.$wgAddThisHServ['3set'].'></a> |
| 94 | + <a class="addthis_button_'.$wgAddThisHServ[4].'" '.$wgAddThisHServ['4set'].'></a> |
| 95 | + <a class="addthis_button_'.$wgAddThisHServ[5].'" '.$wgAddThisHServ['5set'].'></a> |
| 96 | + <a class="addthis_button_'.$wgAddThisHServ[6].'" '.$wgAddThisHServ['6set'].'></a> |
| 97 | + <a class="addthis_button_'.$wgAddThisHServ[7].'" '.$wgAddThisHServ['7set'].'></a> |
| 98 | + <a class="addthis_button_'.$wgAddThisHServ[8].'" '.$wgAddThisHServ['8set'].'></a> |
103 | 99 | </div> |
104 | 100 | <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid='.$wgAddThispubid.'"></script> |
105 | 101 | <!-- AddThis Button END -->'); |
Index: trunk/extensions/AddThis/AddThis.php |
— | — | @@ -9,6 +9,7 @@ |
10 | 10 | * @license GPL |
11 | 11 | * |
12 | 12 | * Loosely based on the Google Translator extension by Joachim De Schrijver |
| 13 | + * Thank you to Johnduhart for feedback |
13 | 14 | */ |
14 | 15 | |
15 | 16 | /** |
— | — | @@ -42,72 +43,72 @@ |
43 | 44 | * $wgAddThisMain |
44 | 45 | * - Display AddThis widget on main page |
45 | 46 | * Default is true |
46 | | - * $wgAddThisSBServ1 |
| 47 | + * $wgAddThisSBServ[1] |
47 | 48 | * - Service code for 1st button in sidebar - service codes: http://www.addthis.com/services/list |
48 | 49 | * Default is compact - AddThis icon used to access full AddThis popup menu |
49 | | - * $wgAddThisSBServ1set |
| 50 | + * $wgAddThisSBServ['1set'] |
50 | 51 | * - Settings for 1st button in sidebar - more info: http://www.addthis.com/help/client-api#attribute-config |
51 | | - * $wgAddThisSBServ2 |
| 52 | + * $wgAddThisSBServ[2] |
52 | 53 | * - Service code for 2nd button in sidebar |
53 | 54 | * Default is facebook |
54 | | - * $wgAddThisSBServ2set |
| 55 | + * $wgAddThisSBServ['2set'] |
55 | 56 | * - Settings for 2nd button in sidebar |
56 | | - * $wgAddThisSBServ3 |
| 57 | + * $wgAddThisSBServ[3] |
57 | 58 | * - Service code for 3rd button in sidebar |
58 | 59 | * Default is twitter |
59 | | - * $wgAddThisSBServ3set |
| 60 | + * $wgAddThisSBServ['3set'] |
60 | 61 | * - Settings for 3rd button in sidebar |
61 | | - * $wgAddThisSBServ4 |
| 62 | + * $wgAddThisSBServ[4] |
62 | 63 | * - Service code for 4th button in sidebar |
63 | 64 | * Default is google_plusone |
64 | | - * $wgAddThisSBServ4set |
| 65 | + * $wgAddThisSBServ['4set'] |
65 | 66 | * - Settings for 4th button in sidebar |
66 | 67 | * Default is g:plusone:count="false" style="margin-top:1px;" |
67 | | - * $wgAddThisSBServ5 |
| 68 | + * $wgAddThisSBServ[5] |
68 | 69 | * - Service code for 5th button in sidebar |
69 | 70 | * Default is email |
70 | | - * $wgAddThisSBServ5set |
| 71 | + * $wgAddThisSBServ['5set'] |
71 | 72 | * - Settings for 5th button in sidebar |
72 | | - * $wgAddThisHServ1 |
| 73 | + * $wgAddThisHServ[1] |
73 | 74 | * - Service code for 1st button in article header after AddThis icon (which cannot be moved in the header) |
74 | 75 | * Default is facebook |
75 | | - * $wgAddThisHServ1set |
| 76 | + * $wgAddThisHServ['1set'] |
76 | 77 | * - Settings for 1st button in article header |
77 | | - * $wgAddThisHServ2 |
| 78 | + * $wgAddThisHServ[2] |
78 | 79 | * - Service code for 2nd button in article header |
79 | 80 | * Default is twitter |
80 | | - * $wgAddThisHServ2set |
| 81 | + * $wgAddThisHServ['2set'] |
81 | 82 | * - Settings for 2nd button in article header |
82 | | - * $wgAddThisHServ3 |
| 83 | + * $wgAddThisHServ[3] |
83 | 84 | * - Service code for 3rd button in article header |
84 | 85 | * Default is google_plusone |
85 | | - * $wgAddThisHServ3set |
| 86 | + * $wgAddThisHServ['3set'] |
86 | 87 | * - Settings for 3rd button in article header |
87 | 88 | * Default is g:plusone:count="false" style="margin-top:1px;" |
88 | | - * $wgAddThisHServ4 |
| 89 | + * $wgAddThisHServ[4] |
89 | 90 | * - Service code for 4th button in article header |
90 | 91 | * Default is linkedin |
91 | | - * $wgAddThisHServ4set |
| 92 | + * $wgAddThisHServ['4set'] |
92 | 93 | * - Settings for 4th button in article header |
93 | | - * $wgAddThisHServ5 |
| 94 | + * $wgAddThisHServ[5] |
94 | 95 | * - Service code for 5th button in article header |
95 | 96 | * Default is tumblr |
96 | | - * $wgAddThisHServ5set |
| 97 | + * $wgAddThisHServ['5set'] |
97 | 98 | * - Settings for 5th button in article header |
98 | | - * $wgAddThisHServ6 |
| 99 | + * $wgAddThisHServ[6] |
99 | 100 | * - Service code for 6th button in article header |
100 | 101 | * Default is stumbleupon |
101 | | - * $wgAddThisHServ6set |
| 102 | + * $wgAddThisHServ['6set'] |
102 | 103 | * - Settings for 6th button in article header |
103 | | - * $wgAddThisHServ7 |
| 104 | + * $wgAddThisHServ[7] |
104 | 105 | * - Service code for 7th button in article header |
105 | 106 | * Default is reddit |
106 | | - * $wgAddThisHServ7set |
| 107 | + * $wgAddThisHServ['7set'] |
107 | 108 | * - Settings for 7th button in article header |
108 | | - * $wgAddThisHServ8 |
| 109 | + * $wgAddThisHServ[8] |
109 | 110 | * - Service code for 8th button in article header |
110 | 111 | * Default is email |
111 | | - * $wgAddThisHServ8set |
| 112 | + * $wgAddThisHServ['8set'] |
112 | 113 | * - Settings for 8th button in article header |
113 | 114 | */ |
114 | 115 | |
— | — | @@ -121,34 +122,38 @@ |
122 | 123 | $wgAddThisMain = 'true'; |
123 | 124 | |
124 | 125 | # Sidebar settings |
125 | | -$wgAddThisSBServ1 = 'compact'; |
126 | | -$wgAddThisSBServ1set = ''; |
127 | | -$wgAddThisSBServ2 = 'facebook'; |
128 | | -$wgAddThisSBServ2set = ''; |
129 | | -$wgAddThisSBServ3 = 'twitter'; |
130 | | -$wgAddThisSBServ3set = ''; |
131 | | -$wgAddThisSBServ4 = 'google_plusone'; |
132 | | -$wgAddThisSBServ4set = 'g:plusone:count="false" style="margin-top:1px;"'; |
133 | | -$wgAddThisSBServ5 = 'email'; |
134 | | -$wgAddThisSBServ5set = ''; |
| 126 | +$wgAddThisSBServ = array( |
| 127 | + 1 => 'compact', |
| 128 | + '1set' => '', |
| 129 | + 2 => 'facebook', |
| 130 | + '2set' => '', |
| 131 | + 3 => 'twitter', |
| 132 | + '3set' => '', |
| 133 | + 4 => 'google_plusone', |
| 134 | + '4set' => 'g:plusone:count="false" style="margin-top:1px;"', |
| 135 | + 5 => 'email', |
| 136 | + '5set' => '', |
| 137 | +); |
135 | 138 | |
136 | 139 | # Toolbar settings |
137 | | -$wgAddThisHServ1 = 'facebook'; |
138 | | -$wgAddThisHServ1set = ''; |
139 | | -$wgAddThisHServ2 = 'twitter'; |
140 | | -$wgAddThisHServ2set = ''; |
141 | | -$wgAddThisHServ3 = 'google_plusone'; |
142 | | -$wgAddThisHServ3set = 'g:plusone:count="false" style="margin-top:1px;"'; |
143 | | -$wgAddThisHServ4 = 'linkedin'; |
144 | | -$wgAddThisHServ4set = ''; |
145 | | -$wgAddThisHServ5 = 'tumblr'; |
146 | | -$wgAddThisHServ5set = ''; |
147 | | -$wgAddThisHServ6 = 'stumbleupon'; |
148 | | -$wgAddThisHServ6set = ''; |
149 | | -$wgAddThisHServ7 = 'reddit'; |
150 | | -$wgAddThisHServ7set = ''; |
151 | | -$wgAddThisHServ8 = 'email'; |
152 | | -$wgAddThisHServ8set = ''; |
| 140 | +$wgAddThisHServ = array( |
| 141 | + 1 => 'facebook', |
| 142 | + '1set' => '', |
| 143 | + 2 => 'twitter', |
| 144 | + '2set' => '', |
| 145 | + 3 => 'google_plusone', |
| 146 | + '3set' => 'g:plusone:count="false" style="margin-top:1px;"', |
| 147 | + 4 => 'linkedin', |
| 148 | + '4set' => '', |
| 149 | + 5 => 'tumblr', |
| 150 | + '5set' => '', |
| 151 | + 6 => 'stumbleupon', |
| 152 | + '6set' => '', |
| 153 | + 7 => 'reddit', |
| 154 | + '7set' => '', |
| 155 | + 8 => 'email', |
| 156 | + '8set' => '', |
| 157 | +); |
153 | 158 | |
154 | 159 | |
155 | 160 | /** |