r79427 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79426‎ | r79427 | r79428 >
Date:16:41, 1 January 2011
Author:dantman
Status:ok
Tags:
Comment:
Convert the common bottomscripts, reporttime, and debug boilerplate into a printTrail() helper method.
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.
Modified paths:
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)
  • /trunk/phase3/skins/Modern.php (modified) (history)
  • /trunk/phase3/skins/MonoBook.php (modified) (history)
  • /trunk/phase3/skins/Vector.php (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/Vector.php
@@ -232,14 +232,10 @@
233233 <div style="clear:both"></div>
234234 </div>
235235 <!-- /footer -->
236 - <?php $this->html( 'bottomscripts' ); /* JS call to runBodyOnloadHook */ ?>
237236 <!-- fixalpha -->
238237 <script type="<?php $this->text('jsmimetype') ?>"> if ( window.isMSIE55 ) fixalpha(); </script>
239238 <!-- /fixalpha -->
240 - <?php $this->html( 'reporttime' ) ?>
241 - <?php if ( $this->data['debug'] ): ?>
242 - <!-- Debug output: <?php $this->text( 'debug' ); ?> -->
243 - <?php endif; ?>
 239+ <?php $this->printTrail(); ?>
244240 </body>
245241 </html>
246242 <?php
Index: trunk/phase3/skins/MonoBook.php
@@ -181,15 +181,8 @@
182182 ?>
183183 </div>
184184 </div>
185 -<?php $this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?>
186 -<?php $this->html('reporttime') ?>
187 -<?php if ( $this->data['debug'] ): ?>
188 -<!-- Debug output:
189 -<?php $this->text( 'debug' ); ?>
190 -
191 -<?php endif;
192 -
 185+<?php
 186+ $this->printTrail();
193187 echo Html::closeElement( 'body' );
194188 echo Html::closeElement( 'html' );
195189 wfRestoreWarnings();
Index: trunk/phase3/skins/Modern.php
@@ -189,13 +189,7 @@
190190 ?>
191191 </div>
192192
193 - <?php $this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?>
194 -<?php $this->html('reporttime') ?>
195 -<?php if ( $this->data['debug'] ): ?>
196 -<!-- Debug output:
197 -<?php $this->text( 'debug' ); ?>
198 -<?php endif; ?>
 193+ <?php $this->printTrail(); ?>
199194 </body></html>
200195 <?php
201196 wfRestoreWarnings();
Index: trunk/phase3/includes/SkinTemplate.php
@@ -1716,6 +1716,21 @@
17171717 return $footericons;
17181718 }
17191719
 1720+ /**
 1721+ * Output the basic end-page trail including bottomscripts, reporttime, and
 1722+ * debug stuff. This should be called right before outputting the closing
 1723+ * body and html tags.
 1724+ */
 1725+ function printTrail() { ?>
 1726+<?php $this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?>
 1727+<?php $this->html('reporttime') ?>
 1728+<?php if ( $this->data['debug'] ): ?>
 1729+<!-- Debug output:
 1730+<?php $this->text( 'debug' ); ?>
17201731
 1732+-->
 1733+<?php endif;
 1734+ }
 1735+
17211736 }
17221737

Status & tagging log