http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88595

Revision: 88595
Author:   reedy
Date:     2011-05-22 19:21:22 +0000 (Sun, 22 May 2011)
Log Message:
-----------
* (bug 28272) Special:Allmessages should have only one "Go" button

Patch by MZMcBride

Modified Paths:
--------------
    trunk/phase3/RELEASE-NOTES-1.19
    trunk/phase3/includes/specials/SpecialAllmessages.php

Modified: trunk/phase3/RELEASE-NOTES-1.19
===================================================================
--- trunk/phase3/RELEASE-NOTES-1.19     2011-05-22 18:38:04 UTC (rev 88594)
+++ trunk/phase3/RELEASE-NOTES-1.19     2011-05-22 19:21:22 UTC (rev 88595)
@@ -38,7 +38,6 @@
   added to the textarea on the edit form.
 * mw.util.getScript has been implemented (like wfScript in GlobalFunctions.php)
 
-
 === Bug fixes in 1.19 ===
 * (bug 10154) Don't allow user to specify days beyond $wgRCMaxAge.
 * (bug 28868) Show total pages in the subtitle of an image on the
@@ -75,9 +74,9 @@
 * (bug 29055) Make don't send email on minor edits preference apply to
   changes to talk page in addition to watchlist edits.
 * (bug 29071) mediawiki.action.watch.ajax.js should pass uselang to API.
+* (bug 28272) Special:Allmessages should have only one "Go" button
 
 === API changes in 1.19 ===
-
 * BREAKING CHANGE: action=watch now requires POST and token.
 * (bug 27790) add query type for querymodules to action=paraminfo
 * (bug 28963) add langbacklinks module to api

Modified: trunk/phase3/includes/specials/SpecialAllmessages.php
===================================================================
--- trunk/phase3/includes/specials/SpecialAllmessages.php       2011-05-22 
18:38:04 UTC (rev 88594)
+++ trunk/phase3/includes/specials/SpecialAllmessages.php       2011-05-22 
19:21:22 UTC (rev 88595)
@@ -34,8 +34,6 @@
         */
        protected $table;
 
-       protected $filter, $prefix, $langCode;
-
        /**
         * Constructor
         */
@@ -75,91 +73,25 @@
 
                $this->langCode = $this->table->lang->getCode();
 
-               $out->addHTML( $this->buildForm() .
+               $out->addHTML( $this->table->buildForm() .
                        $this->table->getNavigationBar() .
-                       $this->table->getLimitForm() .
                        $this->table->getBody() .
                        $this->table->getNavigationBar() );
 
        }
 
-       function buildForm() {
-               global $wgScript;
+}
 
-               $languages = Language::getLanguageNames( false );
-               ksort( $languages );
 
-               $out  = Xml::openElement( 'form', array( 'method' => 'get', 
'action' => $wgScript, 'id' => 'mw-allmessages-form' ) ) .
-                       Xml::fieldset( wfMsg( 'allmessages-filter-legend' ) ) .
-                       Html::hidden( 'title', 
$this->getTitle()->getPrefixedText() ) .
-                       Xml::openElement( 'table', array( 'class' => 
'mw-allmessages-table' ) ) . "\n" .
-                       '<tr>
-                               <td class="mw-label">' .
-                                       Xml::label( wfMsg( 'allmessages-prefix' 
), 'mw-allmessages-form-prefix' ) .
-                               "</td>\n
-                               <td class=\"mw-input\">" .
-                                       Xml::input( 'prefix', 20, str_replace( 
'_', ' ', $this->prefix ), array( 'id' => 'mw-allmessages-form-prefix' ) ) .
-                               "</td>\n
-                       </tr>
-                       <tr>\n
-                               <td class='mw-label'>" .
-                                       wfMsg( 'allmessages-filter' ) .
-                               "</td>\n
-                               <td class='mw-input'>" .
-                                       Xml::radioLabel( wfMsg( 
'allmessages-filter-unmodified' ),
-                                               'filter',
-                                               'unmodified',
-                                               
'mw-allmessages-form-filter-unmodified',
-                                               ( $this->filter == 'unmodified' 
)
-                                       ) .
-                                       Xml::radioLabel( wfMsg( 
'allmessages-filter-all' ),
-                                               'filter',
-                                               'all',
-                                               
'mw-allmessages-form-filter-all',
-                                               ( $this->filter == 'all' )
-                                       ) .
-                                       Xml::radioLabel( wfMsg( 
'allmessages-filter-modified' ),
-                                               'filter',
-                                               'modified',
-                                               
'mw-allmessages-form-filter-modified',
-                                       ( $this->filter == 'modified' )
-                               ) .
-                               "</td>\n
-                       </tr>
-                       <tr>\n
-                               <td class=\"mw-label\">" .
-                                       Xml::label( wfMsg( 
'allmessages-language' ), 'mw-allmessages-form-lang' ) .
-                               "</td>\n
-                               <td class=\"mw-input\">" .
-                                       Xml::openElement( 'select', array( 'id' 
=> 'mw-allmessages-form-lang', 'name' => 'lang' ) );
 
