r95297 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95296‎ | r95297 | r95298 >
Date:01:42, 23 August 2011
Author:kaldari
Status:ok
Tags:
Comment:
follow-up to r94856, functionalizing date retrieval
Modified paths:
  • /trunk/extensions/CentralNotice/special/SpecialCentralNoticeLogs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/special/SpecialCentralNoticeLogs.php
@@ -78,18 +78,12 @@
7979 $reset = $wgRequest->getVal( 'centralnoticelogreset' );
8080 $campaign = $wgRequest->getVal( 'campaign' );
8181 $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' );
9488
9589 $htmlOut .= Xml::openElement( 'div', array( 'id' => 'cn-log-filters-container' ) );
9690
@@ -252,5 +246,11 @@
253247
254248 $wgOut->addHTML( $htmlOut );
255249 }
 250+
 251+ private function getDateValue( $type ) {
 252+ $value = $wgRequest->getVal( $type );
 253+ if ( $value === 'other' ) $value = null;
 254+ return $value;
 255+ }
256256
257257 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r95348follow-up to r95297, adding missing global varkaldari23:01, 23 August 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r94856date range for campaign log filterkaldari01:46, 18 August 2011

Status & tagging log