Index: trunk/phase3/includes/AutoLoader.php |
— | — | @@ -407,7 +407,7 @@ |
408 | 408 | 'MostlinkedPage' => 'includes/specials/Mostlinked.php', |
409 | 409 | 'MostrevisionsPage' => 'includes/specials/Mostrevisions.php', |
410 | 410 | 'MovePageForm' => 'includes/specials/Movepage.php', |
411 | | - 'NewPagesForm' => 'includes/specials/Newpages.php', |
| 411 | + 'SpecialNewpages' => 'includes/specials/Newpages.php', |
412 | 412 | 'NewPagesPager' => 'includes/specials/Newpages.php', |
413 | 413 | 'PageArchive' => 'includes/specials/Undelete.php', |
414 | 414 | 'PasswordResetForm' => 'includes/specials/Resetpass.php', |
Index: trunk/phase3/includes/specials/Newpages.php |
— | — | @@ -1,30 +1,22 @@ |
2 | 2 | <?php |
3 | | -/** |
4 | | - * @file |
5 | | - * @ingroup SpecialPage |
6 | | - */ |
7 | 3 | |
8 | | - |
9 | 4 | /** |
10 | | - * Start point |
11 | | - */ |
12 | | -function wfSpecialNewPages( $par, $sp ) { |
13 | | - $page = new NewPagesForm(); |
14 | | - $page->execute( $par, $sp->including() ); |
15 | | -} |
16 | | - |
17 | | -/** |
18 | 5 | * implements Special:Newpages |
19 | 6 | * @ingroup SpecialPage |
20 | 7 | */ |
21 | | -class NewPagesForm { |
| 8 | +class SpecialNewpages extends SpecialPage { |
22 | 9 | |
23 | 10 | // Stored objects |
24 | | - protected $opts, $title, $skin; |
| 11 | + protected $opts, $skin; |
25 | 12 | |
26 | 13 | // Some internal settings |
27 | 14 | protected $showNavigation = false; |
28 | 15 | |
| 16 | + public function __construct(){ |
| 17 | + parent::__construct( 'Newpages' ); |
| 18 | + $this->includable( true ); |
| 19 | + } |
| 20 | + |
29 | 21 | protected function setup( $par ) { |
30 | 22 | global $wgRequest, $wgUser, $wgEnableNewpagesUserFilter; |
31 | 23 | |
— | — | @@ -52,7 +44,6 @@ |
53 | 45 | |
54 | 46 | // Store some objects |
55 | 47 | $this->skin = $wgUser->getSkin(); |
56 | | - $this->title = SpecialPage::getTitleFor( 'NewPages' ); |
57 | 48 | } |
58 | 49 | |
59 | 50 | protected function parseParams( $par ) { |
— | — | @@ -89,16 +80,18 @@ |
90 | 81 | * Show a form for filtering namespace and username |
91 | 82 | * |
92 | 83 | * @param string $par |
93 | | - * @param bool $including true if the page is being included with {{Special:Newpages}} |
94 | 84 | * @return string |
95 | 85 | */ |
96 | | - public function execute( $par, $including ) { |
| 86 | + public function execute( $par ) { |
97 | 87 | global $wgLang, $wgGroupPermissions, $wgUser, $wgOut; |
98 | 88 | |
99 | | - $this->showNavigation = !$including; // Maybe changed in setup |
| 89 | + $this->setHeaders(); |
| 90 | + $this->outputHeader(); |
| 91 | + |
| 92 | + $this->showNavigation = !$this->including(); // Maybe changed in setup |
100 | 93 | $this->setup( $par ); |
101 | 94 | |
102 | | - if( !$including ) { |
| 95 | + if( !$this->including() ) { |
103 | 96 | // Settings |
104 | 97 | $this->form(); |
105 | 98 | |
— | — | @@ -146,9 +139,10 @@ |
147 | 140 | $changed = $this->opts->getChangedValues(); |
148 | 141 | unset($changed['offset']); // Reset offset if query type changes |
149 | 142 | |
| 143 | + $self = $this->getTitle(); |
150 | 144 | foreach ( $filters as $key => $msg ) { |
151 | 145 | $onoff = 1 - $this->opts->getValue($key); |
152 | | - $link = $this->skin->makeKnownLinkObj( $this->title, $showhide[$onoff], |
| 146 | + $link = $this->skin->makeKnownLinkObj( $self, $showhide[$onoff], |
153 | 147 | wfArrayToCGI( array( $key => $onoff ), $changed ) |
154 | 148 | ); |
155 | 149 | $links[$key] = wfMsgHtml( $msg, $link ); |
— | — | @@ -177,7 +171,7 @@ |
178 | 172 | $hidden = implode( "\n", $hidden ); |
179 | 173 | |
180 | 174 | $form = Xml::openElement( 'form', array( 'action' => $wgScript ) ) . |
181 | | - Xml::hidden( 'title', $this->title->getPrefixedDBkey() ) . |
| 175 | + Xml::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . |
182 | 176 | Xml::fieldset( wfMsg( 'newpages' ) ) . |
183 | 177 | Xml::openElement( 'table', array( 'id' => 'mw-newpages-table' ) ) . |
184 | 178 | "<tr> |
— | — | @@ -284,7 +278,7 @@ |
285 | 279 | $feed = new $wgFeedClasses[$type]( |
286 | 280 | $this->feedTitle(), |
287 | 281 | wfMsg( 'tagline' ), |
288 | | - $this->title->getFullUrl() ); |
| 282 | + $this->getTitle()->getFullUrl() ); |
289 | 283 | |
290 | 284 | $pager = new NewPagesPager( $this, $this->opts ); |
291 | 285 | $limit = $this->opts->getValue( 'limit' ); |
— | — | @@ -369,7 +363,7 @@ |
370 | 364 | function getTitle(){ |
371 | 365 | static $title = null; |
372 | 366 | if ( $title === null ) |
373 | | - $title = SpecialPage::getTitleFor( 'Newpages' ); |
| 367 | + $title = $this->mForm->getTitle(); |
374 | 368 | return $title; |
375 | 369 | } |
376 | 370 | |
Index: trunk/phase3/includes/SpecialPage.php |
— | — | @@ -116,7 +116,7 @@ |
117 | 117 | 'Fewestrevisions' => array( 'SpecialPage', 'Fewestrevisions' ), |
118 | 118 | 'Shortpages' => array( 'SpecialPage', 'Shortpages' ), |
119 | 119 | 'Longpages' => array( 'SpecialPage', 'Longpages' ), |
120 | | - 'Newpages' => array( 'IncludableSpecialPage', 'Newpages' ), |
| 120 | + 'Newpages' => 'SpecialNewpages', |
121 | 121 | 'Ancientpages' => array( 'SpecialPage', 'Ancientpages' ), |
122 | 122 | 'Deadendpages' => array( 'SpecialPage', 'Deadendpages' ), |
123 | 123 | 'Protectedpages' => array( 'SpecialPage', 'Protectedpages' ), |