Fix whitespace in Monobook output
authorAryeh Gregor <simetrical@users.mediawiki.org>
Thu, 11 Feb 2010 02:14:43 +0000 (02:14 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Thu, 11 Feb 2010 02:14:43 +0000 (02:14 +0000)
Lots of craziness here.  Mainly random or excessive indentation, and
missing newlines (the latter due to the fact that a newline after ?> is
dropped).  The HTML looks a lot prettier now.  There are still some
annoying bits like <ul > that could be fixed.

skins/MonoBook.php

index 2bb0dfa..8c67b31 100644 (file)
@@ -65,33 +65,36 @@ class MonoBookTemplate extends QuickTemplate {
                wfSuppressWarnings();
 
                $this->html( 'headelement' );
-?>     <div id="globalWrapper">
-               <div id="column-content">
-       <div id="content" <?php $this->html("specialpageattributes") ?>>
-               <a id="top"></a>
-               <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
-               <h1 id="firstHeading" class="firstHeading"><?php $this->html('title') ?></h1>
-               <div id="bodyContent">
-                       <h3 id="siteSub"><?php $this->msg('tagline') ?></h3>
-                       <div id="contentSub" <?php $this->html('userlangattributes')  ?>><?php $this->html('subtitle') ?></div>
-                       <?php if($this->data['undelete']) { ?><div id="contentSub2"><?php     $this->html('undelete') ?></div><?php } ?>
-                       <?php if($this->data['newtalk'] ) { ?><div class="usermessage"><?php $this->html('newtalk')  ?></div><?php } ?>
-                       <?php if($this->data['showjumplinks']) { ?><div id="jump-to-nav"><?php $this->msg('jumpto') ?> <a href="#column-one"><?php $this->msg('jumptonavigation') ?></a>, <a href="#searchInput"><?php $this->msg('jumptosearch') ?></a></div><?php } ?>
-                       <!-- start content -->
-                       <?php $this->html('bodytext') ?>
-                       <?php if($this->data['catlinks']) { $this->html('catlinks'); } ?>
-                       <!-- end content -->
-                       <?php if($this->data['dataAfterContent']) { $this->html ('dataAfterContent'); } ?>
-                       <div class="visualClear"></div>
-               </div>
+?><div id="globalWrapper">
+<div id="column-content"><div id="content" <?php $this->html("specialpageattributes") ?>>
+       <a id="top"></a>
+       <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
+
+       <h1 id="firstHeading" class="firstHeading"><?php $this->html('title') ?></h1>
+       <div id="bodyContent">
+               <h3 id="siteSub"><?php $this->msg('tagline') ?></h3>
+               <div id="contentSub" <?php $this->html('userlangattributes')  ?>><?php $this->html('subtitle') ?></div>
+<?php if($this->data['undelete']) { ?>
+               <div id="contentSub2"><?php $this->html('undelete') ?></div>
+<?php } ?><?php if($this->data['newtalk'] ) { ?>
+               <div class="usermessage"><?php $this->html('newtalk')  ?></div>
+<?php } ?><?php if($this->data['showjumplinks']) { ?>
+               <div id="jump-to-nav"><?php $this->msg('jumpto') ?> <a href="#column-one"><?php $this->msg('jumptonavigation') ?></a>, <a href="#searchInput"><?php $this->msg('jumptosearch') ?></a></div>
+<?php } ?>
+               <!-- start content -->
+<?php $this->html('bodytext') ?>
+               <?php if($this->data['catlinks']) { $this->html('catlinks'); } ?>
+               <!-- end content -->
+               <?php if($this->data['dataAfterContent']) { $this->html ('dataAfterContent'); } ?>
+               <div class="visualClear"></div>
        </div>
-               </div>
-               <div id="column-one" <?php $this->html('userlangattributes')  ?>>
+</div></div>
+<div id="column-one" <?php $this->html('userlangattributes')  ?>>
        <div id="p-cactions" class="portlet">
                <h5><?php $this->msg('views') ?></h5>
                <div class="pBody">
-                       <ul>
-       <?php           foreach($this->data['content_actions'] as $key => $tab) {
+                       <ul><?php
+                               foreach($this->data['content_actions'] as $key => $tab) {
                                        echo '
                                 <li id="' . Sanitizer::escapeId( "ca-$key" ) . '"';
                                        if( $tab['class'] ) {
@@ -112,6 +115,7 @@ class MonoBookTemplate extends QuickTemplate {
                                        }
                                        echo '>'.htmlspecialchars($tab['text']).'</a></li>';
                                } ?>
+
                        </ul>
                </div>
        </div>
@@ -153,16 +157,16 @@ class MonoBookTemplate extends QuickTemplate {
                        }
                }
 ?>
-               </div><!-- end of the left (by default at least) column -->
-                       <div class="visualClear"></div>
-                       <div id="footer" <?php $this->html('userlangattributes') ?>>
+</div><!-- end of the left (by default at least) column -->
+<div class="visualClear"></div>
+<div id="footer" <?php $this->html('userlangattributes') ?>>
 <?php
-               if($this->data['poweredbyico']) { ?>
-                               <div id="f-poweredbyico"><?php $this->html('poweredbyico') ?></div>
-<?php  }
-               if($this->data['copyrightico']) { ?>
-                               <div id="f-copyrightico"><?php $this->html('copyrightico') ?></div>
-<?php  }
+if($this->data['poweredbyico']) { ?>
+       <div id="f-poweredbyico"><?php $this->html('poweredbyico') ?></div>
+<?php }
+if($this->data['copyrightico']) { ?>
+       <div id="f-copyrightico"><?php $this->html('copyrightico') ?></div>
+<?php }
 
                // Generate additional footer links
                $footerlinks = array(
@@ -176,18 +180,18 @@ class MonoBookTemplate extends QuickTemplate {
                        }
                }
                if ( count( $validFooterLinks ) > 0 ) {
-?>                     <ul id="f-list">
+?>     <ul id="f-list">
 <?php
                        foreach( $validFooterLinks as $aLink ) {
                                if( isset( $this->data[$aLink] ) && $this->data[$aLink] ) {
-?>                                     <li id="<?php echo $aLink ?>"><?php $this->html($aLink) ?></li>
+?>                     <li id="<?php echo $aLink ?>"><?php $this->html($aLink) ?></li>
 <?php                  }
                        }
 ?>
-                       </ul>
+       </ul>
 <?php  }
 ?>
-               </div>
+</div>
 </div>
 <?php $this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?>
 <?php $this->html('reporttime') ?>