* @param $out OutputPage
*/
function outputPage( OutputPage $out ) {
- global $wgArticle, $wgUser, $wgLang, $wgContLang;
+ global $wgUser, $wgLang, $wgContLang;
global $wgScript, $wgStylePath, $wgLanguageCode;
global $wgMimeType, $wgJsMimeType, $wgOutputEncoding, $wgRequest;
global $wgXhtmlDefaultNamespace, $wgXhtmlNamespaces, $wgHtml5Version;
$tpl->setRef( 'usercss', $this->usercss );
$this->userjs = $this->userjsprev = false;
+ # FIXME: this is the only use of OutputPage::isUserJsAllowed() anywhere; can we
+ # get rid of it? For that matter, why is any of this here at all?
$this->setupUserJs( $out->isUserJsAllowed() );
$tpl->setRef( 'userjs', $this->userjs );
$tpl->setRef( 'userjsprev', $this->userjsprev );
if( $wgMaxCredits != 0 ){
$this->credits = Credits::getCredits( $article, $wgMaxCredits, $wgShowCreditsIfMax );
} else {
- $tpl->set( 'lastmod', $this->lastModified() );
+ $tpl->set( 'lastmod', $this->lastModified( $article ) );
}
$tpl->setRef( 'credits', $this->credits );
wfProfileIn( __METHOD__ . '-stuff5' );
# Personal toolbar
- $tpl->set( 'personal_urls', $this->buildPersonalUrls() );
- $content_navigation = $this->buildContentNavigationUrls();
+ $tpl->set( 'personal_urls', $this->buildPersonalUrls( $out ) );
+ $content_navigation = $this->buildContentNavigationUrls( $out );
$content_actions = $this->buildContentActionUrls( $content_navigation );
$tpl->setRef( 'content_navigation', $content_navigation );
$tpl->setRef( 'content_actions', $content_actions );
$tpl->set( 'sidebar', $this->buildSidebar() );
- $tpl->set( 'nav_urls', $this->buildNavUrls() );
+ $tpl->set( 'nav_urls', $this->buildNavUrls( $out ) );
// Set the head scripts near the end, in case the above actions resulted in added scripts
if ( $this->useHeadElement ) {
/**
* build array of urls for personal toolbar
* @return array
- * @private
*/
- function buildPersonalUrls() {
- global $wgOut, $wgRequest;
+ protected function buildPersonalUrls( OutputPage $out ) {
+ global $wgRequest;
- $title = $wgOut->getTitle();
+ $title = $out->getTitle();
$pageurl = $title->getLocalURL();
wfProfileIn( __METHOD__ );
* believes that the accesskey should not be added to the tab.
*
* @return array
- * @private
*/
- function buildContentNavigationUrls() {
- global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest;
+ protected function buildContentNavigationUrls( OutputPage $out ) {
+ global $wgContLang, $wgLang, $wgUser, $wgRequest;
global $wgDisableLangConversion;
wfProfileIn( __METHOD__ );
);
// Checks if this is a current rev of talk page and we should show a new
// section link
- if ( ( $isTalk && $this->isRevisionCurrent() ) || ( $wgOut->showNewSectionLink() ) ) {
+ if ( ( $isTalk && $this->isRevisionCurrent() ) || ( $out->showNewSectionLink() ) ) {
// Checks if we should ever show a new section link
- if ( !$wgOut->forceHideNewSectionLink() ) {
+ if ( !$out->forceHideNewSectionLink() ) {
// Adds new section link
//$content_navigation['actions']['addsection']
$content_navigation['views']['addsection'] = array(
* @return array
* @private
*/
- function buildNavUrls() {
- global $wgUseTrackbacks, $wgOut, $wgUser, $wgRequest;
+ protected function buildNavUrls( OutputPage $out ) {
+ global $wgUseTrackbacks, $wgUser, $wgRequest;
global $wgUploadNavigationUrl;
wfProfileIn( __METHOD__ );
// A print stylesheet is attached to all pages, but nobody ever
// figures that out. :) Add a link...
if( $this->iscontent && ( $action == 'view' || $action == 'purge' ) ) {
- if ( !$wgOut->isPrintable() ) {
+ if ( !$out->isPrintable() ) {
$nav_urls['print'] = array(
'text' => wfMsg( 'printableversion' ),
'href' => $wgRequest->appendQuery( 'printable=yes' )
if ( $this->mRevisionId ) {
$nav_urls['permalink'] = array(
'text' => wfMsg( 'permalink' ),
- 'href' => $wgOut->getTitle()->getLocalURL( "oldid=$this->mRevisionId" )
+ 'href' => $out->getTitle()->getLocalURL( "oldid=$this->mRevisionId" )
);
}
}
if( $wgUseTrackbacks )
$nav_urls['trackbacklink'] = array(
- 'href' => $wgOut->getTitle()->trackbackURL()
+ 'href' => $out->getTitle()->trackbackURL()
);
}
/**
* @private
+ * FIXME: why is this duplicated in/from OutputPage::getHeadScripts()??
*/
function setupUserJs( $allowUserJs ) {
global $wgRequest, $wgJsMimeType;
}
}
} elseif ( $option == 'nocopyright' ) {
- $footericons = $this->data['footericons'];
unset( $footericons['copyright']['copyright'] );
if ( count( $footericons['copyright'] ) <= 0 ) {
unset( $footericons['copyright'] );