From 0b5f651045562ab5342d5aedf6b3d6a290ae3677 Mon Sep 17 00:00:00 2001 From: Leon Weber Date: Wed, 10 Jan 2007 15:23:32 +0000 Subject: [PATCH] * Added SkinTemplateOutputPageBeforeExec hook before SkinTemplate::outputPage() starts page output (http://lists.wikimedia.org/pipermail/wikitech-l/2007-January/028554.html) --- RELEASE-NOTES | 2 ++ docs/hooks.txt | 4 ++++ includes/SkinTemplate.php | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 0f9d2facb2..3260274f9f 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -35,6 +35,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Made the PLURAL: parser function return singular on -1 per default. * Fixed up the AjaxSearch * (bugs 5051, 5376) Tooltips and accesskeys no longer require JavaScript +* Added SkinTemplateOutputPageBeforeExec hook before SkinTemplate::outputPage() + starts page output (http://lists.wikimedia.org/pipermail/wikitech-l/2007-January/028554.html) == Languages updated == diff --git a/docs/hooks.txt b/docs/hooks.txt index d5a1766035..fdae500097 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -436,6 +436,10 @@ or change the value of $siteNotice and return false to alter it. &$siteNotice: HTML sitenotice Alter the contents of $siteNotice to add to/alter the sitenotice/anonnotice. +'SkinTemplateOutputPageBeforeExec': Before SkinTemplate::outputPage() starts page output +&$sktemplate: SkinTemplate object +&$tpl: Template engine object + 'TitleMoveComplete': after moving an article (title) $old: old title $nt: new title diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index ff095477f7..4043aa0606 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -458,6 +458,11 @@ class SkinTemplate extends Skin { $tpl->set( 'sidebar', $this->buildSidebar() ); $tpl->set( 'nav_urls', $this->buildNavUrls() ); + // original version by hansm + if( !wfRunHooks( 'SkinTemplateOutputPageBeforeExec', array( &$this, &$tpl ) ) ) { + wfDebug( __METHOD__ . ': Hook SkinTemplateOutputPageBeforeExec broke outputPage execution!' ); + } + // execute template wfProfileIn( "$fname-execute" ); $res = $tpl->execute(); -- 2.20.1