'lang' => $ilInterwikiCodeBCP47,
'hreflang' => $ilInterwikiCodeBCP47,
);
- wfRunHooks(
+ Hooks::run(
'SkinTemplateGetLanguageLink',
array( &$languageLink, $languageLinkTitle, $this->getTitle(), $this->getOutput() )
);
}
protected function setupTemplateForOutput() {
- wfProfileIn( __METHOD__ );
$request = $this->getRequest();
$user = $this->getUser();
$title = $this->getTitle();
- wfProfileIn( __METHOD__ . '-init' );
$tpl = $this->setupTemplate( $this->template, 'skins' );
- wfProfileOut( __METHOD__ . '-init' );
- wfProfileIn( __METHOD__ . '-stuff' );
$this->thispage = $title->getPrefixedDBkey();
$this->titletxt = $title->getPrefixedText();
$this->userpage = $user->getUserPage()->getPrefixedText();
$this->userpageUrlDetails = self::makeKnownUrlDetails( $this->userpage );
}
- wfProfileOut( __METHOD__ . '-stuff' );
- wfProfileOut( __METHOD__ );
return $tpl;
}
* @param OutputPage $out
*/
function outputPage( OutputPage $out = null ) {
- wfProfileIn( __METHOD__ );
Profiler::instance()->setTemplated( true );
$oldContext = null;
if ( $out !== null ) {
- // @todo Add wfDeprecated in 1.20
+ // Deprecated since 1.20, note added in 1.25
+ wfDeprecated( __METHOD__, '1.25' );
$oldContext = $this->getContext();
$this->setContext( $out->getContext() );
}
$out = $this->getOutput();
- wfProfileIn( __METHOD__ . '-init' );
$this->initPage( $out );
- wfProfileOut( __METHOD__ . '-init' );
$tpl = $this->prepareQuickTemplate( $out );
// execute template
- wfProfileIn( __METHOD__ . '-execute' );
$res = $tpl->execute();
- wfProfileOut( __METHOD__ . '-execute' );
// result may be an error
$this->printOrError( $res );
$this->setContext( $oldContext );
}
- wfProfileOut( __METHOD__ );
}
/**
$wgShowCreditsIfMax, $wgArticlePath,
$wgScriptPath, $wgServer;
- wfProfileIn( __METHOD__ );
$title = $this->getTitle();
$request = $this->getRequest();
$out = $this->getOutput();
$tpl = $this->setupTemplateForOutput();
- wfProfileIn( __METHOD__ . '-stuff2' );
$tpl->set( 'title', $out->getPageTitle() );
$tpl->set( 'pagetitle', $out->getHTMLTitle() );
$tpl->set( 'displaytitle', $out->mPageLinkTitle );
$tpl->set( 'userlangattributes', $attrs );
}
- wfProfileOut( __METHOD__ . '-stuff2' );
- wfProfileIn( __METHOD__ . '-stuff3' );
$tpl->set( 'newtalk', $this->getNewtalks() );
$tpl->set( 'logo', $this->logoText() );
}
$tpl->set( 'copyright', $this->getCopyright() );
}
- wfProfileOut( __METHOD__ . '-stuff3' );
- wfProfileIn( __METHOD__ . '-stuff4' );
$tpl->set( 'copyrightico', $this->getCopyrightIcon() );
$tpl->set( 'poweredbyico', $this->getPoweredBy() );
$tpl->set( 'disclaimer', $this->disclaimerLink() );
} else {
$tpl->set( 'language_urls', false );
}
- wfProfileOut( __METHOD__ . '-stuff4' );
- wfProfileIn( __METHOD__ . '-stuff5' );
# Personal toolbar
$tpl->set( 'personal_urls', $this->buildPersonalUrls() );
$content_navigation = $this->buildContentNavigationUrls();
$tpl->set( 'reporttime', wfReportTime() );
// original version by hansm
- if ( !wfRunHooks( 'SkinTemplateOutputPageBeforeExec', array( &$this, &$tpl ) ) ) {
+ if ( !Hooks::run( 'SkinTemplateOutputPageBeforeExec', array( &$this, &$tpl ) ) ) {
wfDebug( __METHOD__ . ": Hook SkinTemplateOutputPageBeforeExec broke outputPage execution!\n" );
}
- // Set the bodytext to another key so that skins can just output it on it's own
+ // Set the bodytext to another key so that skins can just output it on its own
// and output printfooter and debughtml separately
$tpl->set( 'bodycontent', $tpl->data['bodytext'] );
// allow extensions adding stuff after the page content.
// See Skin::afterContentHook() for further documentation.
$tpl->set( 'dataAfterContent', $this->afterContentHook() );
- wfProfileOut( __METHOD__ . '-stuff5' );
- wfProfileOut( __METHOD__ );
return $tpl;
}
$title = $this->getTitle();
$request = $this->getRequest();
$pageurl = $title->getLocalURL();
- wfProfileIn( __METHOD__ );
/* set up the default links for the personal toolbar */
$personal_urls = array();
$personal_urls['login'] = $login_url;
}
- wfRunHooks( 'PersonalUrls', array( &$personal_urls, &$title, $this ) );
- wfProfileOut( __METHOD__ );
+ Hooks::run( 'PersonalUrls', array( &$personal_urls, &$title, $this ) );
return $personal_urls;
}
}
$result = array();
- if ( !wfRunHooks( 'SkinTemplateTabAction', array( &$this,
+ if ( !Hooks::run( 'SkinTemplateTabAction', array( &$this,
$title, $message, $selected, $checkEdit,
&$classes, &$query, &$text, &$result ) ) ) {
return $result;
protected function buildContentNavigationUrls() {
global $wgDisableLangConversion;
- wfProfileIn( __METHOD__ );
// Display tabs for the relevant title rather than always the title itself
$title = $this->getRelevantTitle();
$userCanRead = $title->quickUserCan( 'read', $user );
$preventActiveTabs = false;
- wfRunHooks( 'SkinTemplatePreventOtherActiveTabs', array( &$this, &$preventActiveTabs ) );
+ Hooks::run( 'SkinTemplatePreventOtherActiveTabs', array( &$this, &$preventActiveTabs ) );
// Checks if page is some kind of content
if ( $title->canExist() ) {
);
}
- wfProfileIn( __METHOD__ . '-edit' );
// Checks if user can edit the current page if it exists or create it otherwise
if ( $title->quickUserCan( 'edit', $user )
'primary' => true, // don't collapse this in vector
);
}
- wfProfileOut( __METHOD__ . '-edit' );
- wfProfileIn( __METHOD__ . '-live' );
// Checks if the page exists
if ( $title->exists() ) {
// Adds history view link
if ( $user->isAllowed( 'deletedhistory' ) ) {
$n = $title->isDeleted();
if ( $n ) {
- $undelTitle = SpecialPage::getTitleFor( 'Undelete' );
+ $undelTitle = SpecialPage::getTitleFor( 'Undelete', $title->getPrefixedDBkey() );
// If the user can't undelete but can view deleted
// history show them a "View .. deleted" tab instead.
$msgKey = $user->isAllowed( 'undelete' ) ? 'undelete' : 'viewdeleted';
'class' => $this->getTitle()->isSpecial( 'Undelete' ) ? 'selected' : false,
'text' => wfMessageFallback( "$skname-action-$msgKey", "{$msgKey}_short" )
->setContext( $this->getContext() )->numParams( $n )->text(),
- 'href' => $undelTitle->getLocalURL( array( 'target' => $title->getPrefixedDBkey() ) )
+ 'href' => $undelTitle->getLocalURL()
);
}
}
);
}
- wfProfileOut( __METHOD__ . '-live' );
// Checks if the user is logged in
if ( $this->loggedin && $user->isAllowedAll( 'viewmywatchlist', 'editmywatchlist' ) ) {
}
}
- wfRunHooks( 'SkinTemplateNavigation', array( &$this, &$content_navigation ) );
+ Hooks::run( 'SkinTemplateNavigation', array( &$this, &$content_navigation ) );
if ( $userCanRead && !$wgDisableLangConversion ) {
$pageLang = $title->getPageLanguage();
'context' => 'subject'
);
- wfRunHooks( 'SkinTemplateNavigation::SpecialPage',
+ Hooks::run( 'SkinTemplateNavigation::SpecialPage',
array( &$this, &$content_navigation ) );
}
// Equiv to SkinTemplateContentActions
- wfRunHooks( 'SkinTemplateNavigation::Universal', array( &$this, &$content_navigation ) );
+ Hooks::run( 'SkinTemplateNavigation::Universal', array( &$this, &$content_navigation ) );
// Setup xml ids and tooltip info
foreach ( $content_navigation as $section => &$links ) {
}
}
- wfProfileOut( __METHOD__ );
return $content_navigation;
}
*/
private function buildContentActionUrls( $content_navigation ) {
- wfProfileIn( __METHOD__ );
// content_actions has been replaced with content_navigation for backwards
// compatibility and also for skins that just want simple tabs content_actions
}
}
- wfProfileOut( __METHOD__ );
return $content_actions;
}
protected function buildNavUrls() {
global $wgUploadNavigationUrl;
- wfProfileIn( __METHOD__ );
$out = $this->getOutput();
$request = $this->getRequest();
}
// Use the copy of revision ID in case this undocumented, shady hook tries to mess with internals
- wfRunHooks( 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink',
+ Hooks::run( 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink',
array( &$this, &$nav_urls, &$revid, &$revid ) );
}
}
}
- wfProfileOut( __METHOD__ );
return $nav_urls;
}