Index: trunk/extensions/CentralNotice/special/SpecialBannerController.php |
— | — | @@ -161,7 +161,7 @@ |
162 | 162 | $script = <<<JAVASCRIPT |
163 | 163 | function insertBanner(bannerJson) { |
164 | 164 | jQuery( 'div#centralNotice' ).prepend( bannerJson.bannerHtml ); |
165 | | - if ( bannerJson.landingCheck ) { |
| 165 | + if ( bannerJson.autolink ) { |
166 | 166 | JAVASCRIPT; |
167 | 167 | $script .= "\n\t\tvar url = '" . |
168 | 168 | Xml::escapeJsString( $wgNoticeFundraisingUrl ) . "';\n"; |
Index: trunk/extensions/CentralNotice/special/SpecialBannerLoader.php |
— | — | @@ -75,7 +75,7 @@ |
76 | 76 | 'bannerHtml' => $bannerHtml, |
77 | 77 | 'campaign' => $this->campaign, |
78 | 78 | 'fundraising' => $this->getFundraising( $bannerName ), |
79 | | - 'landingCheck' => $this->getLandingCheck( $bannerName ), |
| 79 | + 'autolink' => $this->getAutolink( $bannerName ), |
80 | 80 | 'landingPages' => $this->getLandingPages( $bannerName ) |
81 | 81 | ); |
82 | 82 | $bannerJs = 'insertBanner('.FormatJson::encode( $bannerArray ).');'; |
— | — | @@ -204,12 +204,12 @@ |
205 | 205 | return $row->tmp_fundraising; |
206 | 206 | } |
207 | 207 | |
208 | | - function getLandingCheck( $bannerName ) { |
| 208 | + function getAutolink( $bannerName ) { |
209 | 209 | global $wgCentralDBname; |
210 | 210 | $dbr = wfGetDB( DB_SLAVE, array(), $wgCentralDBname ); |
211 | 211 | $eBannerName = htmlspecialchars( $bannerName ); |
212 | | - $row = $dbr->selectRow( 'cn_templates', 'tmp_landingcheck', array( 'tmp_name' => $eBannerName ) ); |
213 | | - return $row->tmp_landingcheck; |
| 212 | + $row = $dbr->selectRow( 'cn_templates', 'tmp_autolink', array( 'tmp_name' => $eBannerName ) ); |
| 213 | + return $row->tmp_autolink; |
214 | 214 | } |
215 | 215 | |
216 | 216 | function getLandingPages( $bannerName ) { |
Index: trunk/extensions/CentralNotice/special/SpecialNoticeTemplate.php |
— | — | @@ -90,7 +90,7 @@ |
91 | 91 | $wgRequest->getBool( 'displayAnon' ), |
92 | 92 | $wgRequest->getBool( 'displayAccount' ), |
93 | 93 | $wgRequest->getBool( 'fundraising' ), |
94 | | - $wgRequest->getBool( 'landingCheck' ), |
| 94 | + $wgRequest->getBool( 'autolink' ), |
95 | 95 | $wgRequest->getVal( 'landingPages' ) |
96 | 96 | ); |
97 | 97 | $sub = 'view'; |
— | — | @@ -107,7 +107,7 @@ |
108 | 108 | $wgRequest->getBool( 'displayAnon' ), |
109 | 109 | $wgRequest->getBool( 'displayAccount' ), |
110 | 110 | $wgRequest->getBool( 'fundraising' ), |
111 | | - $wgRequest->getBool( 'landingCheck' ), |
| 111 | + $wgRequest->getBool( 'autolink' ), |
112 | 112 | $wgRequest->getVal( 'landingPages' ) |
113 | 113 | ); |
114 | 114 | $sub = 'view'; |
— | — | @@ -240,7 +240,7 @@ |
241 | 241 | $displayAnon = $wgRequest->getCheck( 'displayAnon' ); |
242 | 242 | $displayAccount = $wgRequest->getCheck( 'displayAccount' ); |
243 | 243 | $fundraising = $wgRequest->getCheck( 'fundraising' ); |
244 | | - $landingCheck = $wgRequest->getCheck( 'landingCheck' ); |
| 244 | + $autolink = $wgRequest->getCheck( 'autolink' ); |
245 | 245 | $landingPages = $wgRequest->getVal( 'landingPages' ); |
246 | 246 | $body = $wgRequest->getVal( 'templateBody' ); |
247 | 247 | } else { // Use default values |
— | — | @@ -248,7 +248,7 @@ |
249 | 249 | $displayAnon = true; |
250 | 250 | $displayAccount = true; |
251 | 251 | $fundraising = false; |
252 | | - $landingCheck = false; |
| 252 | + $autolink = false; |
253 | 253 | $landingPages = ''; |
254 | 254 | $body = ''; |
255 | 255 | } |
— | — | @@ -279,15 +279,15 @@ |
280 | 280 | $htmlOut .= Xml::label( wfMsg( 'centralnotice-banner-fundraising' ), 'fundraising' ); |
281 | 281 | $htmlOut .= Html::closeElement( 'p' ); |
282 | 282 | |
283 | | - // Checkbox for whether or not to use the LandingCheck extension |
| 283 | + // Checkbox for whether or not to automatically create landing page link |
284 | 284 | $htmlOut .= Html::openElement( 'p', null ); |
285 | | - $htmlOut .= Xml::check( 'landingCheck', $landingCheck, array( 'id' => 'landingCheck' ) ); |
286 | | - $htmlOut .= Xml::label( wfMsg( 'centralnotice-banner-autolink' ), 'landingCheck' ); |
| 285 | + $htmlOut .= Xml::check( 'autolink', $autolink, array( 'id' => 'autolink' ) ); |
| 286 | + $htmlOut .= Xml::label( wfMsg( 'centralnotice-banner-autolink' ), 'autolink' ); |
287 | 287 | $htmlOut .= Html::closeElement( 'p' ); |
288 | 288 | |
289 | 289 | // Interface for setting the landing pages |
290 | 290 | $htmlOut .= Html::openElement( 'div', |
291 | | - array( 'id' => 'landingCheckInterface', 'style' => 'display: none;' ) ); |
| 291 | + array( 'id' => 'autolinkInterface', 'style' => 'display: none;' ) ); |
292 | 292 | $htmlOut .= Xml::tags( 'p', array(), |
293 | 293 | wfMsg( 'centralnotice-banner-autolink-help', 'id="cn-landingpage-link"', 'JimmyAppeal01' ) ); |
294 | 294 | $htmlOut .= Xml::tags( 'p', array(), |
— | — | @@ -563,14 +563,14 @@ |
564 | 564 | $displayAnon = $wgRequest->getCheck( 'displayAnon' ); |
565 | 565 | $displayAccount = $wgRequest->getCheck( 'displayAccount' ); |
566 | 566 | $fundraising = $wgRequest->getCheck( 'fundraising' ); |
567 | | - $landingCheck = $wgRequest->getCheck( 'landingCheck' ); |
| 567 | + $autolink = $wgRequest->getCheck( 'autolink' ); |
568 | 568 | $landingPages = $wgRequest->getVal( 'landingPages' ); |
569 | 569 | $body = $wgRequest->getVal( 'templateBody', $body ); |
570 | 570 | } else { // Use previously stored values |
571 | 571 | $displayAnon = ( $bannerSettings['anon'] == 1 ); |
572 | 572 | $displayAccount = ( $bannerSettings['account'] == 1 ); |
573 | 573 | $fundraising = ( $bannerSettings['fundraising'] == 1 ); |
574 | | - $landingCheck = ( $bannerSettings['landingcheck'] == 1 ); |
| 574 | + $autolink = ( $bannerSettings['autolink'] == 1 ); |
575 | 575 | $landingPages = $bannerSettings['landingpages']; |
576 | 576 | // $body default is defined prior to message interface code |
577 | 577 | } |
— | — | @@ -598,20 +598,20 @@ |
599 | 599 | 'fundraising' ); |
600 | 600 | $htmlOut .= Html::closeElement( 'p' ); |
601 | 601 | |
602 | | - // Checkbox for whether or not to use the LandingCheck extension |
| 602 | + // Checkbox for whether or not to automatically create landing page link |
603 | 603 | $htmlOut .= Html::openElement( 'p', null ); |
604 | | - $htmlOut .= Xml::check( 'landingCheck', $landingCheck, |
605 | | - wfArrayMerge( $disabled, array( 'id' => 'landingCheck' ) ) ); |
| 604 | + $htmlOut .= Xml::check( 'autolink', $autolink, |
| 605 | + wfArrayMerge( $disabled, array( 'id' => 'autolink' ) ) ); |
606 | 606 | $htmlOut .= Xml::label( wfMsg( 'centralnotice-banner-autolink' ), |
607 | | - 'landingCheck' ); |
| 607 | + 'autolink' ); |
608 | 608 | $htmlOut .= Html::closeElement( 'p' ); |
609 | 609 | |
610 | 610 | // Interface for setting the landing pages |
611 | | - if ( $landingCheck ) { |
612 | | - $htmlOut .= Html::openElement( 'div', array( 'id'=>'landingCheckInterface' ) ); |
| 611 | + if ( $autolink ) { |
| 612 | + $htmlOut .= Html::openElement( 'div', array( 'id'=>'autolinkInterface' ) ); |
613 | 613 | } else { |
614 | 614 | $htmlOut .= Html::openElement( 'div', |
615 | | - array( 'id'=>'landingCheckInterface', 'style'=>'display:none;' ) ); |
| 615 | + array( 'id'=>'autolinkInterface', 'style'=>'display:none;' ) ); |
616 | 616 | } |
617 | 617 | $htmlOut .= Xml::tags( 'p', array(), |
618 | 618 | wfMsg( 'centralnotice-banner-autolink-help', 'id="cn-landingpage-link"', 'JimmyAppeal01' ) ); |
— | — | @@ -810,12 +810,12 @@ |
811 | 811 | * @param $displayAnon integer flag for display to anonymous users |
812 | 812 | * @param $displayAccount integer flag for display to logged in users |
813 | 813 | * @param $fundraising integer flag for fundraising banner (optional) |
814 | | - * @param $landingCheck integer flag for using LandingCheck (optional) |
| 814 | + * @param $autolink integer flag for automatically creating landing page links (optional) |
815 | 815 | * @param $landingPages string list of landing pages (optional) |
816 | 816 | * @return true or false depending on whether banner was successfully added |
817 | 817 | */ |
818 | 818 | public function addTemplate( $name, $body, $displayAnon, $displayAccount, $fundraising = 0, |
819 | | - $landingCheck = 0, $landingPages = '' ) { |
| 819 | + $autolink = 0, $landingPages = '' ) { |
820 | 820 | |
821 | 821 | if ( $body == '' || $name == '' ) { |
822 | 822 | $this->showError( 'centralnotice-null-string' ); |
— | — | @@ -844,7 +844,7 @@ |
845 | 845 | 'tmp_display_anon' => $displayAnon, |
846 | 846 | 'tmp_display_account' => $displayAccount, |
847 | 847 | 'tmp_fundraising' => $fundraising, |
848 | | - 'tmp_landingcheck' => $landingCheck, |
| 848 | + 'tmp_autolink' => $autolink, |
849 | 849 | 'tmp_landing_pages' => $landingPages |
850 | 850 | ), |
851 | 851 | __METHOD__ |
— | — | @@ -863,7 +863,7 @@ |
864 | 864 | 'anon' => $displayAnon, |
865 | 865 | 'account' => $displayAccount, |
866 | 866 | 'fundraising' => $fundraising, |
867 | | - 'landingcheck' => $landingCheck, |
| 867 | + 'autolink' => $autolink, |
868 | 868 | 'landingpages' => $landingPages |
869 | 869 | ); |
870 | 870 | $this->logBannerChange( 'created', $bannerId, $beginSettings, $endSettings ); |
— | — | @@ -876,7 +876,7 @@ |
877 | 877 | * Update a banner |
878 | 878 | */ |
879 | 879 | private function editTemplate( $name, $body, $displayAnon, $displayAccount, $fundraising, |
880 | | - $landingCheck, $landingPages ) { |
| 880 | + $autolink, $landingPages ) { |
881 | 881 | |
882 | 882 | if ( $body == '' || $name == '' ) { |
883 | 883 | $this->showError( 'centralnotice-null-string' ); |
— | — | @@ -898,7 +898,7 @@ |
899 | 899 | 'tmp_display_anon' => $displayAnon, |
900 | 900 | 'tmp_display_account' => $displayAccount, |
901 | 901 | 'tmp_fundraising' => $fundraising, |
902 | | - 'tmp_landingcheck' => $landingCheck, |
| 902 | + 'tmp_autolink' => $autolink, |
903 | 903 | 'tmp_landing_pages' => $landingPages |
904 | 904 | ), |
905 | 905 | array( 'tmp_name' => $name ) |
— | — | @@ -945,7 +945,7 @@ |
946 | 946 | 'tmp_display_anon', |
947 | 947 | 'tmp_display_account', |
948 | 948 | 'tmp_fundraising', |
949 | | - 'tmp_landingcheck', |
| 949 | + 'tmp_autolink', |
950 | 950 | 'tmp_landing_pages' |
951 | 951 | ), |
952 | 952 | array( 'tmp_name' => $source ), |
— | — | @@ -954,7 +954,7 @@ |
955 | 955 | $displayAnon = $row->tmp_display_anon; |
956 | 956 | $displayAccount = $row->tmp_display_account; |
957 | 957 | $fundraising = $row->tmp_fundraising; |
958 | | - $landingCheck = $row->tmp_landingcheck; |
| 958 | + $autolink = $row->tmp_autolink; |
959 | 959 | $landingPages = $row->tmp_landing_pages; |
960 | 960 | |
961 | 961 | // Pull banner text and respect any inc: markup |
— | — | @@ -963,7 +963,7 @@ |
964 | 964 | |
965 | 965 | // Create new banner |
966 | 966 | if ( $this->addTemplate( $dest, $template_body, $displayAnon, $displayAccount, $fundraising, |
967 | | - $landingCheck, $landingPages ) ) { |
| 967 | + $autolink, $landingPages ) ) { |
968 | 968 | |
969 | 969 | // Populate the fields |
970 | 970 | foreach ( $langs as $lang => $fields ) { |
Index: trunk/extensions/CentralNotice/CentralNotice.php |
— | — | @@ -161,8 +161,8 @@ |
162 | 162 | $base . '/patches/patch-notice_log.sql' ); |
163 | 163 | $wgExtNewTables[] = array( 'cn_template_log', |
164 | 164 | $base . '/patches/patch-template_log.sql' ); |
165 | | - $wgExtNewFields[] = array( 'cn_templates', 'tmp_landingcheck', |
166 | | - $base . '/patches/patch-template_landingcheck.sql' ); |
| 165 | + $wgExtNewFields[] = array( 'cn_templates', 'tmp_autolink', |
| 166 | + $base . '/patches/patch-template_autolink.sql' ); |
167 | 167 | } |
168 | 168 | } else { |
169 | 169 | if ( $updater->getDB()->getType() == 'mysql' ) { |
— | — | @@ -184,8 +184,8 @@ |
185 | 185 | $base . '/patches/patch-notice_log.sql', true ) ); |
186 | 186 | $updater->addExtensionUpdate( array( 'addTable', 'cn_template_log', |
187 | 187 | $base . '/patches/patch-template_log.sql', true ) ); |
188 | | - $updater->addExtensionUpdate( array( 'addField', 'cn_templates', 'tmp_landingcheck', |
189 | | - $base . '/patches/patch-template_landingcheck.sql', true ) ); |
| 188 | + $updater->addExtensionUpdate( array( 'addField', 'cn_templates', 'tmp_autolink', |
| 189 | + $base . '/patches/patch-template_autolink.sql', true ) ); |
190 | 190 | } |
191 | 191 | } |
192 | 192 | return true; |
Index: trunk/extensions/CentralNotice/patches/patch-template_landingcheck.sql |
— | — | @@ -1,8 +0,0 @@ |
2 | | - |
3 | | -ALTER TABLE /*$wgDBprefix*/cn_templates ADD `tmp_landingcheck` bool NOT NULL DEFAULT 0 AFTER `tmp_fundraising`; |
4 | | - |
5 | | -ALTER TABLE /*$wgDBprefix*/cn_template_log ADD `tmplog_begin_landingcheck` bool NULL DEFAULT NULL AFTER `tmplog_end_fundraising`; |
6 | | -ALTER TABLE /*$wgDBprefix*/cn_template_log ADD `tmplog_end_landingcheck` bool NULL DEFAULT NULL AFTER `tmplog_begin_landingcheck`; |
\ No newline at end of file |
Index: trunk/extensions/CentralNotice/patches/patch-template_autolink.sql |
— | — | @@ -0,0 +1,8 @@ |
| 2 | +-- Update to add a separate flag for automatic link creation |
| 3 | + |
| 4 | +-- Store a flag indicating whether or not this banner uses automatic link creation |
| 5 | +ALTER TABLE /*$wgDBprefix*/cn_templates ADD `tmp_autolink` bool NOT NULL DEFAULT 0 AFTER `tmp_fundraising`; |
| 6 | + |
| 7 | +-- Store before and after flag values for logging |
| 8 | +ALTER TABLE /*$wgDBprefix*/cn_template_log ADD `tmplog_begin_autolink` bool NULL DEFAULT NULL AFTER `tmplog_end_fundraising`; |
| 9 | +ALTER TABLE /*$wgDBprefix*/cn_template_log ADD `tmplog_end_autolink` bool NULL DEFAULT NULL AFTER `tmplog_begin_autolink`; |
\ No newline at end of file |
Index: trunk/extensions/CentralNotice/CentralNoticeBannerLogPager.php |
— | — | @@ -151,8 +151,8 @@ |
152 | 152 | )."<br/>"; |
153 | 153 | $details .= wfMsg ( |
154 | 154 | 'centralnotice-log-label', |
155 | | - wfMsg ( 'centralnotice-landingcheck' ), |
156 | | - ($row->tmplog_end_landingcheck ? 'on' : 'off') |
| 155 | + wfMsg ( 'centralnotice-autolink' ), |
| 156 | + ($row->tmplog_end_autolink ? 'on' : 'off') |
157 | 157 | )."<br/>"; |
158 | 158 | if ( $row->tmplog_end_landingpages ) { |
159 | 159 | $details .= wfMsg ( |
— | — | @@ -170,7 +170,7 @@ |
171 | 171 | $details .= $this->testBooleanChange( 'anon', $row ); |
172 | 172 | $details .= $this->testBooleanChange( 'account', $row ); |
173 | 173 | $details .= $this->testBooleanChange( 'fundraising', $row ); |
174 | | - $details .= $this->testBooleanChange( 'landingcheck', $row ); |
| 174 | + $details .= $this->testBooleanChange( 'autolink', $row ); |
175 | 175 | $details .= $this->testTextChange( 'landingpages', $row ); |
176 | 176 | if ( $row->tmplog_content_change ) { |
177 | 177 | // Show changes to banner content |
Index: trunk/extensions/CentralNotice/CentralNotice.i18n.php |
— | — | @@ -168,7 +168,7 @@ |
169 | 169 | 'centralnotice-anon' => 'Display to anonymous users', |
170 | 170 | 'centralnotice-account' => 'Display to logged in users', |
171 | 171 | 'centralnotice-fundraising' => 'Fundraising', |
172 | | - 'centralnotice-landingcheck' => 'LandingCheck', |
| 172 | + 'centralnotice-autolink' => 'Automatic link creation', |
173 | 173 | 'centralnotice-landingpages' => 'Landing pages', |
174 | 174 | 'centralnotice-banner-content' => 'Banner content', |
175 | 175 | 'centralnotice-banner-content-changed' => 'Changed', |
— | — | @@ -292,7 +292,7 @@ |
293 | 293 | 'centralnotice-banner-settings' => "Label for a radio button |
294 | 294 | |
295 | 295 | {{msg-mw|Centralnotice-banner-settings}} and {{msg-mw|Centralnotice-banner-content}} are visible at [{{fullurl:meta:Special:CentralNoticeLogs|log=bannersettings}} Special:CentralNoticeLogs] – ''settings'' chooses between logs for campaigns and log for banners, ''content'' is one of the things which could be changed on a banner (see the details of a log entry). So, I would go with “banners in general” for ''settings'' and “a single banner” in ''content''.", |
296 | | - 'centralnotice-landingcheck' => 'This is a the name of a MediaWiki extension.', |
| 296 | + 'centralnotice-autolink' => 'Label for a setting', |
297 | 297 | 'centralnotice-banner-content' => "{{msg-mw|Centralnotice-banner-settings}} and {{msg-mw|Centralnotice-banner-content}} appear to be visible at [{{fullurl:meta:Special:CentralNoticeLogs|log=bannersettings}} Special:CentralNoticeLogs] – ''settings'' chooses between logs for campaigns and log for banners, ''content'' is one of the things which could be changed on a banner (see the details of a log entry). So, I would go with “banners in general” for ''settings'' and “a single banner” in ''content''.", |
298 | 298 | 'centralnotice-filters' => 'Label for a set of options that control filtering of logs', |
299 | 299 | 'centralnotice-date' => 'Label for a date selection interface', |
Index: trunk/extensions/CentralNotice/CentralNotice.db.php |
— | — | @@ -214,7 +214,7 @@ |
215 | 215 | 'tmp_display_anon', |
216 | 216 | 'tmp_display_account', |
217 | 217 | 'tmp_fundraising', |
218 | | - 'tmp_landingcheck', |
| 218 | + 'tmp_autolink', |
219 | 219 | 'tmp_landing_pages', |
220 | 220 | 'not_name' |
221 | 221 | ), |
— | — | @@ -233,7 +233,7 @@ |
234 | 234 | 'display_anon' => intval( $row->tmp_display_anon ), // display to anonymous users? |
235 | 235 | 'display_account' => intval( $row->tmp_display_account ), // display to logged in users? |
236 | 236 | 'fundraising' => intval( $row->tmp_fundraising ), // fundraising banner? |
237 | | - 'landingcheck' => intval( $row->tmp_landingcheck ), // use LandingCheck? |
| 237 | + 'autolink' => intval( $row->tmp_autolink ), // automatically create links? |
238 | 238 | 'landing_pages' => $row->tmp_landing_pages, // landing pages to link to |
239 | 239 | 'campaign' => $row->not_name // campaign the banner is assigned to |
240 | 240 | ); |
— | — | @@ -265,7 +265,7 @@ |
266 | 266 | 'tmp_display_anon', |
267 | 267 | 'tmp_display_account', |
268 | 268 | 'tmp_fundraising', |
269 | | - 'tmp_landingcheck', |
| 269 | + 'tmp_autolink', |
270 | 270 | 'tmp_landing_pages' |
271 | 271 | ), |
272 | 272 | array( 'tmp_name' => $bannerName ), |
— | — | @@ -277,7 +277,7 @@ |
278 | 278 | 'anon' => $row->tmp_display_anon, |
279 | 279 | 'account' => $row->tmp_display_account, |
280 | 280 | 'fundraising' => $row->tmp_fundraising, |
281 | | - 'landingcheck' => $row->tmp_landingcheck, |
| 281 | + 'autolink' => $row->tmp_autolink, |
282 | 282 | 'landingpages' => $row->tmp_landing_pages |
283 | 283 | ); |
284 | 284 | } |
Index: trunk/extensions/CentralNotice/centralnotice.js |
— | — | @@ -106,12 +106,12 @@ |
107 | 107 | $("#geoMultiSelector").fadeOut('fast'); |
108 | 108 | } |
109 | 109 | }); |
110 | | - // Reveal the LandingCheck interface when the LandingCheck checkbox is checked |
111 | | - $("#landingCheck").click(function () { |
112 | | - if ($('#landingCheck:checked').val() !== undefined) { |
113 | | - $("#landingCheckInterface").fadeIn('fast'); |
| 110 | + // Reveal the landing page interface when the autolink checkbox is checked |
| 111 | + $("#autolink").click(function () { |
| 112 | + if ($('#autolink:checked').val() !== undefined) { |
| 113 | + $("#autolinkInterface").fadeIn('fast'); |
114 | 114 | } else { |
115 | | - $("#landingCheckInterface").fadeOut('fast'); |
| 115 | + $("#autolinkInterface").fadeOut('fast'); |
116 | 116 | } |
117 | 117 | }); |
118 | 118 | }); |