r62286 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62285‎ | r62286 | r62287 >
Date:02:14, 11 February 2010
Author:simetrical
Status:ok
Tags:
Comment:
Fix whitespace in Monobook output

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.
Modified paths:
  • /trunk/phase3/skins/MonoBook.php (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/MonoBook.php
@@ -65,33 +65,36 @@
6666 wfSuppressWarnings();
6767
6868 $this->html( 'headelement' );
69 -?> <div id="globalWrapper">
70 - <div id="column-content">
71 - <div id="content" <?php $this->html("specialpageattributes") ?>>
72 - <a id="top"></a>
73 - <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
74 - <h1 id="firstHeading" class="firstHeading"><?php $this->html('title') ?></h1>
75 - <div id="bodyContent">
76 - <h3 id="siteSub"><?php $this->msg('tagline') ?></h3>
77 - <div id="contentSub" <?php $this->html('userlangattributes') ?>><?php $this->html('subtitle') ?></div>
78 - <?php if($this->data['undelete']) { ?><div id="contentSub2"><?php $this->html('undelete') ?></div><?php } ?>
79 - <?php if($this->data['newtalk'] ) { ?><div class="usermessage"><?php $this->html('newtalk') ?></div><?php } ?>
80 - <?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 } ?>
81 - <!-- start content -->
82 - <?php $this->html('bodytext') ?>
83 - <?php if($this->data['catlinks']) { $this->html('catlinks'); } ?>
84 - <!-- end content -->
85 - <?php if($this->data['dataAfterContent']) { $this->html ('dataAfterContent'); } ?>
86 - <div class="visualClear"></div>
87 - </div>
 69+?><div id="globalWrapper">
 70+<div id="column-content"><div id="content" <?php $this->html("specialpageattributes") ?>>
 71+ <a id="top"></a>
 72+ <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
 73+
 74+ <h1 id="firstHeading" class="firstHeading"><?php $this->html('title') ?></h1>
 75+ <div id="bodyContent">
 76+ <h3 id="siteSub"><?php $this->msg('tagline') ?></h3>
 77+ <div id="contentSub" <?php $this->html('userlangattributes') ?>><?php $this->html('subtitle') ?></div>
 78+<?php if($this->data['undelete']) { ?>
 79+ <div id="contentSub2"><?php $this->html('undelete') ?></div>
 80+<?php } ?><?php if($this->data['newtalk'] ) { ?>
 81+ <div class="usermessage"><?php $this->html('newtalk') ?></div>
 82+<?php } ?><?php if($this->data['showjumplinks']) { ?>
 83+ <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>
 84+<?php } ?>
 85+ <!-- start content -->
 86+<?php $this->html('bodytext') ?>
 87+ <?php if($this->data['catlinks']) { $this->html('catlinks'); } ?>
 88+ <!-- end content -->
 89+ <?php if($this->data['dataAfterContent']) { $this->html ('dataAfterContent'); } ?>
 90+ <div class="visualClear"></div>
8891 </div>
89 - </div>
90 - <div id="column-one" <?php $this->html('userlangattributes') ?>>
 92+</div></div>
 93+<div id="column-one" <?php $this->html('userlangattributes') ?>>
9194 <div id="p-cactions" class="portlet">
9295 <h5><?php $this->msg('views') ?></h5>
9396 <div class="pBody">
94 - <ul>
95 - <?php foreach($this->data['content_actions'] as $key => $tab) {
 97+ <ul><?php
 98+ foreach($this->data['content_actions'] as $key => $tab) {
9699 echo '
97100 <li id="' . Sanitizer::escapeId( "ca-$key" ) . '"';
98101 if( $tab['class'] ) {
@@ -112,6 +115,7 @@
113116 }
114117 echo '>'.htmlspecialchars($tab['text']).'</a></li>';
115118 } ?>
 119+
116120 </ul>
117121 </div>
118122 </div>
@@ -153,16 +157,16 @@
154158 }
155159 }
156160 ?>
157 - </div><!-- end of the left (by default at least) column -->
158 - <div class="visualClear"></div>
159 - <div id="footer" <?php $this->html('userlangattributes') ?>>
 161+</div><!-- end of the left (by default at least) column -->
 162+<div class="visualClear"></div>
 163+<div id="footer" <?php $this->html('userlangattributes') ?>>
160164 <?php
161 - if($this->data['poweredbyico']) { ?>
162 - <div id="f-poweredbyico"><?php $this->html('poweredbyico') ?></div>
163 -<?php }
164 - if($this->data['copyrightico']) { ?>
165 - <div id="f-copyrightico"><?php $this->html('copyrightico') ?></div>
166 -<?php }
 165+if($this->data['poweredbyico']) { ?>
 166+ <div id="f-poweredbyico"><?php $this->html('poweredbyico') ?></div>
 167+<?php }
 168+if($this->data['copyrightico']) { ?>
 169+ <div id="f-copyrightico"><?php $this->html('copyrightico') ?></div>
 170+<?php }
167171
168172 // Generate additional footer links
169173 $footerlinks = array(
@@ -176,19 +180,19 @@
177181 }
178182 }
179183 if ( count( $validFooterLinks ) > 0 ) {
180 -?> <ul id="f-list">
 184+?> <ul id="f-list">
181185 <?php
182186 foreach( $validFooterLinks as $aLink ) {
183187 if( isset( $this->data[$aLink] ) && $this->data[$aLink] ) {
184 -?> <li id="<?php echo $aLink ?>"><?php $this->html($aLink) ?></li>
 188+?> <li id="<?php echo $aLink ?>"><?php $this->html($aLink) ?></li>
185189 <?php }
186190 }
187191 ?>
188 - </ul>
 192+ </ul>
189193 <?php }
190194 ?>
191 - </div>
192195 </div>
 196+</div>
193197 <?php $this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?>
194198 <?php $this->html('reporttime') ?>
195199 <?php if ( $this->data['debug'] ): ?>

Status & tagging log