Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -462,6 +462,10 @@ |
463 | 463 | to use this hook. |
464 | 464 | $content_actions: The array of content actions |
465 | 465 | |
| 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 |
466 | 470 | |
467 | 471 | More hooks might be available but undocumented, you can execute |
468 | 472 | ./maintenance/findhooks.php to find hidden one. |
Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -145,6 +145,10 @@ |
146 | 146 | $fname = 'SkinTemplate::outputPage'; |
147 | 147 | wfProfileIn( $fname ); |
148 | 148 | |
| 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 | + |
149 | 153 | extract( $wgRequest->getValues( 'oldid', 'diff' ) ); |
150 | 154 | |
151 | 155 | wfProfileIn( "$fname-init" ); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -357,6 +357,7 @@ |
358 | 358 | = when making URLs for template parameters. |
359 | 359 | * Markup anality: escape </ as <\/ in toolbar javascript for pure correctness |
360 | 360 | under HTML-compatible browsers. |
| 361 | +* (bug 5077) Added hook 'BeforePageDisplay' to SkinTemplate::outputPage |
361 | 362 | |
362 | 363 | |
363 | 364 | == Compatibility == |