Index: trunk/phase3/includes/SpecialCategories.php |
— | — | @@ -4,13 +4,18 @@ |
5 | 5 | * @ingroup SpecialPage |
6 | 6 | */ |
7 | 7 | |
8 | | -function wfSpecialCategories() { |
| 8 | +function wfSpecialCategories( $par=null ) { |
9 | 9 | global $wgOut, $wgRequest; |
10 | 10 | |
11 | | - $cap = new CategoryPager(); |
| 11 | + if( $par == '' ) { |
| 12 | + $from = $wgRequest->getText( 'from' ); |
| 13 | + } else { |
| 14 | + $from = $par; |
| 15 | + } |
| 16 | + $cap = new CategoryPager( $from ); |
12 | 17 | $wgOut->addHTML( |
13 | 18 | wfMsgExt( 'categoriespagetext', array( 'parse' ) ) . |
14 | | - $cap->getStartForm( str_replace( '_', ' ', $wgRequest->getVal( 'offset' ) ) ) . |
| 19 | + $cap->getStartForm( $from ) . |
15 | 20 | $cap->getNavigationBar() . |
16 | 21 | '<ul>' . $cap->getBody() . '</ul>' . |
17 | 22 | $cap->getNavigationBar() |
— | — | @@ -24,6 +29,18 @@ |
25 | 30 | * @ingroup SpecialPage Pager |
26 | 31 | */ |
27 | 32 | class CategoryPager extends AlphabeticPager { |
| 33 | + function __construct( $from ) { |
| 34 | + parent::__construct(); |
| 35 | + $from = str_replace( ' ', '_', $from ); |
| 36 | + if( $from != '' ) { |
| 37 | + global $wgCapitalLinks, $wgContLang; |
| 38 | + if( $wgCapitalLinks ) { |
| 39 | + $from = $wgContLang->ucfirst( $from ); |
| 40 | + } |
| 41 | + $this->mOffset = $from; |
| 42 | + } |
| 43 | + } |
| 44 | + |
28 | 45 | function getQueryInfo() { |
29 | 46 | global $wgRequest; |
30 | 47 | return array( |
— | — | @@ -39,6 +56,10 @@ |
40 | 57 | return 'cat_title'; |
41 | 58 | } |
42 | 59 | |
| 60 | + function getDefaultQuery() { |
| 61 | + parent::getDefaultQuery(); |
| 62 | + unset( $this->mDefaultQuery['from'] ); |
| 63 | + } |
43 | 64 | # protected function getOrderTypeMessages() { |
44 | 65 | # return array( 'abc' => 'special-categories-sort-abc', |
45 | 66 | # 'count' => 'special-categories-sort-count' ); |
— | — | @@ -75,7 +96,7 @@ |
76 | 97 | return Xml::tags('li', null, "$titleText ($count)" ) . "\n"; |
77 | 98 | } |
78 | 99 | |
79 | | - public function getStartForm( $from='' ) { |
| 100 | + public function getStartForm( $from ) { |
80 | 101 | global $wgScript; |
81 | 102 | $t = SpecialPage::getTitleFor( 'Categories' ); |
82 | 103 | |
— | — | @@ -84,7 +105,7 @@ |
85 | 106 | Xml::hidden( 'title', $t->getPrefixedText() ) . |
86 | 107 | Xml::fieldset( wfMsg( 'categories' ), |
87 | 108 | Xml::inputLabel( wfMsg( 'categoriesfrom' ), |
88 | | - 'offset', 'offset', 20, $from ) . |
| 109 | + 'from', 'from', 20, $from ) . |
89 | 110 | ' ' . |
90 | 111 | Xml::submitButton( wfMsg( 'allpagessubmit' ) ) ) ); |
91 | 112 | } |