From: Brion Vibber Date: Mon, 19 May 2008 23:53:01 +0000 (+0000) Subject: Toss in a "display from" input field on Special:Categories X-Git-Tag: 1.31.0-rc.0~47531 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=commitdiff_plain;h=aeccf6592dcf526564da6f3cc1f9375ac6a7e1d6;p=lhc%2Fweb%2Fwiklou.git Toss in a "display from" input field on Special:Categories I'm not 100% happy with this yet as it doesn't play nice with initial-lowercase input. --- diff --git a/includes/SpecialCategories.php b/includes/SpecialCategories.php index f48989dbbd..0d4d5b91c7 100644 --- a/includes/SpecialCategories.php +++ b/includes/SpecialCategories.php @@ -5,13 +5,14 @@ */ function wfSpecialCategories() { - global $wgOut; + global $wgOut, $wgRequest; $cap = new CategoryPager(); $wgOut->addHTML( wfMsgExt( 'categoriespagetext', array( 'parse' ) ) . - $cap->getNavigationBar() - . '' . + $cap->getStartForm( str_replace( '_', ' ', $wgRequest->getVal( 'offset' ) ) ) . + $cap->getNavigationBar() . + '' . $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' ) ) ) ); + } } diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 7443b5bf72..0cafded734 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -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',