Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -496,14 +496,14 @@ |
497 | 497 | |
498 | 498 | wfProfileIn( __METHOD__ . '-stuff5' ); |
499 | 499 | # Personal toolbar |
500 | | - $tpl->set( 'personal_urls', $this->buildPersonalUrls() ); |
501 | | - $content_navigation = $this->buildContentNavigationUrls(); |
| 500 | + $tpl->set( 'personal_urls', $this->buildPersonalUrls( $out ) ); |
| 501 | + $content_navigation = $this->buildContentNavigationUrls( $out ); |
502 | 502 | $content_actions = $this->buildContentActionUrls( $content_navigation ); |
503 | 503 | $tpl->setRef( 'content_navigation', $content_navigation ); |
504 | 504 | $tpl->setRef( 'content_actions', $content_actions ); |
505 | 505 | |
506 | 506 | $tpl->set( 'sidebar', $this->buildSidebar() ); |
507 | | - $tpl->set( 'nav_urls', $this->buildNavUrls() ); |
| 507 | + $tpl->set( 'nav_urls', $this->buildNavUrls( $out ) ); |
508 | 508 | |
509 | 509 | // Set the head scripts near the end, in case the above actions resulted in added scripts |
510 | 510 | if ( $this->useHeadElement ) { |
— | — | @@ -560,12 +560,11 @@ |
561 | 561 | /** |
562 | 562 | * build array of urls for personal toolbar |
563 | 563 | * @return array |
564 | | - * @private |
565 | 564 | */ |
566 | | - function buildPersonalUrls() { |
567 | | - global $wgOut, $wgRequest; |
| 565 | + protected function buildPersonalUrls( OutputPage $out ) { |
| 566 | + global $wgRequest; |
568 | 567 | |
569 | | - $title = $wgOut->getTitle(); |
| 568 | + $title = $out->getTitle(); |
570 | 569 | $pageurl = $title->getLocalURL(); |
571 | 570 | wfProfileIn( __METHOD__ ); |
572 | 571 | |
— | — | @@ -791,10 +790,9 @@ |
792 | 791 | * believes that the accesskey should not be added to the tab. |
793 | 792 | * |
794 | 793 | * @return array |
795 | | - * @private |
796 | 794 | */ |
797 | | - function buildContentNavigationUrls() { |
798 | | - global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest; |
| 795 | + protected function buildContentNavigationUrls( OutputPage $out ) { |
| 796 | + global $wgContLang, $wgLang, $wgUser, $wgRequest; |
799 | 797 | global $wgDisableLangConversion; |
800 | 798 | |
801 | 799 | wfProfileIn( __METHOD__ ); |
— | — | @@ -893,9 +891,9 @@ |
894 | 892 | ); |
895 | 893 | // Checks if this is a current rev of talk page and we should show a new |
896 | 894 | // section link |
897 | | - if ( ( $isTalk && $this->isRevisionCurrent() ) || ( $wgOut->showNewSectionLink() ) ) { |
| 895 | + if ( ( $isTalk && $this->isRevisionCurrent() ) || ( $out->showNewSectionLink() ) ) { |
898 | 896 | // Checks if we should ever show a new section link |
899 | | - if ( !$wgOut->forceHideNewSectionLink() ) { |
| 897 | + if ( !$out->forceHideNewSectionLink() ) { |
900 | 898 | // Adds new section link |
901 | 899 | //$content_navigation['actions']['addsection'] |
902 | 900 | $content_navigation['views']['addsection'] = array( |
— | — | @@ -1133,8 +1131,8 @@ |
1134 | 1132 | * @return array |
1135 | 1133 | * @private |
1136 | 1134 | */ |
1137 | | - function buildNavUrls() { |
1138 | | - global $wgUseTrackbacks, $wgOut, $wgUser, $wgRequest; |
| 1135 | + protected function buildNavUrls( OutputPage $out ) { |
| 1136 | + global $wgUseTrackbacks, $wgUser, $wgRequest; |
1139 | 1137 | global $wgUploadNavigationUrl; |
1140 | 1138 | |
1141 | 1139 | wfProfileIn( __METHOD__ ); |
— | — | @@ -1158,7 +1156,7 @@ |
1159 | 1157 | // A print stylesheet is attached to all pages, but nobody ever |
1160 | 1158 | // figures that out. :) Add a link... |
1161 | 1159 | if( $this->iscontent && ( $action == 'view' || $action == 'purge' ) ) { |
1162 | | - if ( !$wgOut->isPrintable() ) { |
| 1160 | + if ( !$out->isPrintable() ) { |
1163 | 1161 | $nav_urls['print'] = array( |
1164 | 1162 | 'text' => wfMsg( 'printableversion' ), |
1165 | 1163 | 'href' => $wgRequest->appendQuery( 'printable=yes' ) |
— | — | @@ -1169,13 +1167,13 @@ |
1170 | 1168 | if ( $this->mRevisionId ) { |
1171 | 1169 | $nav_urls['permalink'] = array( |
1172 | 1170 | 'text' => wfMsg( 'permalink' ), |
1173 | | - 'href' => $wgOut->getTitle()->getLocalURL( "oldid=$this->mRevisionId" ) |
| 1171 | + 'href' => $out->getTitle()->getLocalURL( "oldid=$this->mRevisionId" ) |
1174 | 1172 | ); |
1175 | 1173 | } |
1176 | 1174 | |
1177 | 1175 | // Copy in case this undocumented, shady hook tries to mess with internals |
1178 | 1176 | $revid = $this->mRevisionId; |
1179 | | - wfRunHooks( 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink', array( &$this, &$nav_urls, &$revid, &$revid ) ); |
| 1177 | + wfRunHooks( 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink', array( $this, &$nav_urls, &$revid, &$revid ) ); |
1180 | 1178 | } |
1181 | 1179 | |
1182 | 1180 | if( $this->mTitle->getNamespace() != NS_SPECIAL ) { |
— | — | @@ -1193,7 +1191,7 @@ |
1194 | 1192 | } |
1195 | 1193 | if( $wgUseTrackbacks ) |
1196 | 1194 | $nav_urls['trackbacklink'] = array( |
1197 | | - 'href' => $wgOut->getTitle()->trackbackURL() |
| 1195 | + 'href' => $out->getTitle()->trackbackURL() |
1198 | 1196 | ); |
1199 | 1197 | } |
1200 | 1198 | |