r71581 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71580‎ | r71581 | r71582 >
Date:20:43, 24 August 2010
Author:kaldari
Status:ok
Tags:
Comment:
unreinventing getBool per r71004 comment
Modified paths:
  • /trunk/extensions/CentralNotice/SpecialNoticeTemplate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/SpecialNoticeTemplate.php
@@ -73,23 +73,11 @@
7474 // FIXME: getText()? weak comparison
7575 if ( $wgRequest->getVal( 'wpMethod' ) == 'addTemplate' ) {
7676
77 - // Handle "Display to anonymous users" checkbox
78 - $displayAnon = 0;
79 - if ( $wgRequest->getVal( 'displayAnon' ) ) {
80 - $displayAnon = $wgRequest->getVal( 'displayAnon' );
81 - }
82 -
83 - // Handle "Display to logged in users" checkbox
84 - $displayAccount = 0;
85 - if ( $wgRequest->getVal( 'displayAccount' ) ) {
86 - $displayAccount = $wgRequest->getVal( 'displayAccount' );
87 - }
88 -
8977 $this->addTemplate(
9078 $wgRequest->getVal( 'templateName' ),
9179 $wgRequest->getVal( 'templateBody' ),
92 - $displayAnon,
93 - $displayAccount
 80+ $wgRequest->getBool( 'displayAnon' ),
 81+ $wgRequest->getBool( 'displayAccount' )
9482 );
9583 $sub = 'view';
9684 }
@@ -97,23 +85,11 @@
9886 // Handle editing banner
9987 if ( $wgRequest->getVal( 'wpMethod' ) == 'editTemplate' ) {
10088
101 - // Handle "Display to anonymous users" checkbox
102 - $displayAnon = 0;
103 - if ( $wgRequest->getVal( 'displayAnon' ) ) {
104 - $displayAnon = $wgRequest->getVal( 'displayAnon' );
105 - }
106 -
107 - // Handle "Display to logged in users" checkbox
108 - $displayAccount = 0;
109 - if ( $wgRequest->getVal( 'displayAccount' ) ) {
110 - $displayAccount = $wgRequest->getVal( 'displayAccount' );
111 - }
112 -
11389 $this->editTemplate(
11490 $wgRequest->getVal( 'template' ),
11591 $wgRequest->getVal( 'templateBody' ),
116 - $displayAnon,
117 - $displayAccount
 92+ $wgRequest->getBool( 'displayAnon' ),
 93+ $wgRequest->getBool( 'displayAccount' )
11894 );
11995 $sub = 'view';
12096 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r71004allow control of whether banners are displayed to anon and/or logged in userskaldari01:52, 13 August 2010

Status & tagging log