Follow-up to r47192: do the same for PageHistory
authorAaron Schulz <aaron@users.mediawiki.org>
Thu, 12 Feb 2009 19:23:14 +0000 (19:23 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Thu, 12 Feb 2009 19:23:14 +0000 (19:23 +0000)
includes/LogEventsList.php
includes/PageHistory.php

index 252de82..639ee9e 100644 (file)
@@ -85,7 +85,7 @@ class LogEventsList {
                        $this->getUserInput( $user ) . "\n" .
                        $this->getTitleInput( $page ) . "\n" .
                        ( !$wgMiserMode ? ($this->getTitlePattern( $pattern )."\n") : "" ) .
-                       "<p>" . $this->getDateMenu( $year, $month ) . "\n" .
+                       "<p>" . Xml::dateMenu( $year, $month ) . "\n" .
                        ( $tagSelector ? Xml::tags( 'p', null, implode( '&nbsp;', $tagSelector ) ) :'' ). "\n" .
                        ( $filter ? "</p><p>".$this->getFilterLinks( $type, $filter )."\n" : "" ) . "\n" .
                        Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "</p>\n" .
@@ -180,15 +180,6 @@ class LogEventsList {
                return Xml::inputLabel( wfMsg( 'speciallogtitlelabel' ), 'page', 'page', 20, $title );
        }
 
-       /**
-        * @param $year Integer
-        * @param $month Integer
-        * @return string Formatted HTML
-        */
-       private function getDateMenu( $year, $month ) {
-               return Xml::dateMenu( $year, $month );
-       }
-
        /**
         * @return boolean Checkbox
         */
@@ -504,7 +495,7 @@ class LogPager extends ReverseChronologicalPager {
 
                $this->mLogEventsList = $list;
 
-               $this->limitType( $type ); // excludes hidden types too
+               $this->limitType( $type ); // also excludes hidden types
                $this->limitUser( $user );
                $this->limitTitle( $title, $pattern );
                $this->getDateCond( $year, $month );
index e21e499..cbef1f4 100644 (file)
@@ -123,7 +123,7 @@ class PageHistory {
                        Xml::fieldset( wfMsg( 'history-fieldset-title' ), false, array( 'id' => 'mw-history-search' ) ) .
                        Xml::hidden( 'title', $this->mTitle->getPrefixedDBKey() ) . "\n" .
                        Xml::hidden( 'action', 'history' ) . "\n" .
-                       $this->getDateMenu( $year, $month ) . '&nbsp;' .
+                       xml::dateMenu( $year, $month ) . '&nbsp;' .
                        ( $tagSelector ? ( implode( '&nbsp;', $tagSelector ) . '&nbsp;' ) : '' ) .
                        Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" .
                        '</fieldset></form>'
@@ -147,37 +147,6 @@ class PageHistory {
                wfProfileOut( __METHOD__ );
        }
 
-       /**
-        * @return string Formatted HTML
-        * @param int $year
-        * @param int $month
-        */
-       private function getDateMenu( $year, $month ) {
-               # Offset overrides year/month selection
-               if( $month && $month !== -1 ) {
-                       $encMonth = intval( $month );
-               } else {
-                       $encMonth = '';
-               }
-               if( $year ) {
-                       $encYear = intval( $year );
-               } else if( $encMonth ) {
-                       $thisMonth = intval( gmdate( 'n' ) );
-                       $thisYear = intval( gmdate( 'Y' ) );
-                       if( intval($encMonth) > $thisMonth ) {
-                               $thisYear--;
-                       }
-                       $encYear = $thisYear;
-               } else {
-                       $encYear = '';
-               }
-               return Xml::label( wfMsg( 'year' ), 'year' ) . ' '.
-                       Xml::input( 'year', 4, $encYear, array('id' => 'year', 'maxlength' => 4) ) .
-                               ' '.
-                       Xml::label( wfMsg( 'month' ), 'month' ) . ' '.
-                       Xml::monthSelector( $encMonth, -1 );
-       }
-
        /**
         * Creates begin of history list with a submit button
         *