Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -165,6 +165,7 @@ |
166 | 166 | |
167 | 167 | wfProfileIn( __METHOD__ . '-stuff' ); |
168 | 168 | $this->thispage = $title->getPrefixedDBkey(); |
| 169 | + $this->titletxt = $title->getPrefixedText(); |
169 | 170 | $this->userpage = $user->getUserPage()->getPrefixedText(); |
170 | 171 | $query = array(); |
171 | 172 | if ( !$request->wasPosted() ) { |
— | — | @@ -178,7 +179,7 @@ |
179 | 180 | $this->username = $user->getName(); |
180 | 181 | $this->userdisplayname = $user->getDisplayName(); |
181 | 182 | |
182 | | - if ( $user->isLoggedIn() || $this->showIPinHeader() ) { |
| 183 | + if ( $this->loggedin || $this->showIPinHeader() ) { |
183 | 184 | $this->userpageUrlDetails = self::makeUrlDetails( $this->userpage ); |
184 | 185 | } else { |
185 | 186 | # This won't be used in the standard skins, but we define it to preserve the interface |
— | — | @@ -186,7 +187,6 @@ |
187 | 188 | $this->userpageUrlDetails = self::makeKnownUrlDetails( $this->userpage ); |
188 | 189 | } |
189 | 190 | |
190 | | - $this->titletxt = $title->getPrefixedText(); |
191 | 191 | wfProfileOut( __METHOD__ . '-stuff' ); |
192 | 192 | |
193 | 193 | wfProfileIn( __METHOD__ . '-stuff-head' ); |
— | — | @@ -218,25 +218,25 @@ |
219 | 219 | $tpl->set( 'pagetitle', $out->getHTMLTitle() ); |
220 | 220 | $tpl->set( 'displaytitle', $out->mPageLinkTitle ); |
221 | 221 | |
222 | | - $tpl->set( 'titleprefixeddbkey', $title->getPrefixedDBKey() ); |
| 222 | + $tpl->setRef( 'thispage', $this->thispage ); |
| 223 | + $tpl->setRef( 'titleprefixeddbkey', $this->thispage ); |
223 | 224 | $tpl->set( 'titletext', $title->getText() ); |
224 | 225 | $tpl->set( 'articleid', $title->getArticleId() ); |
225 | 226 | |
226 | 227 | $tpl->set( 'isarticle', $out->isArticle() ); |
227 | 228 | |
228 | | - $tpl->setRef( 'thispage', $this->thispage ); |
229 | 229 | $subpagestr = $this->subPageSubtitle(); |
230 | | - $tpl->set( |
231 | | - 'subtitle', !empty( $subpagestr ) ? |
232 | | - '<span class="subpages">' . $subpagestr . '</span>' . $out->getSubtitle() : |
233 | | - $out->getSubtitle() |
234 | | - ); |
| 230 | + if ( $subpagestr !== '' ) { |
| 231 | + $subpagestr = '<span class="subpages">' . $subpagestr . '</span>'; |
| 232 | + } |
| 233 | + $tpl->set( 'subtitle', $subpagestr . $out->getSubtitle() ); |
| 234 | + |
235 | 235 | $undelete = $this->getUndeleteLink(); |
236 | | - $tpl->set( |
237 | | - 'undelete', !empty( $undelete ) ? |
238 | | - '<span class="subpages">' . $undelete . '</span>' : |
239 | | - '' |
240 | | - ); |
| 236 | + if ( $undelete === '' ) { |
| 237 | + $tpl->set( 'undelete', '' ); |
| 238 | + } else { |
| 239 | + $tpl->set( 'undelete', '<span class="subpages">' . $undelete . '</span>' ); |
| 240 | + } |
241 | 241 | |
242 | 242 | $tpl->set( 'catlinks', $this->getCategories() ); |
243 | 243 | if( $out->isSyndicated() ) { |
— | — | @@ -258,6 +258,7 @@ |
259 | 259 | $tpl->setRef( 'wgScript', $wgScript ); |
260 | 260 | $tpl->setRef( 'skinname', $this->skinname ); |
261 | 261 | $tpl->set( 'skinclass', get_class( $this ) ); |
| 262 | + $tpl->setRef( 'skin', $this ); |
262 | 263 | $tpl->setRef( 'stylename', $this->stylename ); |
263 | 264 | $tpl->set( 'printable', $out->isPrintable() ); |
264 | 265 | $tpl->set( 'handheld', $request->getBool( 'handheld' ) ); |
— | — | @@ -280,19 +281,18 @@ |
281 | 282 | $tpl->setRef( 'logopath', $wgLogo ); |
282 | 283 | $tpl->setRef( 'sitename', $wgSitename ); |
283 | 284 | |
284 | | - $contentlang = $wgContLang->getHtmlCode(); |
285 | | - $contentdir = $wgContLang->getDir(); |
286 | | - $userlang = $this->getLanguage()->getHtmlCode(); |
287 | | - $userdir = $this->getLanguage()->getDir(); |
| 285 | + $lang = $this->getLanguage(); |
| 286 | + $userlang = $lang->getHtmlCode(); |
| 287 | + $userdir = $lang->getDir(); |
288 | 288 | |
289 | 289 | $tpl->set( 'lang', $userlang ); |
290 | 290 | $tpl->set( 'dir', $userdir ); |
291 | | - $tpl->set( 'rtl', $this->getLanguage()->isRTL() ); |
| 291 | + $tpl->set( 'rtl', $lang->isRTL() ); |
292 | 292 | |
293 | | - $tpl->set( 'capitalizeallnouns', $this->getLanguage()->capitalizeAllNouns() ? ' capitalize-all-nouns' : '' ); |
| 293 | + $tpl->set( 'capitalizeallnouns', $lang->capitalizeAllNouns() ? ' capitalize-all-nouns' : '' ); |
294 | 294 | $tpl->set( 'showjumplinks', $user->getOption( 'showjumplinks' ) ); |
295 | | - $tpl->set( 'username', $user->isAnon() ? null : $this->username ); |
296 | | - $tpl->set( 'userdisplayname', $user->isAnon() ? null : $this->userdisplayname ); |
| 295 | + $tpl->set( 'username', $this->loggedin ? $this->username : null ); |
| 296 | + $tpl->set( 'userdisplayname', $this->loggedin ? $this->userdisplayname : null ); |
297 | 297 | $tpl->setRef( 'userpage', $this->userpage ); |
298 | 298 | $tpl->setRef( 'userpageurl', $this->userpageUrlDetails['href'] ); |
299 | 299 | $tpl->set( 'userlang', $userlang ); |
— | — | @@ -303,7 +303,7 @@ |
304 | 304 | $tpl->set( 'userlangattributes', '' ); |
305 | 305 | $tpl->set( 'specialpageattributes', '' ); # obsolete |
306 | 306 | |
307 | | - if ( $userlang !== $contentlang || $userdir !== $contentdir ) { |
| 307 | + if ( $userlang !== $wgContLang->getHtmlCode() || $userdir !== $wgContLang->getDir() ) { |
308 | 308 | $attrs = " lang='$userlang' dir='$userdir'"; |
309 | 309 | $tpl->set( 'userlangattributes', $attrs ); |
310 | 310 | } |
— | — | @@ -312,7 +312,6 @@ |
313 | 313 | |
314 | 314 | wfProfileIn( __METHOD__ . '-stuff3' ); |
315 | 315 | $tpl->set( 'newtalk', $this->getNewtalks() ); |
316 | | - $tpl->setRef( 'skin', $this ); |
317 | 316 | $tpl->set( 'logo', $this->logoText() ); |
318 | 317 | |
319 | 318 | $tpl->set( 'copyright', false ); |
— | — | @@ -400,7 +399,6 @@ |
401 | 400 | $tpl->set( 'debug', '' ); |
402 | 401 | } |
403 | 402 | |
404 | | - $tpl->set( 'reporttime', wfReportTime() ); |
405 | 403 | $tpl->set( 'sitenotice', $this->getSiteNotice() ); |
406 | 404 | $tpl->set( 'bottomscripts', $this->bottomScripts() ); |
407 | 405 | $tpl->set( 'printfooter', $this->printSource() ); |
— | — | @@ -467,6 +465,7 @@ |
468 | 466 | } |
469 | 467 | |
470 | 468 | $tpl->set( 'debughtml', $this->generateDebugHTML() ); |
| 469 | + $tpl->set( 'reporttime', wfReportTime() ); |
471 | 470 | |
472 | 471 | // original version by hansm |
473 | 472 | if( !wfRunHooks( 'SkinTemplateOutputPageBeforeExec', array( &$this, &$tpl ) ) ) { |