r90680 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90679‎ | r90680 | r90681 >
Date:22:18, 23 June 2011
Author:kaldari
Status:ok
Tags:
Comment:
making fundraising interface dependant on wgNoticeEnableFundraising global var
Modified paths:
  • /trunk/extensions/CentralNotice/SpecialNoticeTemplate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/SpecialNoticeTemplate.php
@@ -220,7 +220,7 @@
221221 * Show "Add a banner" interface
222222 */
223223 function showAdd() {
224 - global $wgOut, $wgUser, $wgExtensionAssetsPath, $wgLang, $wgRequest;
 224+ global $wgOut, $wgUser, $wgExtensionAssetsPath, $wgLang, $wgRequest, $wgNoticeEnableFundraising;
225225 $scriptPath = "$wgExtensionAssetsPath/CentralNotice";
226226
227227 // Build HTML
@@ -266,20 +266,22 @@
267267 $htmlOut .= Xml::closeElement( 'p' );
268268
269269 // Fundraising settings
270 - $htmlOut .= Xml::openElement( 'p', null );
271 - $htmlOut .= Xml::check( 'fundraising', $fundraising, array( 'id' => 'fundraising' ) );
272 - $htmlOut .= Xml::label( wfMsg( 'centralnotice-banner-fundraising' ), 'fundraising' );
273 - $htmlOut .= Xml::closeElement( 'p' );
274 - $htmlOut .= Xml::openElement( 'div', array( 'id' => 'fundraisingInterface', 'style' => 'display: none;' ) );
275 - $htmlOut .= Xml::tags( 'p', array(), wfMsg( 'centralnotice-banner-fundraising-help' ) );
276 - $htmlOut .= Xml::tags( 'p', array(),
277 - Xml::inputLabel(
278 - wfMsg( 'centralnotice-banner-landing-pages' ),
279 - 'landingPages', 'landingPages', 40, $landingPages,
280 - array( 'maxlength' => 255 )
281 - )
282 - );
283 - $htmlOut .= Xml::closeElement( 'div' );
 270+ if ( $wgNoticeEnableFundraising ) {
 271+ $htmlOut .= Xml::openElement( 'p', null );
 272+ $htmlOut .= Xml::check( 'fundraising', $fundraising, array( 'id' => 'fundraising' ) );
 273+ $htmlOut .= Xml::label( wfMsg( 'centralnotice-banner-fundraising' ), 'fundraising' );
 274+ $htmlOut .= Xml::closeElement( 'p' );
 275+ $htmlOut .= Xml::openElement( 'div', array( 'id' => 'fundraisingInterface', 'style' => 'display: none;' ) );
 276+ $htmlOut .= Xml::tags( 'p', array(), wfMsg( 'centralnotice-banner-fundraising-help' ) );
 277+ $htmlOut .= Xml::tags( 'p', array(),
 278+ Xml::inputLabel(
 279+ wfMsg( 'centralnotice-banner-landing-pages' ),
 280+ 'landingPages', 'landingPages', 40, $landingPages,
 281+ array( 'maxlength' => 255 )
 282+ )
 283+ );
 284+ $htmlOut .= Xml::closeElement( 'div' );
 285+ }
284286
285287 // Begin banner body section
286288 $htmlOut .= Xml::fieldset( wfMsg( 'centralnotice-banner' ) );
@@ -314,7 +316,7 @@
315317 * View or edit an individual banner
316318 */
317319 private function showView() {
318 - global $wgOut, $wgUser, $wgRequest, $wgLanguageCode, $wgExtensionAssetsPath, $wgLang;
 320+ global $wgOut, $wgUser, $wgRequest, $wgLanguageCode, $wgExtensionAssetsPath, $wgLang, $wgNoticeEnableFundraising;
319321
320322 $scriptPath = "$wgExtensionAssetsPath/CentralNotice";
321323 $sk = $wgUser->getSkin();
@@ -575,25 +577,27 @@
576578 $htmlOut .= Xml::closeElement( 'p' );
577579
578580 // Fundraising settings
579 - $htmlOut .= Xml::openElement( 'p', null );
580 - $htmlOut .= Xml::check( 'fundraising', $fundraising,
581 - wfArrayMerge( $disabled, array( 'id' => 'fundraising' ) ) );
582 - $htmlOut .= Xml::label( wfMsg( 'centralnotice-banner-fundraising' ), 'fundraising' );
583 - $htmlOut .= Xml::closeElement( 'p' );
584 - if ( $fundraising ) {
585 - $htmlOut .= Xml::openElement( 'div', array( 'id'=>'fundraisingInterface' ) );
586 - } else {
587 - $htmlOut .= Xml::openElement( 'div', array( 'id'=>'fundraisingInterface', 'style'=>'display:none;' ) );
 581+ if ( $wgNoticeEnableFundraising ) {
 582+ $htmlOut .= Xml::openElement( 'p', null );
 583+ $htmlOut .= Xml::check( 'fundraising', $fundraising,
 584+ wfArrayMerge( $disabled, array( 'id' => 'fundraising' ) ) );
 585+ $htmlOut .= Xml::label( wfMsg( 'centralnotice-banner-fundraising' ), 'fundraising' );
 586+ $htmlOut .= Xml::closeElement( 'p' );
 587+ if ( $fundraising ) {
 588+ $htmlOut .= Xml::openElement( 'div', array( 'id'=>'fundraisingInterface' ) );
 589+ } else {
 590+ $htmlOut .= Xml::openElement( 'div', array( 'id'=>'fundraisingInterface', 'style'=>'display:none;' ) );
 591+ }
 592+ $htmlOut .= Xml::tags( 'p', array(), wfMsg( 'centralnotice-banner-fundraising-help' ) );
 593+ $htmlOut .= Xml::tags( 'p', array(),
 594+ Xml::inputLabel(
 595+ wfMsg( 'centralnotice-banner-landing-pages' ),
 596+ 'landingPages', 'landingPages', 40, $landingPages,
 597+ array( 'maxlength' => 255 )
 598+ )
 599+ );
 600+ $htmlOut .= Xml::closeElement( 'div' );
588601 }
589 - $htmlOut .= Xml::tags( 'p', array(), wfMsg( 'centralnotice-banner-fundraising-help' ) );
590 - $htmlOut .= Xml::tags( 'p', array(),
591 - Xml::inputLabel(
592 - wfMsg( 'centralnotice-banner-landing-pages' ),
593 - 'landingPages', 'landingPages', 40, $landingPages,
594 - array( 'maxlength' => 255 )
595 - )
596 - );
597 - $htmlOut .= Xml::closeElement( 'div' );
598602
599603 // Begin banner body section
600604 $htmlOut .= Xml::closeElement( 'fieldset' );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r89583fundraising specific code - mostly for automatic link construction and trackingkaldari17:09, 6 June 2011

Status & tagging log