r84807 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84806‎ | r84807 | r84808 >
Date:17:50, 26 March 2011
Author:happy-melon
Status:ok
Tags:
Comment:
Update SpecialListfiles to subclass SpecialPage. Nearly there!
Modified paths:
  • /trunk/phase3/includes/AutoLoader.php (modified) (history)
  • /trunk/phase3/includes/SpecialPage.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialListfiles.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/AutoLoader.php
@@ -659,6 +659,7 @@
660660 'SpecialExport' => 'includes/specials/SpecialExport.php',
661661 'SpecialFilepath' => 'includes/specials/SpecialFilepath.php',
662662 'SpecialImport' => 'includes/specials/SpecialImport.php',
 663+ 'SpecialListFiles' => 'includes/specials/SpecialListfiles.php',
663664 'SpecialListGroupRights' => 'includes/specials/SpecialListgrouprights.php',
664665 'SpecialListusers' => 'includes/specials/SpecialListusers.php',
665666 'SpecialLockdb' => 'includes/specials/SpecialLockdb.php',
Index: trunk/phase3/includes/specials/SpecialListfiles.php
@@ -21,15 +21,23 @@
2222 * @ingroup SpecialPage
2323 */
2424
25 -function wfSpecialListfiles( $par = null ) {
26 - global $wgOut;
 25+class SpecialListFiles extends SpecialPage {
2726
28 - $pager = new ImageListPager( $par );
 27+ public function __construct(){
 28+ parent::__construct( 'Listfiles' );
 29+ }
2930
30 - $limit = $pager->getForm();
31 - $body = $pager->getBody();
32 - $nav = $pager->getNavigationBar();
33 - $wgOut->addHTML( "$limit<br />\n$body<br />\n$nav" );
 31+ public function execute( $par ){
 32+ global $wgOut;
 33+ $this->setHeaders();
 34+
 35+ $pager = new ImageListPager( $par );
 36+
 37+ $limit = $pager->getForm();
 38+ $body = $pager->getBody();
 39+ $nav = $pager->getNavigationBar();
 40+ $wgOut->addHTML( "$limit<br />\n$body<br />\n$nav" );
 41+ }
3442 }
3543
3644 /**
Index: trunk/phase3/includes/SpecialPage.php
@@ -162,7 +162,7 @@
163163 'Tags' => 'SpecialTags',
164164
165165 # Media reports and uploads
166 - 'Listfiles' => array( 'SpecialPage', 'Listfiles' ),
 166+ 'Listfiles' => 'SpecialListFiles',
167167 'Filepath' => 'SpecialFilepath',
168168 'MIMEsearch' => 'MIMEsearchPage',
169169 'FileDuplicateSearch' => 'FileDuplicateSearchPage',

Status & tagging log