Index: trunk/extensions/CentralNotice/SpecialCentralNotice.php |
— | — | @@ -724,11 +724,17 @@ |
725 | 725 | $endArray['month'] . |
726 | 726 | $endArray['day'] . '000000' |
727 | 727 | ; |
| 728 | + $isEnabled = $wgRequest->getCheck( 'enabled' ); |
| 729 | + $isPreferred = $wgRequest->getCheck( 'preferred' ); |
| 730 | + $isLocked = $wgRequest->getCheck( 'locked' ); |
728 | 731 | $projectSelected = $wgRequest->getVal( 'project_name' ); |
729 | 732 | $noticeLanguages = $wgRequest->getArray( 'project_languages', array() ); |
730 | 733 | } else { // Defaults |
731 | 734 | $startTimestamp = $row->not_start; |
732 | 735 | $endTimestamp = $row->not_end; |
| 736 | + $isEnabled = ( $row->not_enabled == '1' ); |
| 737 | + $isPreferred = ( $row->not_preferred == '1' ); |
| 738 | + $isLocked = ( $row->not_locked == '1' ); |
733 | 739 | $projectSelected = $row->not_project; |
734 | 740 | $noticeLanguages = $this->getNoticeLanguages( $notice ); |
735 | 741 | } |
— | — | @@ -767,17 +773,17 @@ |
768 | 774 | // Enabled |
769 | 775 | $htmlOut .= Xml::openElement( 'tr' ); |
770 | 776 | $htmlOut .= Xml::tags( 'td', array(), Xml::label( wfMsgHtml( 'centralnotice-enabled' ), 'enabled' ) ); |
771 | | - $htmlOut .= Xml::tags( 'td', array(), Xml::check( 'enabled', ( $row->not_enabled == '1' ), wfArrayMerge( $readonly, array( 'value' => $row->not_name, 'id' => 'enabled' ) ) ) ); |
| 777 | + $htmlOut .= Xml::tags( 'td', array(), Xml::check( 'enabled', $isEnabled, wfArrayMerge( $readonly, array( 'value' => $row->not_name, 'id' => 'enabled' ) ) ) ); |
772 | 778 | $htmlOut .= Xml::closeElement( 'tr' ); |
773 | 779 | // Preferred |
774 | 780 | $htmlOut .= Xml::openElement( 'tr' ); |
775 | 781 | $htmlOut .= Xml::tags( 'td', array(), Xml::label( wfMsgHtml( 'centralnotice-preferred' ), 'preferred' ) ); |
776 | | - $htmlOut .= Xml::tags( 'td', array(), Xml::check( 'preferred', ( $row->not_preferred == '1' ), wfArrayMerge( $readonly, array( 'value' => $row->not_name, 'id' => 'preferred' ) ) ) ); |
| 782 | + $htmlOut .= Xml::tags( 'td', array(), Xml::check( 'preferred', $isPreferred, wfArrayMerge( $readonly, array( 'value' => $row->not_name, 'id' => 'preferred' ) ) ) ); |
777 | 783 | $htmlOut .= Xml::closeElement( 'tr' ); |
778 | 784 | // Locked |
779 | 785 | $htmlOut .= Xml::openElement( 'tr' ); |
780 | 786 | $htmlOut .= Xml::tags( 'td', array(), Xml::label( wfMsgHtml( 'centralnotice-locked' ), 'locked' ) ); |
781 | | - $htmlOut .= Xml::tags( 'td', array(), Xml::check( 'locked', ( $row->not_locked == '1' ), wfArrayMerge( $readonly, array( 'value' => $row->not_name, 'id' => 'locked' ) ) ) ); |
| 787 | + $htmlOut .= Xml::tags( 'td', array(), Xml::check( 'locked', $isLocked, wfArrayMerge( $readonly, array( 'value' => $row->not_name, 'id' => 'locked' ) ) ) ); |
782 | 788 | $htmlOut .= Xml::closeElement( 'tr' ); |
783 | 789 | if ( $this->editable ) { |
784 | 790 | // Locked |
Index: trunk/extensions/CentralNotice/SpecialNoticeTemplate.php |
— | — | @@ -462,8 +462,8 @@ |
463 | 463 | |
464 | 464 | // If there was an error, we'll need to restore the state of the form |
465 | 465 | if ( $wgRequest->wasPosted() && $wgRequest->getVal( 'mainform' ) ) { |
466 | | - $displayAnon = $wgRequest->getCheck( 'displayAnon' ); // Restore checkbox state in event of error |
467 | | - $displayAccount = $wgRequest->getCheck( 'displayAccount' ); // Restore checkbox state in event of error |
| 466 | + $displayAnon = $wgRequest->getCheck( 'displayAnon' ); |
| 467 | + $displayAccount = $wgRequest->getCheck( 'displayAccount' ); |
468 | 468 | $body = $wgRequest->getVal( 'templateBody', $body ); |
469 | 469 | } else { // Defaults |
470 | 470 | $displayAnon = ( $row->tmp_display_anon == 1 ); |