Index: trunk/extensions/CentralNotice/SpecialNoticeTemplate.php |
— | — | @@ -73,23 +73,11 @@ |
74 | 74 | // FIXME: getText()? weak comparison |
75 | 75 | if ( $wgRequest->getVal( 'wpMethod' ) == 'addTemplate' ) { |
76 | 76 | |
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 | | - |
89 | 77 | $this->addTemplate( |
90 | 78 | $wgRequest->getVal( 'templateName' ), |
91 | 79 | $wgRequest->getVal( 'templateBody' ), |
92 | | - $displayAnon, |
93 | | - $displayAccount |
| 80 | + $wgRequest->getBool( 'displayAnon' ), |
| 81 | + $wgRequest->getBool( 'displayAccount' ) |
94 | 82 | ); |
95 | 83 | $sub = 'view'; |
96 | 84 | } |
— | — | @@ -97,23 +85,11 @@ |
98 | 86 | // Handle editing banner |
99 | 87 | if ( $wgRequest->getVal( 'wpMethod' ) == 'editTemplate' ) { |
100 | 88 | |
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 | | - |
113 | 89 | $this->editTemplate( |
114 | 90 | $wgRequest->getVal( 'template' ), |
115 | 91 | $wgRequest->getVal( 'templateBody' ), |
116 | | - $displayAnon, |
117 | | - $displayAccount |
| 92 | + $wgRequest->getBool( 'displayAnon' ), |
| 93 | + $wgRequest->getBool( 'displayAccount' ) |
118 | 94 | ); |
119 | 95 | $sub = 'view'; |
120 | 96 | } |