r14420 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r14419‎ | r14420 | r14421 >
Date:08:23, 27 May 2006
Author:jeluf
Status:old
Tags:
Comment:
(bug5077) added BeforePageDisplay hook
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -462,6 +462,10 @@
463463 to use this hook.
464464 $content_actions: The array of content actions
465465
 466+'BeforePageDisplay': Called just before outputting a page (all kinds of,
 467+ articles, special, history, preview, diff, edit, ...)
 468+ Can be used to set custom CSS/JS
 469+$out: OutputPage object
466470
467471 More hooks might be available but undocumented, you can execute
468472 ./maintenance/findhooks.php to find hidden one.
Index: trunk/phase3/includes/SkinTemplate.php
@@ -145,6 +145,10 @@
146146 $fname = 'SkinTemplate::outputPage';
147147 wfProfileIn( $fname );
148148
 149+ // Hook that allows last minute changes to the output page, e.g.
 150+ // adding of CSS or Javascript by extensions.
 151+ wfRunHooks( 'BeforePageDisplay', array( &$out ) );
 152+
149153 extract( $wgRequest->getValues( 'oldid', 'diff' ) );
150154
151155 wfProfileIn( "$fname-init" );
Index: trunk/phase3/RELEASE-NOTES
@@ -357,6 +357,7 @@
358358 = when making URLs for template parameters.
359359 * Markup anality: escape </ as <\/ in toolbar javascript for pure correctness
360360 under HTML-compatible browsers.
 361+* (bug 5077) Added hook 'BeforePageDisplay' to SkinTemplate::outputPage
361362
362363
363364 == Compatibility ==

Status & tagging log