From 1f1fc5e1bc9ca2d03e946c53b595079c1c7afb05 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 12 Feb 2009 19:23:14 +0000 Subject: [PATCH] Follow-up to r47192: do the same for PageHistory --- includes/LogEventsList.php | 13 ++----------- includes/PageHistory.php | 33 +-------------------------------- 2 files changed, 3 insertions(+), 43 deletions(-) diff --git a/includes/LogEventsList.php b/includes/LogEventsList.php index 252de82597..639ee9e6c1 100644 --- a/includes/LogEventsList.php +++ b/includes/LogEventsList.php @@ -85,7 +85,7 @@ class LogEventsList { $this->getUserInput( $user ) . "\n" . $this->getTitleInput( $page ) . "\n" . ( !$wgMiserMode ? ($this->getTitlePattern( $pattern )."\n") : "" ) . - "

" . $this->getDateMenu( $year, $month ) . "\n" . + "

" . Xml::dateMenu( $year, $month ) . "\n" . ( $tagSelector ? Xml::tags( 'p', null, implode( ' ', $tagSelector ) ) :'' ). "\n" . ( $filter ? "

".$this->getFilterLinks( $type, $filter )."\n" : "" ) . "\n" . Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "

\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 ); diff --git a/includes/PageHistory.php b/includes/PageHistory.php index e21e499b80..cbef1f4ca9 100644 --- a/includes/PageHistory.php +++ b/includes/PageHistory.php @@ -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 ) . ' ' . + xml::dateMenu( $year, $month ) . ' ' . ( $tagSelector ? ( implode( ' ', $tagSelector ) . ' ' ) : '' ) . Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" . '' @@ -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 * -- 2.20.1