Convert the common bottomscripts, reporttime, and debug boilerplate into a printTrail...
authorDaniel Friesen <dantman@users.mediawiki.org>
Sat, 1 Jan 2011 16:41:45 +0000 (16:41 +0000)
committerDaniel Friesen <dantman@users.mediawiki.org>
Sat, 1 Jan 2011 16:41:45 +0000 (16:41 +0000)
Note that in vector this does move the fixalpha stuff above bottomscripts while it was after it before, theoretically though this shouldn't cause any trouble.

includes/SkinTemplate.php
skins/Modern.php
skins/MonoBook.php
skins/Vector.php

index 8b38500..dcbd44b 100644 (file)
@@ -1716,6 +1716,21 @@ abstract class BaseTemplate extends QuickTemplate {
                return $footericons;
        }
 
+       /**
+        * Output the basic end-page trail including bottomscripts, reporttime, and
+        * debug stuff. This should be called right before outputting the closing
+        * body and html tags.
+        */
+       function printTrail() { ?>
+<?php $this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?>
+<?php $this->html('reporttime') ?>
+<?php if ( $this->data['debug'] ): ?>
+<!-- Debug output:
+<?php $this->text( 'debug' ); ?>
+
+-->
+<?php endif;
+       }
 
 }
 
index 6cc4fc1..d54bc41 100644 (file)
@@ -189,13 +189,7 @@ class ModernTemplate extends MonoBookTemplate {
 ?>
        </div>
 
-       <?php $this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?>
-<?php $this->html('reporttime') ?>
-<?php if ( $this->data['debug'] ): ?>
-<!-- Debug output:
-<?php $this->text( 'debug' ); ?>
--->
-<?php endif; ?>
+       <?php $this->printTrail(); ?>
 </body></html>
 <?php
        wfRestoreWarnings();
index cfcce4b..ff8ee12 100644 (file)
@@ -181,15 +181,8 @@ class MonoBookTemplate extends BaseTemplate {
 ?>
 </div>
 </div>
-<?php $this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?>
-<?php $this->html('reporttime') ?>
-<?php if ( $this->data['debug'] ): ?>
-<!-- Debug output:
-<?php $this->text( 'debug' ); ?>
-
--->
-<?php endif;
-
+<?php
+               $this->printTrail();
                echo Html::closeElement( 'body' );
                echo Html::closeElement( 'html' );
                wfRestoreWarnings();
index f9f6b38..d2c77c0 100644 (file)
@@ -232,14 +232,10 @@ class VectorTemplate extends BaseTemplate {
                        <div style="clear:both"></div>
                </div>
                <!-- /footer -->
-               <?php $this->html( 'bottomscripts' ); /* JS call to runBodyOnloadHook */ ?>
                <!-- fixalpha -->
                <script type="<?php $this->text('jsmimetype') ?>"> if ( window.isMSIE55 ) fixalpha(); </script>
                <!-- /fixalpha -->
-               <?php $this->html( 'reporttime' ) ?>
-               <?php if ( $this->data['debug'] ): ?>
-               <!-- Debug output: <?php $this->text( 'debug' ); ?> -->
-               <?php endif; ?>
+               <?php $this->printTrail(); ?>
        </body>
 </html>
 <?php