diff options
author | Prateek Saxena <prtksxna@gmail.com> | 2018-04-25 10:52:19 +0530 |
---|---|---|
committer | Prateek Saxena <prtksxna@gmail.com> | 2018-07-10 16:55:33 +0530 |
commit | 38756eae46a87c7315b375b6ca6e484c9aacb1e9 (patch) | |
tree | 4026a7a7ce13e7a472ad6ce5513279c687fca464 /includes/specials/SpecialLog.php | |
parent | 1d17626dc27a5d3a2d37cc650684b17635b02f29 (diff) | |
download | mediawikicore-38756eae46a87c7315b375b6ca6e484c9aacb1e9.tar.gz mediawikicore-38756eae46a87c7315b375b6ca6e484c9aacb1e9.zip |
Special:Log: Convert to HTMLForm
* All Xml generation code has been removed.
* The LogEventsListGetExtraInputs hook now needs a form
descriptor array and not plain HTML.
See I37e0d3e81a46239750465b9299279fbbd7c7f87a.
* LogPager and LogEventList also take the $day parameter
for 'From date (and earlier)' and pass it to getDateCond
as well.
* Since FormOptions can't automatically extract the date
from the request this is being done manually in the
execute method of Special:Log using MWTimestamp.
Bug: T117737
Change-Id: Iba3c6aa5ac40dcdee0792c2d045b238b02d76521
Diffstat (limited to 'includes/specials/SpecialLog.php')
-rw-r--r-- | includes/specials/SpecialLog.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/includes/specials/SpecialLog.php b/includes/specials/SpecialLog.php index bad17466b54d..359eedea78b6 100644 --- a/includes/specials/SpecialLog.php +++ b/includes/specials/SpecialLog.php @@ -46,6 +46,7 @@ class SpecialLog extends SpecialPage { $opts->add( 'pattern', false ); $opts->add( 'year', null, FormOptions::INTNULL ); $opts->add( 'month', null, FormOptions::INTNULL ); + $opts->add( 'day', null, FormOptions::INTNULL ); $opts->add( 'tagfilter', '' ); $opts->add( 'offset', '' ); $opts->add( 'dir', '' ); @@ -59,6 +60,17 @@ class SpecialLog extends SpecialPage { $this->parseParams( $opts, (string)$par ); } + // Set date values + $dateString = $this->getRequest()->getVal( 'wpdate' ); + if ( !empty( $dateString ) ) { + $dateStamp = MWTimestamp::getInstance( $dateString . ' 00:00:00' ); + $dateStamp->setTimezone( $this->getConfig()->get( 'Localtimezone' ) ); + + $opts->setValue( 'year', (int)$dateStamp->format( 'Y' ) ); + $opts->setValue( 'month', (int)$dateStamp->format( 'm' ) ); + $opts->setValue( 'day', (int)$dateStamp->format( 'd' ) ); + } + # Don't let the user get stuck with a certain date if ( $opts->getValue( 'offset' ) || $opts->getValue( 'dir' ) == 'prev' ) { $opts->setValue( 'year', '' ); @@ -214,6 +226,7 @@ class SpecialLog extends SpecialPage { $extraConds, $opts->getValue( 'year' ), $opts->getValue( 'month' ), + $opts->getValue( 'day' ), $opts->getValue( 'tagfilter' ), $opts->getValue( 'subtype' ), $opts->getValue( 'logid' ) @@ -235,6 +248,7 @@ class SpecialLog extends SpecialPage { $pager->getPattern(), $pager->getYear(), $pager->getMonth(), + $pager->getDay(), $pager->getFilterParams(), $pager->getTagFilter(), $pager->getAction() |