Toss in a "display from" input field on Special:Categories
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 19 May 2008 23:53:01 +0000 (23:53 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 19 May 2008 23:53:01 +0000 (23:53 +0000)
I'm not 100% happy with this yet as it doesn't play nice with initial-lowercase input.

includes/SpecialCategories.php
languages/messages/MessagesEn.php

index f48989d..0d4d5b9 100644 (file)
@@ -5,13 +5,14 @@
  */
 
 function wfSpecialCategories() {
-       global $wgOut;
+       global $wgOut, $wgRequest;
 
        $cap = new CategoryPager();
        $wgOut->addHTML(
                wfMsgExt( 'categoriespagetext', array( 'parse' ) ) .
-               $cap->getNavigationBar()
-               . '<ul>' . $cap->getBody() . '</ul>' .
+               $cap->getStartForm( str_replace( '_', ' ', $wgRequest->getVal( 'offset' ) ) ) .
+               $cap->getNavigationBar() .
+               '<ul>' . $cap->getBody() . '</ul>' .
                $cap->getNavigationBar()
        );
 }
@@ -73,4 +74,18 @@ class CategoryPager extends AlphabeticPager {
                                $wgLang->formatNum( $result->cat_pages ) );
                return Xml::tags('li', null, "$titleText ($count)" ) . "\n";
        }
+       
+       public function getStartForm( $from='' ) {
+               global $wgScript;
+               $t = SpecialPage::getTitleFor( 'Categories' );
+       
+               return
+                       Xml::tags( 'form', array( 'method' => 'get', 'action' => $wgScript ),
+                               Xml::hidden( 'title', $t->getPrefixedText() ) .
+                               Xml::fieldset( wfMsg( 'categories' ),
+                                       Xml::inputLabel( wfMsg( 'categoriesfrom' ),
+                                               'offset', 'offset', 20, $from ) .
+                                       ' ' .
+                                       Xml::submitButton( wfMsg( 'allpagessubmit' ) ) ) );
+       }
 }
index 7443b5b..0cafded 100644 (file)
@@ -1964,6 +1964,10 @@ You can narrow down the view by selecting a log type, the user name, or the affe
 It may contain one or more characters which cannot be used in titles.',
 'allpages-bad-ns'   => '{{SITENAME}} does not have namespace "$1".',
 
+# Special:Categories
+'categoriesfrom' => 'Display categories starting at:',
+
+
 # Special:Listusers
 'listusersfrom'      => 'Display users starting at:',
 'listusers-submit'   => 'Show',