-               foreach( $languages as $lang => $name ) {
-                       $selected = $lang == $this->langCode;
-                       $out .= Xml::option( $lang . ' - ' . $name, $lang, 
$selected ) . "\n";
-               }
-               $out .= Xml::closeElement( 'select' ) .
-                               "</td>\n
-                       </tr>
-                       <tr>\n
-                               <td></td>
-                               <td>" .
-                                       Xml::submitButton( wfMsg( 
'allmessages-filter-submit' ) ) .
-                               "</td>\n
-                       </tr>" .
-                       Xml::closeElement( 'table' ) .
-                       $this->table->getHiddenFields( array( 'title', 
'prefix', 'filter', 'lang' ) ) .
-                       Xml::closeElement( 'fieldset' ) .
-                       Xml::closeElement( 'form' );
-               return $out;
-       }
-}
-
 /**
  * Use TablePager for prettified output. We have to pretend that we're
  * getting data from a table when in fact not all of it comes from the 
database.
  */
 class AllmessagesTablePager extends TablePager {
 
+       protected $filter, $prefix, $langCode;
+
        public $mLimitsShown;
 
        /**
@@ -217,6 +149,85 @@
                }
        }
 
+       function buildForm() {
+               global $wgScript;
+
+               $languages = Language::getLanguageNames( false );
+               ksort( $languages );
+
+               $out  = Xml::openElement( 'form', array( 'method' => 'get', 
'action' => $wgScript, 'id' => 'mw-allmessages-form' ) ) .
+                       Xml::fieldset( wfMsg( 'allmessages-filter-legend' ) ) .
+                       Html::hidden( 'title', 
$this->getTitle()->getPrefixedText() ) .
+                       Xml::openElement( 'table', array( 'class' => 
'mw-allmessages-table' ) ) . "\n" .
+                       '<tr>
+                               <td class="mw-label">' .
+                                       Xml::label( wfMsg( 'allmessages-prefix' 
), 'mw-allmessages-form-prefix' ) .
+                               "</td>\n
+                               <td class=\"mw-input\">" .
+                                       Xml::input( 'prefix', 20, str_replace( 
'_', ' ', $this->prefix ), array( 'id' => 'mw-allmessages-form-prefix' ) ) .
+                               "</td>\n
+                       </tr>
+                       <tr>\n
+                               <td class='mw-label'>" .
+                                       wfMsg( 'allmessages-filter' ) .
+                               "</td>\n
+                               <td class='mw-input'>" .
+                                       Xml::radioLabel( wfMsg( 
'allmessages-filter-unmodified' ),
+                                               'filter',
+                                               'unmodified',
+                                               
'mw-allmessages-form-filter-unmodified',
+                                               ( $this->filter == 'unmodified' 
)
+                                       ) .
+                                       Xml::radioLabel( wfMsg( 
'allmessages-filter-all' ),
+                                               'filter',
+                                               'all',
+                                               
'mw-allmessages-form-filter-all',
+                                               ( $this->filter == 'all' )
+                                       ) .
+                                       Xml::radioLabel( wfMsg( 
'allmessages-filter-modified' ),
+                                               'filter',
+                                               'modified',
+                                               
'mw-allmessages-form-filter-modified',
+                                       ( $this->filter == 'modified' )
+                               ) .
+                               "</td>\n
+                       </tr>
+                       <tr>\n
+                               <td class=\"mw-label\">" .
+                                       Xml::label( wfMsg( 
'allmessages-language' ), 'mw-allmessages-form-lang' ) .
+                               "</td>\n
+                               <td class=\"mw-input\">" .
+                                       Xml::openElement( 'select', array( 'id' 
=> 'mw-allmessages-form-lang', 'name' => 'lang' ) );
+
+               foreach( $languages as $lang => $name ) {
+                       $selected = $lang == $this->langcode;
+                       $out .= Xml::option( $lang . ' - ' . $name, $lang, 
$selected ) . "\n";
+               }
+               $out .= Xml::closeElement( 'select' ) .
+                               "</td>\n
+                       </tr>" .
+
+                       '<tr>
+                               <td class="mw-label">' .
+                                       Xml::label( wfMsg( 
'table_pager_limit_label'), 'mw-table_pager_limit_label' ) .
+                               '</td>
+                               <td class="mw-input">' .
+                                       $this->getLimitSelect() .
+                               '</td>
+                       <tr>
+                               <td></td>
+                               <td>' .
+                                       Xml::submitButton( wfMsg( 
'allmessages-filter-submit' ) ) .
+                               "</td>\n
+                       </tr>" .
+
+                       Xml::closeElement( 'table' ) .
+                       $this->getHiddenFields( array( 'title', 'prefix', 
'filter', 'lang', 'limit' ) ) .
+                       Xml::closeElement( 'fieldset' ) .
+                       Xml::closeElement( 'form' );
+               return $out;
+       }
+
        function getAllMessages( $descending ) {
                wfProfileIn( __METHOD__ );
                $messageNames = 
Language::getLocalisationCache()->getSubitemList( 'en', 'messages' );


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to