Index: trunk/extensions/CentralNotice/SpecialNoticeTemplate.php |
— | — | @@ -222,9 +222,19 @@ |
223 | 223 | |
224 | 224 | $htmlOut .= Xml::openElement( 'p', null ); |
225 | 225 | $htmlOut .= wfMsg( 'centralnotice-banner-display' ); |
226 | | - $htmlOut .= Xml::check( 'displayAnon', true, array( 'id' => 'displayAnon' ) ); |
| 226 | + if ( $wgRequest->wasPosted() ) { |
| 227 | + $displayAnon = $wgRequest->getCheck( 'displayAnon' ); |
| 228 | + } else { |
| 229 | + $displayAnon = true; |
| 230 | + } |
| 231 | + $htmlOut .= Xml::check( 'displayAnon', $displayAnon, array( 'id' => 'displayAnon' ) ); |
227 | 232 | $htmlOut .= Xml::label( wfMsg( 'centralnotice-banner-anonymous' ), 'displayAnon' ); |
228 | | - $htmlOut .= Xml::check( 'displayAccount', true, array( 'id' => 'displayAccount' ) ); |
| 233 | + if ( $wgRequest->wasPosted() ) { |
| 234 | + $displayAccount = $wgRequest->getCheck( 'displayAccount' ); |
| 235 | + } else { |
| 236 | + $displayAccount = true; |
| 237 | + } |
| 238 | + $htmlOut .= Xml::check( 'displayAccount', $displayAccount, array( 'id' => 'displayAccount' ) ); |
229 | 239 | $htmlOut .= Xml::label( wfMsg( 'centralnotice-banner-logged-in' ), 'displayAccount' ); |
230 | 240 | $htmlOut .= Xml::closeElement( 'p' ); |
231 | 241 | |
— | — | @@ -457,9 +467,19 @@ |
458 | 468 | $htmlOut .= Xml::fieldset( wfMsg( 'centralnotice-settings' ) ); |
459 | 469 | $htmlOut .= Xml::openElement( 'p', null ); |
460 | 470 | $htmlOut .= wfMsg( 'centralnotice-banner-display' ); |
461 | | - $htmlOut .= Xml::check( 'displayAnon', ( $row->tmp_display_anon == 1 ), wfArrayMerge( $disabled, array( 'id' => 'displayAnon' ) ) ); |
| 471 | + if ( $wgRequest->wasPosted() ) { |
| 472 | + $displayAnon = $wgRequest->getCheck( 'displayAnon' ); |
| 473 | + } else { |
| 474 | + $displayAnon = ( $row->tmp_display_anon == 1 ); |
| 475 | + } |
| 476 | + $htmlOut .= Xml::check( 'displayAnon', $displayAnon, wfArrayMerge( $disabled, array( 'id' => 'displayAnon' ) ) ); |
462 | 477 | $htmlOut .= Xml::label( wfMsg( 'centralnotice-banner-anonymous' ), 'displayAnon' ); |
463 | | - $htmlOut .= Xml::check( 'displayAccount', ( $row->tmp_display_account == 1 ), wfArrayMerge( $disabled, array( 'id' => 'displayAccount' ) ) ); |
| 478 | + if ( $wgRequest->wasPosted() ) { |
| 479 | + $displayAccount = $wgRequest->getCheck( 'displayAccount' ); |
| 480 | + } else { |
| 481 | + $displayAccount = ( $row->tmp_display_account == 1 ); |
| 482 | + } |
| 483 | + $htmlOut .= Xml::check( 'displayAccount', $displayAccount, wfArrayMerge( $disabled, array( 'id' => 'displayAccount' ) ) ); |
464 | 484 | $htmlOut .= Xml::label( wfMsg( 'centralnotice-banner-logged-in' ), 'displayAccount' ); |
465 | 485 | $htmlOut .= Xml::closeElement( 'p' ); |
466 | 486 | $htmlOut .= Xml::closeElement( 'fieldset' ); |