Index: trunk/extensions/CentralNotice/SpecialCentralNotice.php |
— | — | @@ -511,7 +511,7 @@ |
512 | 512 | |
513 | 513 | if ( $this->editable ) { |
514 | 514 | |
515 | | - // If there was an error, we'll need to restore the state of the start date and time select lists |
| 515 | + // If there was an error, we'll need to restore the state of the form |
516 | 516 | if ( $wgRequest->wasPosted() ) { |
517 | 517 | $startArray = $wgRequest->getArray( 'start' ); |
518 | 518 | $timestamp = $startArray['year'] . |
— | — | @@ -520,8 +520,12 @@ |
521 | 521 | $startArray['hour'] . |
522 | 522 | $startArray['min'] . '00' |
523 | 523 | ; |
| 524 | + $projectSelected = $wgRequest->getVal( 'project_name' ); |
| 525 | + $noticeLanguages = $wgRequest->getArray( 'project_languages' ); |
524 | 526 | } else { |
525 | 527 | $timestamp = null; |
| 528 | + $projectSelected = ''; |
| 529 | + $noticeLanguages = array(); |
526 | 530 | } |
527 | 531 | |
528 | 532 | // Begin Add a campaign fieldset |
— | — | @@ -553,12 +557,12 @@ |
554 | 558 | // Project |
555 | 559 | $htmlOut .= Xml::openElement( 'tr' ); |
556 | 560 | $htmlOut .= Xml::tags( 'td', array(), wfMsgHtml( 'centralnotice-project-name' ) ); |
557 | | - $htmlOut .= Xml::tags( 'td', array(), $this->projectDropDownList() ); |
| 561 | + $htmlOut .= Xml::tags( 'td', array(), $this->projectDropDownList( $projectSelected ) ); |
558 | 562 | $htmlOut .= Xml::closeElement( 'tr' ); |
559 | 563 | // Languages |
560 | 564 | $htmlOut .= Xml::openElement( 'tr' ); |
561 | 565 | $htmlOut .= Xml::tags( 'td', array( 'valign' => 'top' ), wfMsgHtml( 'yourlanguage' ) ); |
562 | | - $htmlOut .= Xml::tags( 'td', array(), $this->languageMultiSelector() ); |
| 566 | + $htmlOut .= Xml::tags( 'td', array(), $this->languageMultiSelector( $noticeLanguages ) ); |
563 | 567 | $htmlOut .= Xml::closeElement( 'tr' ); |
564 | 568 | $htmlOut .= Xml::closeElement( 'table' ); |
565 | 569 | $htmlOut .= Xml::hidden( 'change', 'weight' ); |
— | — | @@ -731,7 +735,7 @@ |
732 | 736 | |
733 | 737 | if ( $row ) { |
734 | 738 | |
735 | | - // If there was an error, we'll need to restore the state of the start date and time select lists |
| 739 | + // If there was an error, we'll need to restore the state of the form |
736 | 740 | if ( $wgRequest->wasPosted() ) { |
737 | 741 | $startArray = $wgRequest->getArray( 'start' ); |
738 | 742 | $timestamp = $startArray['year'] . |
— | — | @@ -740,12 +744,13 @@ |
741 | 745 | $startArray['hour'] . |
742 | 746 | $startArray['min'] . '00' |
743 | 747 | ; |
| 748 | + $projectSelected = $wgRequest->getVal( 'project_name' ); |
| 749 | + $noticeLanguages = $wgRequest->getArray( 'project_languages' ); |
744 | 750 | } else { |
745 | 751 | $timestamp = $row->not_start; |
| 752 | + $projectSelected = $row->not_project; |
| 753 | + $noticeLanguages = $this->getNoticeLanguages( $notice ); |
746 | 754 | } |
747 | | - |
748 | | - // Get all languages associated with the campaign |
749 | | - $noticeLanguages = $this->getNoticeLanguages( $notice ); |
750 | 755 | |
751 | 756 | // Build Html |
752 | 757 | $htmlOut = ''; |
— | — | @@ -766,12 +771,12 @@ |
767 | 772 | // End Date |
768 | 773 | $htmlOut .= Xml::openElement( 'tr' ); |
769 | 774 | $htmlOut .= Xml::tags( 'td', array(), wfMsgHtml( 'centralnotice-end-date' ) ); |
770 | | - $htmlOut .= Xml::tags( 'td', array(), $this->dateSelector( 'end', $row->not_end, "[$row->not_name]" ) ); |
| 775 | + $htmlOut .= Xml::tags( 'td', array(), $this->dateSelector( 'end', $row->not_end ) ); |
771 | 776 | $htmlOut .= Xml::closeElement( 'tr' ); |
772 | 777 | // Project |
773 | 778 | $htmlOut .= Xml::openElement( 'tr' ); |
774 | 779 | $htmlOut .= Xml::tags( 'td', array(), wfMsgHtml( 'centralnotice-project-name' ) ); |
775 | | - $htmlOut .= Xml::tags( 'td', array(), $this->projectDropDownList( $row->not_project ) ); |
| 780 | + $htmlOut .= Xml::tags( 'td', array(), $this->projectDropDownList( $projectSelected ) ); |
776 | 781 | $htmlOut .= Xml::closeElement( 'tr' ); |
777 | 782 | // Languages |
778 | 783 | $htmlOut .= Xml::openElement( 'tr' ); |