Index: trunk/phase3/includes/AutoLoader.php |
— | — | @@ -506,6 +506,7 @@ |
507 | 507 | 'SpecialStatistics' => 'includes/specials/SpecialStatistics.php', |
508 | 508 | 'SpecialTags' => 'includes/specials/SpecialTags.php', |
509 | 509 | 'SpecialVersion' => 'includes/specials/SpecialVersion.php', |
| 510 | + 'SpecialWhatlinkshere' => 'includes/specials/SpecialWhatlinkshere.php', |
510 | 511 | 'UncategorizedCategoriesPage' => 'includes/specials/SpecialUncategorizedcategories.php', |
511 | 512 | 'UncategorizedPagesPage' => 'includes/specials/SpecialUncategorizedpages.php', |
512 | 513 | 'UncategorizedTemplatesPage' => 'includes/specials/SpecialUncategorizedtemplates.php', |
— | — | @@ -522,7 +523,6 @@ |
523 | 524 | 'WantedFilesPage' => 'includes/specials/SpecialWantedfiles.php', |
524 | 525 | 'WantedPagesPage' => 'includes/specials/SpecialWantedpages.php', |
525 | 526 | 'WantedTemplatesPage' => 'includes/specials/SpecialWantedtemplates.php', |
526 | | - 'WhatLinksHerePage' => 'includes/specials/SpecialWhatlinkshere.php', |
527 | 527 | 'WikiImporter' => 'includes/Import.php', |
528 | 528 | 'WikiRevision' => 'includes/Import.php', |
529 | 529 | 'WithoutInterwikiPage' => 'includes/specials/SpecialWithoutinterwiki.php', |
Index: trunk/phase3/includes/specials/SpecialWhatlinkshere.php |
— | — | @@ -7,40 +7,27 @@ |
8 | 8 | */ |
9 | 9 | |
10 | 10 | /** |
11 | | - * Entry point |
12 | | - * @param $par String: An article name ?? |
13 | | - */ |
14 | | -function wfSpecialWhatlinkshere($par = NULL) { |
15 | | - global $wgRequest; |
16 | | - $page = new WhatLinksHerePage( $wgRequest, $par ); |
17 | | - $page->execute(); |
18 | | -} |
19 | | - |
20 | | -/** |
21 | 11 | * implements Special:Whatlinkshere |
22 | 12 | * @ingroup SpecialPage |
23 | 13 | */ |
24 | | -class WhatLinksHerePage { |
25 | | - // Stored data |
26 | | - protected $par; |
| 14 | +class SpecialWhatLinksHere extends SpecialPage { |
27 | 15 | |
28 | 16 | // Stored objects |
29 | 17 | protected $opts, $target, $selfTitle; |
30 | 18 | |
31 | 19 | // Stored globals |
32 | | - protected $skin, $request; |
| 20 | + protected $skin; |
33 | 21 | |
34 | 22 | protected $limits = array( 20, 50, 100, 250, 500 ); |
35 | 23 | |
36 | | - function WhatLinksHerePage( $request, $par = null ) { |
| 24 | + public function __construct() { |
| 25 | + parent::__construct( 'Whatlinkshere' ); |
37 | 26 | global $wgUser; |
38 | | - $this->request = $request; |
39 | 27 | $this->skin = $wgUser->getSkin(); |
40 | | - $this->par = $par; |
41 | 28 | } |
42 | 29 | |
43 | | - function execute() { |
44 | | - global $wgOut; |
| 30 | + function execute( $par ) { |
| 31 | + global $wgOut, $wgRequest; |
45 | 32 | |
46 | 33 | $opts = new FormOptions(); |
47 | 34 | |
— | — | @@ -54,12 +41,12 @@ |
55 | 42 | $opts->add( 'hidelinks', false ); |
56 | 43 | $opts->add( 'hideimages', false ); |
57 | 44 | |
58 | | - $opts->fetchValuesFromRequest( $this->request ); |
| 45 | + $opts->fetchValuesFromRequest( $wgRequest ); |
59 | 46 | $opts->validateIntBounds( 'limit', 0, 5000 ); |
60 | 47 | |
61 | 48 | // Give precedence to subpage syntax |
62 | | - if ( isset($this->par) ) { |
63 | | - $opts->setValue( 'target', $this->par ); |
| 49 | + if ( isset($par) ) { |
| 50 | + $opts->setValue( 'target', $par ); |
64 | 51 | } |
65 | 52 | |
66 | 53 | // Bind to member variable |
Index: trunk/phase3/includes/SpecialPage.php |
— | — | @@ -167,7 +167,7 @@ |
168 | 168 | 'Export' => 'SpecialExport', |
169 | 169 | 'Import' => 'SpecialImport', |
170 | 170 | 'Undelete' => array( 'SpecialPage', 'Undelete', 'deletedhistory' ), |
171 | | - 'Whatlinkshere' => array( 'SpecialPage', 'Whatlinkshere' ), |
| 171 | + 'Whatlinkshere' => 'SpecialWhatlinkshere', |
172 | 172 | 'MergeHistory' => array( 'SpecialPage', 'MergeHistory', 'mergehistory' ), |
173 | 173 | |
174 | 174 | # Other |