Modified Special:Categories to subclass SpecialPage
This commit is contained in:
parent
fd9ba658d1
commit
1fc0ad5a56
3 changed files with 30 additions and 18 deletions
|
|
@ -599,6 +599,7 @@ $wgAutoloadLocalClasses = array(
|
|||
'SpecialBlankpage' => 'includes/specials/SpecialBlankpage.php',
|
||||
'SpecialBlockme' => 'includes/specials/SpecialBlockme.php',
|
||||
'SpecialBookSources' => 'includes/specials/SpecialBooksources.php',
|
||||
'SpecialCategories' => 'includes/specials/SpecialCategories.php',
|
||||
'SpecialComparePages' => 'includes/specials/SpecialComparePages.php',
|
||||
'SpecialExport' => 'includes/specials/SpecialExport.php',
|
||||
'SpecialFilepath' => 'includes/specials/SpecialFilepath.php',
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ class SpecialPage {
|
|||
# List of pages
|
||||
'Allpages' => 'SpecialAllpages',
|
||||
'Prefixindex' => 'SpecialPrefixindex',
|
||||
'Categories' => array( 'SpecialPage', 'Categories' ),
|
||||
'Categories' => 'SpecialCategories',
|
||||
'Disambiguations' => array( 'SpecialPage', 'Disambiguations' ),
|
||||
'Listredirects' => array( 'SpecialPage', 'Listredirects' ),
|
||||
|
||||
|
|
|
|||
|
|
@ -21,25 +21,36 @@
|
|||
* @ingroup SpecialPage
|
||||
*/
|
||||
|
||||
function wfSpecialCategories( $par=null ) {
|
||||
global $wgOut, $wgRequest;
|
||||
/**
|
||||
* @ingroup SpecialPage
|
||||
*/
|
||||
class SpecialCategories extends SpecialPage {
|
||||
|
||||
if( $par == '' ) {
|
||||
$from = $wgRequest->getText( 'from' );
|
||||
} else {
|
||||
$from = $par;
|
||||
function __construct() {
|
||||
parent::__construct( 'Categories' );
|
||||
}
|
||||
|
||||
function execute( $par ) {
|
||||
global $wgOut, $wgRequest;
|
||||
|
||||
$this->setHeaders();
|
||||
$this->outputHeader();
|
||||
|
||||
$from = $wgRequest->getText( 'from', $par );
|
||||
|
||||
$cap = new CategoryPager( $from );
|
||||
$cap->doQuery();
|
||||
|
||||
$wgOut->addHTML(
|
||||
Html::openElement( 'div', array( 'class' => 'mw-spcontent' ) ) .
|
||||
wfMsgExt( 'categoriespagetext', array( 'parse' ), $cap->getNumRows() ) .
|
||||
$cap->getStartForm( $from ) .
|
||||
$cap->getNavigationBar() .
|
||||
'<ul>' . $cap->getBody() . '</ul>' .
|
||||
$cap->getNavigationBar() .
|
||||
Html::closeElement( 'div' )
|
||||
);
|
||||
}
|
||||
$cap = new CategoryPager( $from );
|
||||
$cap->doQuery();
|
||||
$wgOut->addHTML(
|
||||
Xml::openElement( 'div', array('class' => 'mw-spcontent') ) .
|
||||
wfMsgExt( 'categoriespagetext', array( 'parse' ), $cap->getNumRows() ) .
|
||||
$cap->getStartForm( $from ) .
|
||||
$cap->getNavigationBar() .
|
||||
'<ul>' . $cap->getBody() . '</ul>' .
|
||||
$cap->getNavigationBar() .
|
||||
Xml::closeElement( 'div' )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue