From 52fe58784a1e308800f0a338b6c25d37e4eff06b Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Tue, 3 May 2011 17:23:17 +0000 Subject: [PATCH] Moved "printfooter" and debug HTML away from "bodytext" so that they can be easily modified by extensions with the SkinTemplateOutputPageBeforeExec hook; always moved generation of debug HTML just before executing the hook so that it includes more items --- includes/SkinLegacy.php | 4 ++++ includes/SkinTemplate.php | 6 +++--- skins/Modern.php | 2 ++ skins/MonoBook.php | 2 ++ skins/Vector.php | 10 ++++++++++ 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/includes/SkinLegacy.php b/includes/SkinLegacy.php index 6c421ef0d7..fc82834381 100644 --- a/includes/SkinLegacy.php +++ b/includes/SkinLegacy.php @@ -68,6 +68,10 @@ class LegacyTemplate extends BaseTemplate { $this->html( 'headelement' ); echo $this->beforeContent(); $this->html( 'bodytext' ); + echo '
'; + $this->html( 'printfooter' ); + echo '
'; + $this->html( 'debughtml' ); echo "\n"; echo $this->afterContent(); $this->html( 'dataAfterContent' ); diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index c346055d35..bc86944846 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -452,15 +452,13 @@ class SkinTemplate extends Skin { $tpl->set( 'reporttime', wfReportTime() ); $tpl->set( 'sitenotice', $this->getSiteNotice() ); $tpl->set( 'bottomscripts', $this->bottomScripts( $out ) ); + $tpl->set( 'printfooter', $this->printSource() ); - // @todo Give printfooter userlangattributes - $printfooter = "
\n" . $this->printSource() . "
\n"; global $wgBetterDirectionality; if ( $wgBetterDirectionality ) { $realBodyAttribs = array( 'lang' => $wgLanguageCode, 'dir' => $wgContLang->getDir() ); $out->mBodytext = Html::rawElement( 'div', $realBodyAttribs, $out->mBodytext ); } - $out->mBodytext .= $printfooter . $this->generateDebugHTML( $out ); $tpl->setRef( 'bodytext', $out->mBodytext ); # Language links @@ -508,6 +506,8 @@ class SkinTemplate extends Skin { $tpl->set( 'headscripts', $out->getScript() ); } + $tpl->set( 'debughtml', $this->generateDebugHTML( $out ) ); + // original version by hansm if( !wfRunHooks( 'SkinTemplateOutputPageBeforeExec', array( &$this, &$tpl ) ) ) { wfDebug( __METHOD__ . ": Hook SkinTemplateOutputPageBeforeExec broke outputPage execution!\n" ); diff --git a/skins/Modern.php b/skins/Modern.php index 3998046690..47882c1452 100644 --- a/skins/Modern.php +++ b/skins/Modern.php @@ -85,6 +85,8 @@ class ModernTemplate extends MonoBookTemplate { data['showjumplinks']) { ?>
msg('jumpto') ?> msg('jumptonavigation') ?>, msg('jumptosearch') ?>
html('bodytext') ?> + data['printfooter']) { ?>
html('printfooter'); ?>
+ html('debughtml'); ?>
data['catlinks']) { $this->html('catlinks'); } ?> html ('dataAfterContent') ?> diff --git a/skins/MonoBook.php b/skins/MonoBook.php index 20067a969e..6acce0fe03 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -91,6 +91,8 @@ class MonoBookTemplate extends BaseTemplate { html('bodytext') ?> + data['printfooter']) { ?>
html('printfooter'); ?>
+ html('debughtml'); ?> data['catlinks']) { $this->html('catlinks'); } ?> data['dataAfterContent']) { $this->html ('dataAfterContent'); } ?> diff --git a/skins/Vector.php b/skins/Vector.php index 2b1ae43903..3589a95501 100644 --- a/skins/Vector.php +++ b/skins/Vector.php @@ -177,6 +177,16 @@ class VectorTemplate extends BaseTemplate { html( 'bodytext' ) ?> + data['printfooter'] ): ?> + +
+ html( 'printfooter' ); ?> +
+ + + + html('debughtml'); ?> + data['catlinks'] ): ?> html( 'catlinks' ); ?> -- 2.20.1