Index: trunk/phase3/includes/search/SearchEngine.php |
— | — | @@ -171,7 +171,7 @@ |
172 | 172 | return null; |
173 | 173 | } |
174 | 174 | |
175 | | - if ( $title->getNamespace() == NS_SPECIAL || $title->isExternal() || $title->exists() ) { |
| 175 | + if ( $title->isSpecialPage() || $title->isExternal() || $title->exists() ) { |
176 | 176 | return $title; |
177 | 177 | } |
178 | 178 | |
Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -3220,7 +3220,7 @@ |
3221 | 3221 | wfProfileIn( $titleProfileIn ); // template in |
3222 | 3222 | wfProfileIn( __METHOD__ . '-loadtpl' ); |
3223 | 3223 | if ( !$title->isExternal() ) { |
3224 | | - if ( $title->getNamespace() == NS_SPECIAL |
| 3224 | + if ( $title->isSpecialPage() |
3225 | 3225 | && $this->mOptions->getAllowSpecialInclusion() |
3226 | 3226 | && $this->ot['html'] ) |
3227 | 3227 | { |
Index: trunk/phase3/includes/Linker.php |
— | — | @@ -250,7 +250,7 @@ |
251 | 251 | # there's already an action specified, or unless 'edit' makes no sense |
252 | 252 | # (i.e., for a nonexistent special page). |
253 | 253 | if ( in_array( 'broken', $options ) && empty( $query['action'] ) |
254 | | - && $target->getNamespace() != NS_SPECIAL ) { |
| 254 | + && !$target->isSpecialPage() ) { |
255 | 255 | $query['action'] = 'edit'; |
256 | 256 | $query['redlink'] = '1'; |
257 | 257 | } |
— | — | @@ -389,7 +389,7 @@ |
390 | 390 | * @return Title |
391 | 391 | */ |
392 | 392 | static function normaliseSpecialPage( Title $title ) { |
393 | | - if ( $title->getNamespace() == NS_SPECIAL ) { |
| 393 | + if ( $title->isSpecialPage() ) { |
394 | 394 | list( $name, $subpage ) = SpecialPageFactory::resolveAlias( $title->getDBkey() ); |
395 | 395 | if ( !$name ) { |
396 | 396 | return $title; |
Index: trunk/phase3/includes/api/ApiQuery.php |
— | — | @@ -443,7 +443,7 @@ |
444 | 444 | $vals = array(); |
445 | 445 | ApiQueryBase::addTitleInfo( $vals, $title ); |
446 | 446 | $vals['special'] = ''; |
447 | | - if ( $title->getNamespace() == NS_SPECIAL && |
| 447 | + if ( $title->isSpecialPage() && |
448 | 448 | !SpecialPageFactory::exists( $title->getDbKey() ) ) { |
449 | 449 | $vals['missing'] = ''; |
450 | 450 | } elseif ( $title->getNamespace() == NS_MEDIA && |
Index: trunk/phase3/includes/Wiki.php |
— | — | @@ -92,7 +92,7 @@ |
93 | 93 | } |
94 | 94 | } |
95 | 95 | // For non-special titles, check for implicit titles |
96 | | - if ( is_null( $ret ) || $ret->getNamespace() != NS_SPECIAL ) { |
| 96 | + if ( is_null( $ret ) || !$ret->isSpecialPage() ) { |
97 | 97 | // We can have urls with just ?diff=,?oldid= or even just ?diff= |
98 | 98 | $oldid = $request->getInt( 'oldid' ); |
99 | 99 | $oldid = $oldid ? $oldid : $request->getInt( 'diff' ); |
— | — | @@ -190,7 +190,7 @@ |
191 | 191 | && !count( $request->getValueNames( array( 'action', 'title' ) ) ) |
192 | 192 | && wfRunHooks( 'TestCanonicalRedirect', array( $request, $title, $output ) ) ) |
193 | 193 | { |
194 | | - if ( $title->getNamespace() == NS_SPECIAL ) { |
| 194 | + if ( $title->isSpecialPage() ) { |
195 | 195 | list( $name, $subpage ) = SpecialPageFactory::resolveAlias( $title->getDBkey() ); |
196 | 196 | if ( $name ) { |
197 | 197 | $title = SpecialPage::getTitleFor( $name, $subpage ); |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -1112,7 +1112,7 @@ |
1113 | 1113 | $restrictionTypes = $this->getRestrictionTypes(); |
1114 | 1114 | |
1115 | 1115 | # Special pages have inherent protection |
1116 | | - if( $this->getNamespace() == NS_SPECIAL ) { |
| 1116 | + if( $this->isSpecialPage() ) { |
1117 | 1117 | return true; |
1118 | 1118 | } |
1119 | 1119 | |
— | — | @@ -1863,7 +1863,7 @@ |
1864 | 1864 | } |
1865 | 1865 | |
1866 | 1866 | # If it's a special page, ditch the subpage bit and check again |
1867 | | - if ( $this->getNamespace() == NS_SPECIAL ) { |
| 1867 | + if ( $this->isSpecialPage() ) { |
1868 | 1868 | $name = $this->getDBkey(); |
1869 | 1869 | list( $name, /* $subpage */ ) = SpecialPageFactory::resolveAlias( $name ); |
1870 | 1870 | if ( $name === false ) { |
— | — | @@ -4152,7 +4152,7 @@ |
4153 | 4153 | * @return boolean |
4154 | 4154 | */ |
4155 | 4155 | public function isSpecial( $name ) { |
4156 | | - if ( $this->getNamespace() == NS_SPECIAL ) { |
| 4156 | + if ( $this->isSpecialPage() ) { |
4157 | 4157 | list( $thisName, /* $subpage */ ) = SpecialPageFactory::resolveAlias( $this->getDBkey() ); |
4158 | 4158 | if ( $name == $thisName ) { |
4159 | 4159 | return true; |
— | — | @@ -4168,7 +4168,7 @@ |
4169 | 4169 | * @return Title |
4170 | 4170 | */ |
4171 | 4171 | public function fixSpecialName() { |
4172 | | - if ( $this->getNamespace() == NS_SPECIAL ) { |
| 4172 | + if ( $this->isSpecialPage() ) { |
4173 | 4173 | list( $canonicalName, $par ) = SpecialPageFactory::resolveAlias( $this->mDbkeyform ); |
4174 | 4174 | if ( $canonicalName ) { |
4175 | 4175 | $localName = SpecialPageFactory::getLocalNameFor( $canonicalName, $par ); |
— | — | @@ -4279,7 +4279,7 @@ |
4280 | 4280 | * @return array applicable restriction types |
4281 | 4281 | */ |
4282 | 4282 | public function getRestrictionTypes() { |
4283 | | - if ( $this->getNamespace() == NS_SPECIAL ) { |
| 4283 | + if ( $this->isSpecialPage() ) { |
4284 | 4284 | return array(); |
4285 | 4285 | } |
4286 | 4286 | |
— | — | @@ -4356,7 +4356,7 @@ |
4357 | 4357 | */ |
4358 | 4358 | public function getPageLanguage() { |
4359 | 4359 | global $wgLang; |
4360 | | - if ( $this->getNamespace() == NS_SPECIAL ) { |
| 4360 | + if ( $this->isSpecialPage() ) { |
4361 | 4361 | // special pages are in the user language |
4362 | 4362 | return $wgLang; |
4363 | 4363 | } elseif ( $this->isCssOrJsPage() ) { |
Index: trunk/phase3/includes/SkinLegacy.php |
— | — | @@ -238,7 +238,7 @@ |
239 | 239 | $variants = $lang->getVariants(); |
240 | 240 | |
241 | 241 | if ( !$wgDisableLangConversion && sizeof( $variants ) > 1 |
242 | | - && $title->getNamespace() != NS_SPECIAL ) { |
| 242 | + && !$title->isSpecialPage() ) { |
243 | 243 | foreach ( $variants as $code ) { |
244 | 244 | $varname = $lang->getVariantname( $code ); |
245 | 245 | |
— | — | @@ -770,7 +770,7 @@ |
771 | 771 | global $wgOut; |
772 | 772 | |
773 | 773 | $title = $this->getSkin()->getTitle(); |
774 | | - if ( $title->getNamespace() == NS_SPECIAL ) { |
| 774 | + if ( $title->isSpecialPage() ) { |
775 | 775 | return ''; |
776 | 776 | } |
777 | 777 | |
Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -275,9 +275,9 @@ |
276 | 276 | $tpl->set( 'printable', $out->isPrintable() ); |
277 | 277 | $tpl->set( 'handheld', $request->getBool( 'handheld' ) ); |
278 | 278 | $tpl->setRef( 'loggedin', $this->loggedin ); |
279 | | - $tpl->set( 'notspecialpage', $this->getTitle()->getNamespace() != NS_SPECIAL ); |
| 279 | + $tpl->set( 'notspecialpage', !$this->getTitle()->isSpecialPage() ); |
280 | 280 | /* XXX currently unused, might get useful later |
281 | | - $tpl->set( 'editable', ( $this->getTitle()->getNamespace() != NS_SPECIAL ) ); |
| 281 | + $tpl->set( 'editable', ( !$this->getTitle()->isSpecialPage() ) ); |
282 | 282 | $tpl->set( 'exists', $this->getTitle()->getArticleID() != 0 ); |
283 | 283 | $tpl->set( 'watch', $this->getTitle()->userIsWatching() ? 'unwatch' : 'watch' ); |
284 | 284 | $tpl->set( 'protect', count( $this->getTitle()->isProtected() ) ? 'unprotect' : 'protect' ); |
— | — | @@ -589,7 +589,7 @@ |
590 | 590 | # thickens, because $wgTitle is altered for special pages, so doesn't |
591 | 591 | # contain the original alias-with-subpage. |
592 | 592 | $origTitle = Title::newFromText( $request->getText( 'title' ) ); |
593 | | - if( $origTitle instanceof Title && $origTitle->getNamespace() == NS_SPECIAL ) { |
| 593 | + if( $origTitle instanceof Title && $origTitle->isSpecialPage() ) { |
594 | 594 | list( $spName, $spPar ) = SpecialPageFactory::resolveAlias( $origTitle->getText() ); |
595 | 595 | $active = $spName == 'Contributions' |
596 | 596 | && ( ( $spPar && $spPar == $this->username ) |
— | — | @@ -814,7 +814,7 @@ |
815 | 815 | wfRunHooks( 'SkinTemplatePreventOtherActiveTabs', array( &$this, &$preventActiveTabs ) ); |
816 | 816 | |
817 | 817 | // Checks if page is some kind of content |
818 | | - if( $title->getNamespace() != NS_SPECIAL ) { |
| 818 | + if( !$title->isSpecialPage() ) { |
819 | 819 | // Gets page objects for the related namespaces |
820 | 820 | $subjectPage = $title->getSubjectPage(); |
821 | 821 | $talkPage = $title->getTalkPage(); |
— | — | @@ -1009,7 +1009,7 @@ |
1010 | 1010 | array( &$this, &$content_navigation ) ); |
1011 | 1011 | } |
1012 | 1012 | |
1013 | | - if ( !$wgDisableLangConversion && $title->getNamespace() != NS_SPECIAL ) { |
| 1013 | + if ( !$wgDisableLangConversion && !$title->isSpecialPage() ) { |
1014 | 1014 | $pageLang = $title->getPageLanguage(); |
1015 | 1015 | // Gets list of language variants |
1016 | 1016 | $variants = $pageLang->getVariants(); |
Index: trunk/phase3/includes/WikiPage.php |
— | — | @@ -205,7 +205,7 @@ |
206 | 206 | return $rt->getFullURL( 'rdfrom=' . urlencode( $source ) ); |
207 | 207 | } |
208 | 208 | } else { |
209 | | - if ( $rt->getNamespace() == NS_SPECIAL ) { |
| 209 | + if ( $rt->isSpecialPage() ) { |
210 | 210 | // Gotta handle redirects to special pages differently: |
211 | 211 | // Fill the HTTP response "Location" header and ignore |
212 | 212 | // the rest of the page we're on. |
Index: trunk/phase3/includes/specials/SpecialRevisiondelete.php |
— | — | @@ -228,7 +228,7 @@ |
229 | 229 | array(), |
230 | 230 | array( 'page' => $this->targetObj->getPrefixedText() ) |
231 | 231 | ); |
232 | | - if ( $this->targetObj->getNamespace() != NS_SPECIAL ) { |
| 232 | + if ( !$this->targetObj->isSpecialPage() ) { |
233 | 233 | # Give a link to the page history |
234 | 234 | $links[] = Linker::linkKnown( |
235 | 235 | $this->targetObj, |
Index: trunk/phase3/includes/Skin.php |
— | — | @@ -183,7 +183,7 @@ |
184 | 184 | $titles = array( $user->getUserPage(), $user->getTalkPage() ); |
185 | 185 | |
186 | 186 | // Other tab link |
187 | | - if ( $this->getTitle()->getNamespace() == NS_SPECIAL ) { |
| 187 | + if ( $this->getTitle()->isSpecialPage() ) { |
188 | 188 | // nothing |
189 | 189 | } elseif ( $this->getTitle()->isTalkPage() ) { |
190 | 190 | $titles[] = $this->getTitle()->getSubjectPage(); |
— | — | @@ -329,7 +329,7 @@ |
330 | 330 | function getPageClasses( $title ) { |
331 | 331 | $numeric = 'ns-' . $title->getNamespace(); |
332 | 332 | |
333 | | - if ( $title->getNamespace() == NS_SPECIAL ) { |
| 333 | + if ( $title->isSpecialPage() ) { |
334 | 334 | $type = 'ns-special'; |
335 | 335 | // bug 23315: provide a class based on the canonical special page name without subpages |
336 | 336 | list( $canonicalName ) = SpecialPageFactory::resolveAlias( $title->getDBkey() ); |
Index: trunk/phase3/includes/LogPage.php |
— | — | @@ -391,7 +391,7 @@ |
392 | 392 | $params[1] = $lang->timeanddate( $params[1] ); |
393 | 393 | break; |
394 | 394 | default: |
395 | | - if( $title->getNamespace() == NS_SPECIAL ) { |
| 395 | + if( $title->isSpecialPage() ) { |
396 | 396 | list( $name, $par ) = SpecialPageFactory::resolveAlias( $title->getDBkey() ); |
397 | 397 | |
398 | 398 | # Use the language name for log titles, rather than Log/X |