r47193 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47192‎ | r47193 | r47194 >
Date:19:23, 12 February 2009
Author:aaron
Status:deferred
Tags:
Comment:
Follow-up to r47192: do the same for PageHistory
Modified paths:
  • /trunk/phase3/includes/LogEventsList.php (modified) (history)
  • /trunk/phase3/includes/PageHistory.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/LogEventsList.php
@@ -85,7 +85,7 @@
8686 $this->getUserInput( $user ) . "\n" .
8787 $this->getTitleInput( $page ) . "\n" .
8888 ( !$wgMiserMode ? ($this->getTitlePattern( $pattern )."\n") : "" ) .
89 - "<p>" . $this->getDateMenu( $year, $month ) . "\n" .
 89+ "<p>" . Xml::dateMenu( $year, $month ) . "\n" .
9090 ( $tagSelector ? Xml::tags( 'p', null, implode( '&nbsp;', $tagSelector ) ) :'' ). "\n" .
9191 ( $filter ? "</p><p>".$this->getFilterLinks( $type, $filter )."\n" : "" ) . "\n" .
9292 Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "</p>\n" .
@@ -181,15 +181,6 @@
182182 }
183183
184184 /**
185 - * @param $year Integer
186 - * @param $month Integer
187 - * @return string Formatted HTML
188 - */
189 - private function getDateMenu( $year, $month ) {
190 - return Xml::dateMenu( $year, $month );
191 - }
192 -
193 - /**
194185 * @return boolean Checkbox
195186 */
196187 private function getTitlePattern( $pattern ) {
@@ -504,7 +495,7 @@
505496
506497 $this->mLogEventsList = $list;
507498
508 - $this->limitType( $type ); // excludes hidden types too
 499+ $this->limitType( $type ); // also excludes hidden types
509500 $this->limitUser( $user );
510501 $this->limitTitle( $title, $pattern );
511502 $this->getDateCond( $year, $month );
Index: trunk/phase3/includes/PageHistory.php
@@ -123,7 +123,7 @@
124124 Xml::fieldset( wfMsg( 'history-fieldset-title' ), false, array( 'id' => 'mw-history-search' ) ) .
125125 Xml::hidden( 'title', $this->mTitle->getPrefixedDBKey() ) . "\n" .
126126 Xml::hidden( 'action', 'history' ) . "\n" .
127 - $this->getDateMenu( $year, $month ) . '&nbsp;' .
 127+ xml::dateMenu( $year, $month ) . '&nbsp;' .
128128 ( $tagSelector ? ( implode( '&nbsp;', $tagSelector ) . '&nbsp;' ) : '' ) .
129129 Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" .
130130 '</fieldset></form>'
@@ -148,37 +148,6 @@
149149 }
150150
151151 /**
152 - * @return string Formatted HTML
153 - * @param int $year
154 - * @param int $month
155 - */
156 - private function getDateMenu( $year, $month ) {
157 - # Offset overrides year/month selection
158 - if( $month && $month !== -1 ) {
159 - $encMonth = intval( $month );
160 - } else {
161 - $encMonth = '';
162 - }
163 - if( $year ) {
164 - $encYear = intval( $year );
165 - } else if( $encMonth ) {
166 - $thisMonth = intval( gmdate( 'n' ) );
167 - $thisYear = intval( gmdate( 'Y' ) );
168 - if( intval($encMonth) > $thisMonth ) {
169 - $thisYear--;
170 - }
171 - $encYear = $thisYear;
172 - } else {
173 - $encYear = '';
174 - }
175 - return Xml::label( wfMsg( 'year' ), 'year' ) . ' '.
176 - Xml::input( 'year', 4, $encYear, array('id' => 'year', 'maxlength' => 4) ) .
177 - ' '.
178 - Xml::label( wfMsg( 'month' ), 'month' ) . ' '.
179 - Xml::monthSelector( $encMonth, -1 );
180 - }
181 -
182 - /**
183152 * Creates begin of history list with a submit button
184153 *
185154 * @return string HTML output

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r47192* consolidated getDateMenu duplication into xml.php...aaron19:02, 12 February 2009

Status & tagging log