Index: trunk/extensions/CentralNotice/SpecialNoticeTemplate.php |
— | — | @@ -220,7 +220,7 @@ |
221 | 221 | * Show "Add a banner" interface |
222 | 222 | */ |
223 | 223 | function showAdd() { |
224 | | - global $wgOut, $wgUser, $wgExtensionAssetsPath, $wgLang, $wgRequest; |
| 224 | + global $wgOut, $wgUser, $wgExtensionAssetsPath, $wgLang, $wgRequest, $wgNoticeEnableFundraising; |
225 | 225 | $scriptPath = "$wgExtensionAssetsPath/CentralNotice"; |
226 | 226 | |
227 | 227 | // Build HTML |
— | — | @@ -266,20 +266,22 @@ |
267 | 267 | $htmlOut .= Xml::closeElement( 'p' ); |
268 | 268 | |
269 | 269 | // 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 | + } |
284 | 286 | |
285 | 287 | // Begin banner body section |
286 | 288 | $htmlOut .= Xml::fieldset( wfMsg( 'centralnotice-banner' ) ); |
— | — | @@ -314,7 +316,7 @@ |
315 | 317 | * View or edit an individual banner |
316 | 318 | */ |
317 | 319 | private function showView() { |
318 | | - global $wgOut, $wgUser, $wgRequest, $wgLanguageCode, $wgExtensionAssetsPath, $wgLang; |
| 320 | + global $wgOut, $wgUser, $wgRequest, $wgLanguageCode, $wgExtensionAssetsPath, $wgLang, $wgNoticeEnableFundraising; |
319 | 321 | |
320 | 322 | $scriptPath = "$wgExtensionAssetsPath/CentralNotice"; |
321 | 323 | $sk = $wgUser->getSkin(); |
— | — | @@ -575,25 +577,27 @@ |
576 | 578 | $htmlOut .= Xml::closeElement( 'p' ); |
577 | 579 | |
578 | 580 | // 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' ); |
588 | 601 | } |
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' ); |
598 | 602 | |
599 | 603 | // Begin banner body section |
600 | 604 | $htmlOut .= Xml::closeElement( 'fieldset' ); |