* Added SkinTemplateOutputPageBeforeExec hook before SkinTemplate::outputPage()
authorLeon Weber <leon@users.mediawiki.org>
Wed, 10 Jan 2007 15:23:32 +0000 (15:23 +0000)
committerLeon Weber <leon@users.mediawiki.org>
Wed, 10 Jan 2007 15:23:32 +0000 (15:23 +0000)
  starts page output (http://lists.wikimedia.org/pipermail/wikitech-l/2007-January/028554.html)

RELEASE-NOTES
docs/hooks.txt
includes/SkinTemplate.php

index 0f9d2fa..3260274 100644 (file)
@@ -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 ==
 
index d5a1766..fdae500 100644 (file)
@@ -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
index ff09547..4043aa0 100644 (file)
@@ -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();