Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -155,6 +155,7 @@ |
156 | 156 | $out = $this->getOutput(); |
157 | 157 | $request = $this->getRequest(); |
158 | 158 | $user = $this->getUser(); |
| 159 | + $title = $this->getTitle(); |
159 | 160 | |
160 | 161 | wfProfileIn( __METHOD__ . '-init' ); |
161 | 162 | $this->initPage( $out ); |
— | — | @@ -163,7 +164,7 @@ |
164 | 165 | wfProfileOut( __METHOD__ . '-init' ); |
165 | 166 | |
166 | 167 | wfProfileIn( __METHOD__ . '-stuff' ); |
167 | | - $this->thispage = $this->getTitle()->getPrefixedDBkey(); |
| 168 | + $this->thispage = $title->getPrefixedDBkey(); |
168 | 169 | $this->userpage = $user->getUserPage()->getPrefixedText(); |
169 | 170 | $query = array(); |
170 | 171 | if ( !$request->wasPosted() ) { |
— | — | @@ -185,7 +186,7 @@ |
186 | 187 | $this->userpageUrlDetails = self::makeKnownUrlDetails( $this->userpage ); |
187 | 188 | } |
188 | 189 | |
189 | | - $this->titletxt = $this->getTitle()->getPrefixedText(); |
| 190 | + $this->titletxt = $title->getPrefixedText(); |
190 | 191 | wfProfileOut( __METHOD__ . '-stuff' ); |
191 | 192 | |
192 | 193 | wfProfileIn( __METHOD__ . '-stuff-head' ); |
— | — | @@ -215,7 +216,7 @@ |
216 | 217 | $tpl->set( 'html5version', $wgHtml5Version ); |
217 | 218 | $tpl->set( 'headlinks', $out->getHeadLinks() ); |
218 | 219 | $tpl->set( 'csslinks', $out->buildCssLinks() ); |
219 | | - $tpl->set( 'pageclass', $this->getPageClasses( $this->getTitle() ) ); |
| 220 | + $tpl->set( 'pageclass', $this->getPageClasses( $title ) ); |
220 | 221 | $tpl->set( 'skinnameclass', ( 'skin-' . Sanitizer::escapeClass( $this->getSkinName() ) ) ); |
221 | 222 | } |
222 | 223 | wfProfileOut( __METHOD__ . '-stuff-head' ); |
— | — | @@ -225,9 +226,9 @@ |
226 | 227 | $tpl->set( 'pagetitle', $out->getHTMLTitle() ); |
227 | 228 | $tpl->set( 'displaytitle', $out->mPageLinkTitle ); |
228 | 229 | |
229 | | - $tpl->set( 'titleprefixeddbkey', $this->getTitle()->getPrefixedDBKey() ); |
230 | | - $tpl->set( 'titletext', $this->getTitle()->getText() ); |
231 | | - $tpl->set( 'articleid', $this->getTitle()->getArticleId() ); |
| 230 | + $tpl->set( 'titleprefixeddbkey', $title->getPrefixedDBKey() ); |
| 231 | + $tpl->set( 'titletext', $title->getText() ); |
| 232 | + $tpl->set( 'articleid', $title->getArticleId() ); |
232 | 233 | |
233 | 234 | $tpl->set( 'isarticle', $out->isArticle() ); |
234 | 235 | |
— | — | @@ -269,12 +270,12 @@ |
270 | 271 | $tpl->set( 'printable', $out->isPrintable() ); |
271 | 272 | $tpl->set( 'handheld', $request->getBool( 'handheld' ) ); |
272 | 273 | $tpl->setRef( 'loggedin', $this->loggedin ); |
273 | | - $tpl->set( 'notspecialpage', !$this->getTitle()->isSpecialPage() ); |
| 274 | + $tpl->set( 'notspecialpage', !$title->isSpecialPage() ); |
274 | 275 | /* XXX currently unused, might get useful later |
275 | | - $tpl->set( 'editable', ( !$this->getTitle()->isSpecialPage() ) ); |
276 | | - $tpl->set( 'exists', $this->getTitle()->getArticleID() != 0 ); |
277 | | - $tpl->set( 'watch', $this->getTitle()->userIsWatching() ? 'unwatch' : 'watch' ); |
278 | | - $tpl->set( 'protect', count( $this->getTitle()->isProtected() ) ? 'unprotect' : 'protect' ); |
| 276 | + $tpl->set( 'editable', ( !$title->isSpecialPage() ) ); |
| 277 | + $tpl->set( 'exists', $title->getArticleID() != 0 ); |
| 278 | + $tpl->set( 'watch', $title->userIsWatching() ? 'unwatch' : 'watch' ); |
| 279 | + $tpl->set( 'protect', count( $title->isProtected() ) ? 'unprotect' : 'protect' ); |
279 | 280 | $tpl->set( 'helppage', $this->msg( 'helppage' )->text() ); |
280 | 281 | */ |
281 | 282 | $tpl->set( 'searchaction', $this->escapeSearchLink() ); |
— | — | @@ -327,9 +328,9 @@ |
328 | 329 | $tpl->set( 'lastmod', false ); |
329 | 330 | $tpl->set( 'credits', false ); |
330 | 331 | $tpl->set( 'numberofwatchingusers', false ); |
331 | | - if ( $out->isArticle() && $this->getTitle()->exists() ) { |
| 332 | + if ( $out->isArticle() && $title->exists() ) { |
332 | 333 | if ( $this->isRevisionCurrent() ) { |
333 | | - $page = WikiPage::factory( $this->getTitle() ); |
| 334 | + $page = WikiPage::factory( $title ); |
334 | 335 | if ( !$wgDisableCounters ) { |
335 | 336 | $viewcount = $page->getCount(); |
336 | 337 | if ( $viewcount ) { |
— | — | @@ -340,7 +341,7 @@ |
341 | 342 | if( $wgPageShowWatchingUsers ) { |
342 | 343 | $dbr = wfGetDB( DB_SLAVE ); |
343 | 344 | $num = $dbr->selectField( 'watchlist', 'COUNT(*)', |
344 | | - array( 'wl_title' => $this->getTitle()->getDBkey(), 'wl_namespace' => $this->getTitle()->getNamespace() ), |
| 345 | + array( 'wl_title' => $title->getDBkey(), 'wl_namespace' => $title->getNamespace() ), |
345 | 346 | __METHOD__ |
346 | 347 | ); |
347 | 348 | if( $num > 0 ) { |
— | — | @@ -415,10 +416,10 @@ |
416 | 417 | # Add a <div class="mw-content-ltr/rtl"> around the body text |
417 | 418 | # not for special pages or file pages AND only when viewing AND if the page exists |
418 | 419 | # (or is in MW namespace, because that has default content) |
419 | | - if( !in_array( $this->getTitle()->getNamespace(), array( NS_SPECIAL, NS_FILE ) ) && |
| 420 | + if( !in_array( $title->getNamespace(), array( NS_SPECIAL, NS_FILE ) ) && |
420 | 421 | in_array( $request->getVal( 'action', 'view' ), array( 'view', 'historysubmit' ) ) && |
421 | | - ( $this->getTitle()->exists() || $this->getTitle()->getNamespace() == NS_MEDIAWIKI ) ) { |
422 | | - $pageLang = $this->getTitle()->getPageLanguage(); |
| 422 | + ( $title->exists() || $title->getNamespace() == NS_MEDIAWIKI ) ) { |
| 423 | + $pageLang = $title->getPageLanguage(); |
423 | 424 | $realBodyAttribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(), |
424 | 425 | 'class' => 'mw-content-'.$pageLang->getDir() ); |
425 | 426 | $out->mBodytext = Html::rawElement( 'div', $realBodyAttribs, $out->mBodytext ); |