X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FLogEventsList.php;h=29a54c6f314d927628b72d89acbfeb66a1c6ec6f;hb=c4a604a984f26bb2b044bf7d152bd7b9c535f97c;hp=eb43cbc669c6ec2dfb2644741a2834fe21a2a36e;hpb=2f82bccb39c5e48de0207323b3e6e0456617ae45;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/LogEventsList.php b/includes/LogEventsList.php index eb43cbc669..29a54c6f31 100644 --- a/includes/LogEventsList.php +++ b/includes/LogEventsList.php @@ -49,12 +49,16 @@ class LogEventsList { /** * Set page title and show header for this log type - * @param $type String + * @param $type Array */ public function showHeader( $type ) { - if( LogPage::isLogType( $type ) ) { - $this->out->setPageTitle( LogPage::logName( $type ) ); - $this->out->addHTML( LogPage::logHeader( $type ) ); + // If only one log type is used, then show a special message... + $headerType = (count($type) == 1) ? $type[0] : ''; + if( LogPage::isLogType( $headerType ) ) { + $this->out->setPageTitle( LogPage::logName( $headerType ) ); + $this->out->addHTML( LogPage::logHeader( $headerType ) ); + } else { + $this->out->addHTML( wfMsgExt('alllogstext',array('parseinline')) ); } } @@ -73,27 +77,53 @@ class LogEventsList { $month = '', $filter = null, $tagFilter='' ) { global $wgScript, $wgMiserMode; - $action = htmlspecialchars( $wgScript ); + + $action = $wgScript; $title = SpecialPage::getTitleFor( 'Log' ); - $special = htmlspecialchars( $title->getPrefixedDBkey() ); + $special = $title->getPrefixedDBkey(); + // For B/C, we take strings, but make sure they are converted... $types = ($types === '') ? array() : (array)$types; $tagSelector = ChangeTags::buildTagFilterSelector( $tagFilter ); - - $this->out->addHTML( "
" . - Xml::element( 'legend', array(), wfMsg( 'log' ) ) . - Xml::hidden( 'title', $special ) . "\n" . - $this->getTypeMenu( $types ) . "\n" . - $this->getUserInput( $user ) . "\n" . - $this->getTitleInput( $page ) . "\n" . - ( !$wgMiserMode ? ($this->getTitlePattern( $pattern )."\n") : "" ) . - "

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

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

\n" . - "
" - ); + + $html = ''; + $html .= Xml::hidden( 'title', $special ); + + // Basic selectors + $html .= $this->getTypeMenu( $types ) . "\n"; + $html .= $this->getUserInput( $user ) . "\n"; + $html .= $this->getTitleInput( $page ) . "\n"; + $html .= $this->getExtraInputs( $types ) . "\n"; + + // Title pattern, if allowed + if (!$wgMiserMode) { + $html .= $this->getTitlePattern( $pattern ) . "\n"; + } + + // date menu + $html .= Xml::tags( 'p', null, Xml::dateMenu( $year, $month ) ); + + // Tag filter + if ($tagSelector) { + $html .= Xml::tags( 'p', null, implode( ' ', $tagSelector ) ); + } + + // Filter links + if ($filter) { + $html .= Xml::tags( 'p', null, $this->getFilterLinks( $filter ) ); + } + + // Submit button + $html .= Xml::submitButton( wfMsg( 'allpagessubmit' ) ); + + // Fieldset + $html = Xml::fieldset( wfMsg( 'log' ), $html ); + + // Form wrapping + $html = Xml::tags( 'form', array( 'action' => $action, 'method' => 'get' ), $html ); + + $this->out->addHTML( $html ); } /** @@ -209,6 +239,15 @@ class LogEventsList { Xml::checkLabel( wfMsg( 'log-title-wildcard' ), 'pattern', 'pattern', $pattern ) . ''; } + + private function getExtraInputs( $types ) { + global $wgRequest; + if( count($types) == 1 && $types[0] == 'suppress' ) { + return Xml::inputLabel( wfMsg('revdelete-offender'), 'offender', + 'mw-log-offender', 20, $wgRequest->getVal('offender') ); + } + return ''; + } public function beginLogEventsList() { return "