Followup r87340: Post-hook swap bodytext into a new bodycontent key and append printf...
authorDaniel Friesen <dantman@users.mediawiki.org>
Sun, 4 Sep 2011 12:38:04 +0000 (12:38 +0000)
committerDaniel Friesen <dantman@users.mediawiki.org>
Sun, 4 Sep 2011 12:38:04 +0000 (12:38 +0000)
includes/SkinLegacy.php
includes/SkinTemplate.php
skins/Modern.php
skins/MonoBook.php
skins/Vector.php

index 6fbb465..f8ff1e3 100644 (file)
@@ -74,10 +74,6 @@ class LegacyTemplate extends BaseTemplate {
                $this->html( 'headelement' );
                echo $this->beforeContent();
                $this->html( 'bodytext' );
-               echo '<div class="printfooter">';
-               $this->html( 'printfooter' );
-               echo '</div>';
-               $this->html( 'debughtml' );
                echo "\n";
                echo $this->afterContent();
                $this->html( 'dataAfterContent' );
index 4bc77d3..f66eddf 100644 (file)
@@ -483,6 +483,15 @@ class SkinTemplate extends Skin {
                        wfDebug( __METHOD__ . ": Hook SkinTemplateOutputPageBeforeExec broke outputPage execution!\n" );
                }
 
+               // Set the bodytext to another key so that skins can just output it on it's own
+               // and output printfooter and debughtml separately
+               $tpl->set( 'bodycontent', $tpl->data['bodytext'] );
+
+               // Append printfooter and debughtml onto bodytext so that skins that were already
+               // using bodytext before they were split out don't suddenly start not outputting information
+               $tpl->data['bodytext'] .= Html::element( 'div', array( 'class' => 'printfooter' ), "\n{$tpl->data['printfooter']}" ) . "\n";
+               $tpl->data['bodytext'] .= $tpl->data['debughtml'];
+
                // allow extensions adding stuff after the page content.
                // See Skin::afterContentHook() for further documentation.
                $tpl->set( 'dataAfterContent', $this->afterContentHook() );
index 02e3b0a..151fece 100644 (file)
@@ -88,8 +88,6 @@ class ModernTemplate extends MonoBookTemplate {
                <?php if($this->data['showjumplinks']) { ?><div id="jump-to-nav"><?php $this->msg('jumpto') ?> <a href="#mw_portlets"><?php $this->msg('jumptonavigation') ?></a>, <a href="#searchInput"><?php $this->msg('jumptosearch') ?></a></div><?php } ?>
 
                <?php $this->html('bodytext') ?>
-               <?php if($this->data['printfooter']) { ?><div class="printfooter"><?php $this->html('printfooter'); ?></div><?php } ?>
-               <?php $this->html('debughtml'); ?>
                <div class='mw_clear'></div>
                <?php if($this->data['catlinks']) { $this->html('catlinks'); } ?>
                <?php $this->html ('dataAfterContent') ?>
index 4712275..c696418 100644 (file)
@@ -91,8 +91,6 @@ class MonoBookTemplate extends BaseTemplate {
 <?php } ?>
                <!-- start content -->
 <?php $this->html('bodytext') ?>
-               <?php if($this->data['printfooter']) { ?><div class="printfooter"><?php $this->html('printfooter'); ?></div><?php } ?>
-               <?php $this->html('debughtml'); ?>
                <?php if($this->data['catlinks']) { $this->html('catlinks'); } ?>
                <!-- end content -->
                <?php if($this->data['dataAfterContent']) { $this->html ('dataAfterContent'); } ?>
index be4638d..a57d2cd 100644 (file)
@@ -174,9 +174,9 @@ class VectorTemplate extends BaseTemplate {
                                </div>
                                <!-- /jumpto -->
                                <?php endif; ?>
-                               <!-- bodytext -->
-                               <?php $this->html( 'bodytext' ) ?>
-                               <!-- /bodytext -->
+                               <!-- bodycontent -->
+                               <?php $this->html( 'bodycontent' ) ?>
+                               <!-- /bodycontent -->
                                <?php if ( $this->data['printfooter'] ): ?>
                                <!-- printfooter -->
                                <div class="printfooter">