From dc320df93ada0d313e453c806f8bd4251fc3b592 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 19 Apr 2007 14:38:45 +0000 Subject: [PATCH] Revert Special:Log to r20745 with non-ugly form --- includes/SpecialLog.php | 70 ++++++++++++++++++++++++++--------------- 1 file changed, 44 insertions(+), 26 deletions(-) diff --git a/includes/SpecialLog.php b/includes/SpecialLog.php index 21afdd41de..9c556962cc 100644 --- a/includes/SpecialLog.php +++ b/includes/SpecialLog.php @@ -36,7 +36,7 @@ function wfSpecialLog( $par = '' ) { } /** - * @todo document (needs one-sentence top-level class description) + * * @addtogroup SpecialPage */ class LogReader { @@ -128,7 +128,7 @@ class LogReader { } $this->title =& $title; $this->pattern = $pattern; - $ns = intval( $title->getNamespace() ); + $ns = $title->getNamespace(); if ( $pattern && !$wgMiserMode ) { $safetitle = $this->db->escapeLike( $title->getDBkey() ); // use escapeLike to avoid expensive search patterns like 't%st%' $this->whereClauses[] = "log_namespace=$ns AND log_title LIKE '$safetitle%'"; @@ -218,7 +218,7 @@ class LogReader { } /** - * @todo document (needs one-sentence top-level class description) + * * @addtogroup SpecialPage */ class LogViewer { @@ -347,12 +347,12 @@ class LogViewer { if ( $s->log_type == 'move' && isset( $paramArray[0] ) ) { $destTitle = Title::newFromText( $paramArray[0] ); if ( $destTitle ) { - $revert = '(' . $this->skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Movepage' ), + $reviewlink = $this->skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Movepage' ), wfMsg( 'revertmove' ), 'wpOldTitle=' . urlencode( $destTitle->getPrefixedDBkey() ) . '&wpNewTitle=' . urlencode( $title->getPrefixedDBkey() ) . '&wpReason=' . urlencode( wfMsgForContent( 'revertmove' ) ) . - '&wpMovetalk=0' ) . ')'; + '&wpMovetalk=0' ); } // show undelete link } elseif ( $s->log_action == 'delete' && $wgUser->isAllowed( 'delete' ) ) { @@ -401,28 +401,19 @@ class LogViewer { */ function showOptions( &$out ) { global $wgScript, $wgMiserMode; + $action = htmlspecialchars( $wgScript ); $title = SpecialPage::getTitleFor( 'Log' ); - $form = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ); - $form .= Xml::hidden( 'title', $title->getPrefixedDBkey() ); - $form .= '
' . wfMsgHtml( 'log-search-legend' ) . ''; - $form .= ''; - # Log selection - $form .= ''; - $form .= ''; - # User filter - $form .= ''; - # Title filter - $form .= ''; - $form .= ''; - # Title "wildcard" checkbox (if enabled) - if( !$wgMiserMode ) { - $form .= ''; - } - $form .= ''; - $form .= '
 ' . $this->getTypeMenu() . '
' . Xml::label( wfMsg( 'specialloguserlabel' ), 'user' ) . '' . Xml::input( 'user', 30, $this->reader->queryUser(), array( 'id' => 'user' ) ) . '
' . Xml::label( wfMsg( 'speciallogtitlelabel' ), 'page' ) . '' . Xml::input( 'page', 30, $this->reader->queryTitle(), array( 'id' => 'page' ) ) . '
 ' . Xml::checkLabel( wfMsg( 'log-title-wildcard' ), 'pattern', 'pattern', $this->reader->queryPattern() ) . '
 ' . Xml::submitButton( wfMsg( 'log-search-submit' ) ) . '
'; - $form .= '
'; - $form .= ''; - $out->addHtml( $form ); + $special = htmlspecialchars( $title->getPrefixedDBkey() ); + $out->addHTML( "
\n" . + '
' . + Xml::element( 'legend', array(), wfMsg( 'log' ) ) . + Xml::hidden( 'title', $special ) . "\n" . + $this->getTypeMenu() . "\n" . + $this->getUserInput() . "\n" . + $this->getTitleInput() . "\n" . + (!$wgMiserMode?($this->getTitlePattern()."\n"):"") . + Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" . + "
" ); } /** @@ -454,6 +445,33 @@ class LogViewer { return $out; } + /** + * @return string Formatted HTML + * @private + */ + function getUserInput() { + $user = $this->reader->queryUser(); + return Xml::inputLabel( wfMsg( 'specialloguserlabel' ), 'user', 'user', 12, $user ); + } + + /** + * @return string Formatted HTML + * @private + */ + function getTitleInput() { + $title = $this->reader->queryTitle(); + return Xml::inputLabel( wfMsg( 'speciallogtitlelabel' ), 'page', 'page', 20, $title ); + } + + /** + * @return boolean Checkbox + * @private + */ + function getTitlePattern() { + $pattern = $this->reader->queryPattern(); + return Xml::checkLabel( wfMsg( 'title-pattern' ), 'pattern', 'pattern', $pattern ); + } + /** * @param OutputPage &$out where to send output * @private -- 2.20.1