r20746 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r20745‎ | r20746 | r20747 >
Date:19:07, 27 March 2007
Author:robchurch
Status:old
Tags:
Comment:
Beef up the Special:Log search form so it's laid out a bit clearer; clarified English text for the prefix/wildcard thing
Modified paths:
  • /trunk/phase3/includes/SpecialLog.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -1002,9 +1002,11 @@
10031003 'specialloguserlabel',
10041004 'speciallogtitlelabel',
10051005 'log',
 1006+ 'log-search-legend',
 1007+ 'log-search-submit',
10061008 'alllogstext',
10071009 'logempty',
1008 - 'title-pattern',
 1010+ 'log-title-wildcard',
10091011 ),
10101012 'allpages' => array(
10111013 'nextpage',
Index: trunk/phase3/includes/SpecialLog.php
@@ -401,19 +401,28 @@
402402 */
403403 function showOptions( &$out ) {
404404 global $wgScript, $wgMiserMode;
405 - $action = htmlspecialchars( $wgScript );
406405 $title = SpecialPage::getTitleFor( 'Log' );
407 - $special = htmlspecialchars( $title->getPrefixedDBkey() );
408 - $out->addHTML( "<form action=\"$action\" method=\"get\">\n" .
409 - '<fieldset>' .
410 - Xml::element( 'legend', array(), wfMsg( 'log' ) ) .
411 - Xml::hidden( 'title', $special ) . "\n" .
412 - $this->getTypeMenu() . "\n" .
413 - $this->getUserInput() . "\n" .
414 - $this->getTitleInput() . "\n" .
415 - (!$wgMiserMode?($this->getTitlePattern()."\n"):"") .
416 - Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" .
417 - "</fieldset></form>" );
 406+ $form = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) );
 407+ $form .= Xml::hidden( 'title', $title->getPrefixedDBkey() );
 408+ $form .= '<fieldset><legend>' . wfMsgHtml( 'log-search-legend' ) . '</legend>';
 409+ $form .= '<table>';
 410+ # Log selection
 411+ $form .= '<tr><td>&nbsp;</td><td>' . $this->getTypeMenu() . '</td></tr>';
 412+ $form .= '<tr><td>' . Xml::label( wfMsg( 'specialloguserlabel' ), 'user' ) . '</td>';
 413+ # User filter
 414+ $form .= '<td>' . Xml::input( 'user', 30, $this->reader->queryUser(), array( 'id' => 'user' ) ) . '</td></tr>';
 415+ # Title filter
 416+ $form .= '<tr><td>' . Xml::label( wfMsg( 'speciallogtitlelabel' ), 'page' ) . '</td>';
 417+ $form .= '<td>' . Xml::input( 'page', 30, $this->reader->queryTitle(), array( 'id' => 'page' ) ) . '</td></tr>';
 418+ # Title "wildcard" checkbox (if enabled)
 419+ if( !$wgMiserMode ) {
 420+ $form .= '<tr><td>&nbsp;</td><td>' . Xml::checkLabel( wfMsg( 'log-title-wildcard' ), 'pattern', 'pattern', $this->reader->queryPattern() ) . '</td></tr>';
 421+ }
 422+ $form .= '<tr><td>&nbsp;</td><td>' . Xml::submitButton( wfMsg( 'log-search-submit' ) ) . '</td></tr>';
 423+ $form .= '</table>';
 424+ $form .= '</fieldset>';
 425+ $form .= '</form>';
 426+ $out->addHtml( $form );
418427 }
419428
420429 /**
@@ -446,33 +455,6 @@
447456 }
448457
449458 /**
450 - * @return string Formatted HTML
451 - * @private
452 - */
453 - function getUserInput() {
454 - $user = $this->reader->queryUser();
455 - return Xml::inputLabel( wfMsg( 'specialloguserlabel' ), 'user', 'user', 12, $user );
456 - }
457 -
458 - /**
459 - * @return string Formatted HTML
460 - * @private
461 - */
462 - function getTitleInput() {
463 - $title = $this->reader->queryTitle();
464 - return Xml::inputLabel( wfMsg( 'speciallogtitlelabel' ), 'page', 'page', 20, $title );
465 - }
466 -
467 - /**
468 - * @return boolean Checkbox
469 - * @private
470 - */
471 - function getTitlePattern() {
472 - $pattern = $this->reader->queryPattern();
473 - return Xml::checkLabel( wfMsg( 'title-pattern' ), 'pattern', 'pattern', $pattern );
474 - }
475 -
476 - /**
477459 * @param OutputPage &$out where to send output
478460 * @private
479461 */
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1607,10 +1607,12 @@
16081608 'specialloguserlabel' => 'User:',
16091609 'speciallogtitlelabel' => 'Title:',
16101610 'log' => 'Logs',
 1611+'log-search-legend' => 'Search for logs',
 1612+'log-search-submit' => 'Go',
16111613 'alllogstext' => 'Combined display of all available logs of {{SITENAME}}.
16121614 You can narrow down the view by selecting a log type, the user name, or the affected page.',
16131615 'logempty' => 'No matching items in log.',
1614 -'title-pattern' => 'Title starts with …',
 1616+'log-title-wildcard' => 'Search titles starting with this text',
16151617
16161618 # Special:Allpages
16171619 'nextpage' => 'Next page ($1)',

Follow-up revisions

RevisionCommit summaryAuthorDate
r40241Removed 'log-search-legend' and 'log-search-submit'. Introduced in r20746 and...siebrand19:19, 29 August 2008