X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialLog.php;h=533a33179a7580cbcae14950f2cfa7d47955c38a;hb=5111bd2def4e63ecc8a2acbf468e5c39029f9efd;hp=7132207e245eab598f65c2b1c13aa6ee193235da;hpb=54277fb7d5609c26b83d4fc7543b2c826fcae0bf;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialLog.php b/includes/specials/SpecialLog.php index 7132207e24..533a33179a 100644 --- a/includes/specials/SpecialLog.php +++ b/includes/specials/SpecialLog.php @@ -37,6 +37,7 @@ class SpecialLog extends SpecialPage { $this->setHeaders(); $this->outputHeader(); $this->getOutput()->addModules( 'mediawiki.userSuggest' ); + $this->addHelpLink( 'Help:Log' ); $opts = new FormOptions; $opts->add( 'type', '' ); @@ -147,7 +148,8 @@ class SpecialLog extends SpecialPage { private function parseParams( FormOptions $opts, $par ) { # Get parameters - $parms = explode( '/', ( $par = ( $par !== null ) ? $par : '' ) ); + $par = $par !== null ? $par : ''; + $parms = explode( '/', $par ); $symsForAll = [ '*', 'all' ]; if ( $parms[0] != '' && ( in_array( $par, $this->getConfig()->get( 'LogTypes' ) ) || in_array( $par, $symsForAll ) ) @@ -169,25 +171,6 @@ class SpecialLog extends SpecialPage { LogEventsList::USE_CHECKBOXES ); - $action = ''; - // Allow to filter the log by actions - $type = $opts->getValue( 'type' ); - if ( $type !== '' ) { - $actions = $this->getConfig()->get( 'ActionFilteredLogs' ); - if ( isset( $actions[$type] ) ) { - // log type can be filtered by actions - $loglist->setAllowedActions( array_keys( $actions[$type] ) ); - $action = $opts->getValue( 'subtype' ); - if ( $action !== '' && isset( $actions[$type][$action] ) ) { - // add condition to query - $extraConds['log_action'] = $actions[$type][$action]; - } else { - // no action or invalid action - $action = ''; - } - } - } - $pager = new LogPager( $loglist, $opts->getValue( 'type' ), @@ -197,27 +180,29 @@ class SpecialLog extends SpecialPage { $extraConds, $opts->getValue( 'year' ), $opts->getValue( 'month' ), - $opts->getValue( 'tagfilter' ) + $opts->getValue( 'tagfilter' ), + $opts->getValue( 'subtype' ) ); $this->addHeader( $opts->getValue( 'type' ) ); # Set relevant user if ( $pager->getPerformer() ) { - $this->getSkin()->setRelevantUser( User::newFromName( $pager->getPerformer() ) ); + $performerUser = User::newFromName( $pager->getPerformer(), false ); + $this->getSkin()->setRelevantUser( $performerUser ); } # Show form options $loglist->showOptions( $pager->getType(), - $opts->getValue( 'user' ), + $pager->getPerformer(), $pager->getPage(), $pager->getPattern(), $pager->getYear(), $pager->getMonth(), $pager->getFilterParams(), - $opts->getValue( 'tagfilter' ), - $action + $pager->getTagFilter(), + $pager->getAction() ); # Insert list