Index: trunk/extensions/CentralNotice/special/SpecialCentralNoticeLogs.php |
— | — | @@ -78,18 +78,12 @@ |
79 | 79 | $reset = $wgRequest->getVal( 'centralnoticelogreset' ); |
80 | 80 | $campaign = $wgRequest->getVal( 'campaign' ); |
81 | 81 | $user = $wgRequest->getVal( 'user' ); |
82 | | - $startYear = $wgRequest->getVal( 'start_year' ); |
83 | | - if ( $startYear === 'other' ) $startYear = null; |
84 | | - $startMonth = $wgRequest->getVal( 'start_month' ); |
85 | | - if ( $startMonth === 'other' ) $startMonth = null; |
86 | | - $startDay = $wgRequest->getVal( 'start_day' ); |
87 | | - if ( $startDay === 'other' ) $startDay = null; |
88 | | - $endYear = $wgRequest->getVal( 'end_year' ); |
89 | | - if ( $endYear === 'other' ) $endYear = null; |
90 | | - $endMonth = $wgRequest->getVal( 'end_month' ); |
91 | | - if ( $endMonth === 'other' ) $endMonth = null; |
92 | | - $endDay = $wgRequest->getVal( 'end_day' ); |
93 | | - if ( $endDay === 'other' ) $endDay = null; |
| 82 | + $startYear = $this->getDateValue( 'start_year' ); |
| 83 | + $startMonth = $this->getDateValue( 'start_month' ); |
| 84 | + $startDay = $this->getDateValue( 'start_day' ); |
| 85 | + $endYear = $this->getDateValue( 'end_year' ); |
| 86 | + $endMonth = $this->getDateValue( 'end_month' ); |
| 87 | + $endDay = $this->getDateValue( 'end_day' ); |
94 | 88 | |
95 | 89 | $htmlOut .= Xml::openElement( 'div', array( 'id' => 'cn-log-filters-container' ) ); |
96 | 90 | |
— | — | @@ -252,5 +246,11 @@ |
253 | 247 | |
254 | 248 | $wgOut->addHTML( $htmlOut ); |
255 | 249 | } |
| 250 | + |
| 251 | + private function getDateValue( $type ) { |
| 252 | + $value = $wgRequest->getVal( $type ); |
| 253 | + if ( $value === 'other' ) $value = null; |
| 254 | + return $value; |
| 255 | + } |
256 | 256 | |
257 | 257 | } |