r62311 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62310‎ | r62311 | r62312 >
Date:17:25, 11 February 2010
Author:simetrical
Status:ok
Tags:
Comment:
Avoid silly markup like <ul >
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
@@ -453,7 +453,7 @@
454454 <!-- content -->
455455 <div id="content" <?php $this->html('specialpageattributes') ?>>
456456 <a id="top"></a>
457 - <div id="mw-js-message" style="display:none;" <?php $this->html('userlangattributes') ?>></div>
 457+ <div id="mw-js-message" style="display:none;"<?php $this->html('userlangattributes') ?>></div>
458458 <?php if ( $this->data['sitenotice'] ): ?>
459459 <!-- sitenotice -->
460460 <div id="siteNotice"><?php $this->html( 'sitenotice' ) ?></div>
@@ -468,7 +468,7 @@
469469 <h3 id="siteSub"><?php $this->msg( 'tagline' ) ?></h3>
470470 <!-- /tagline -->
471471 <!-- subtitle -->
472 - <div id="contentSub" <?php $this->html('userlangattributes') ?>><?php $this->html( 'subtitle' ) ?></div>
 472+ <div id="contentSub"<?php $this->html('userlangattributes') ?>><?php $this->html( 'subtitle' ) ?></div>
473473 <!-- /subtitle -->
474474 <?php if ( $this->data['undelete'] ): ?>
475475 <!-- undelete -->
@@ -526,7 +526,7 @@
527527 </div>
528528 <!-- /panel -->
529529 <!-- footer -->
530 - <div id="footer" <?php $this->html('userlangattributes') ?>>
 530+ <div id="footer"<?php $this->html('userlangattributes') ?>>
531531 <?php foreach( $validFooterLinks as $category => $links ): ?>
532532 <?php if ( count( $links ) > 0 ): ?>
533533 <ul id="footer-<?php echo $category ?>">
@@ -579,7 +579,7 @@
580580 case 'TOOLBOX':
581581 ?>
582582 <div class="portal" id="p-tb">
583 - <h5 <?php $this->html('userlangattributes') ?>><?php $this->msg( 'toolbox' ) ?></h5>
 583+ <h5<?php $this->html('userlangattributes') ?>><?php $this->msg( 'toolbox' ) ?></h5>
584584 <div class="body">
585585 <ul>
586586 <?php if( $this->data['notspecialpage'] ): ?>
@@ -622,7 +622,7 @@
623623 if ( $this->data['language_urls'] ) {
624624 ?>
625625 <div class="portal" id="p-lang">
626 - <h5 <?php $this->html('userlangattributes') ?>><?php $this->msg( 'otherlanguages' ) ?></h5>
 626+ <h5<?php $this->html('userlangattributes') ?>><?php $this->msg( 'otherlanguages' ) ?></h5>
627627 <div class="body">
628628 <ul>
629629 <?php foreach ( $this->data['language_urls'] as $langlink ): ?>
@@ -637,7 +637,7 @@
638638 default:
639639 ?>
640640 <div class="portal" id='<?php echo Sanitizer::escapeId( "p-$name" ) ?>'<?php echo $this->skin->tooltip( 'p-' . $name ) ?>>
641 - <h5 <?php $this->html('userlangattributes') ?>><?php $out = wfMsg( $name ); if ( wfEmptyMsg( $name, $out ) ) echo htmlspecialchars( $name ); else echo htmlspecialchars( $out ); ?></h5>
 641+ <h5<?php $this->html('userlangattributes') ?>><?php $out = wfMsg( $name ); if ( wfEmptyMsg( $name, $out ) ) echo htmlspecialchars( $name ); else echo htmlspecialchars( $out ); ?></h5>
642642 <div class="body">
643643 <?php if ( is_array( $content ) ): ?>
644644 <ul>
@@ -680,7 +680,7 @@
681681 ?>
682682 <div id="p-namespaces" class="vectorTabs<?php if ( count( $this->data['namespace_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
683683 <h5><?php $this->msg('namespaces') ?></h5>
684 - <ul <?php $this->html('userlangattributes') ?>>
 684+ <ul<?php $this->html('userlangattributes') ?>>
685685 <?php foreach ($this->data['namespace_urls'] as $key => $link ): ?>
686686 <li <?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><span><?php echo htmlspecialchars( $link['text'] ) ?></span></a></li>
687687 <?php endforeach; ?>
@@ -693,7 +693,7 @@
694694 <div id="p-variants" class="vectorMenu<?php if ( count( $this->data['variant_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
695695 <h5><span><?php $this->msg('variants') ?></span><a href="#"></a></h5>
696696 <div class="menu">
697 - <ul <?php $this->html('userlangattributes') ?>>
 697+ <ul<?php $this->html('userlangattributes') ?>>
698698 <?php foreach ($this->data['variant_urls'] as $key => $link ): ?>
699699 <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li>
700700 <?php endforeach; ?>
@@ -706,7 +706,7 @@
707707 ?>
708708 <div id="p-views" class="vectorTabs<?php if ( count( $this->data['view_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
709709 <h5><?php $this->msg('views') ?></h5>
710 - <ul <?php $this->html('userlangattributes') ?>>
 710+ <ul<?php $this->html('userlangattributes') ?>>
711711 <?php foreach ($this->data['view_urls'] as $key => $link ): ?>
712712 <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo (array_key_exists('img',$link) ? '<img src="'.$link['img'].'" alt="'.$link['text'].'" />' : '<span>'.htmlspecialchars( $link['text'] ).'</span>') ?></a></li>
713713 <?php endforeach; ?>
@@ -719,7 +719,7 @@
720720 <div id="p-cactions" class="vectorMenu<?php if ( count( $this->data['action_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
721721 <h5><span><?php $this->msg('actions') ?></span><a href="#"></a></h5>
722722 <div class="menu">
723 - <ul <?php $this->html('userlangattributes') ?>>
 723+ <ul<?php $this->html('userlangattributes') ?>>
724724 <?php foreach ($this->data['action_urls'] as $key => $link ): ?>
725725 <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li>
726726 <?php endforeach; ?>
@@ -732,7 +732,7 @@
733733 ?>
734734 <div id="p-personal" class="<?php if ( count( $this->data['personal_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
735735 <h5><?php $this->msg('personaltools') ?></h5>
736 - <ul <?php $this->html('userlangattributes') ?>>
 736+ <ul<?php $this->html('userlangattributes') ?>>
737737 <?php foreach($this->data['personal_urls'] as $key => $item): ?>
738738 <li <?php echo $item['attributes'] ?>><a href="<?php echo htmlspecialchars($item['href']) ?>"<?php echo $item['key'] ?><?php if(!empty($item['class'])): ?> class="<?php echo htmlspecialchars($item['class']) ?>"<?php endif; ?>><?php echo htmlspecialchars($item['text']) ?></a></li>
739739 <?php endforeach; ?>
@@ -743,7 +743,7 @@
744744 case 'SEARCH':
745745 ?>
746746 <div id="p-search">
747 - <h5 <?php $this->html('userlangattributes') ?>><label for="searchInput"><?php $this->msg( 'search' ) ?></label></h5>
 747+ <h5<?php $this->html('userlangattributes') ?>><label for="searchInput"><?php $this->msg( 'search' ) ?></label></h5>
748748 <form action="<?php $this->text( 'wgScript' ) ?>" id="searchform">
749749 <input type='hidden' name="title" value="<?php $this->text( 'searchtitle' ) ?>"/>
750750 <?php if ( $wgVectorUseSimpleSearch ): ?>
Index: trunk/phase3/skins/MonoBook.php
@@ -73,7 +73,7 @@
7474 <h1 id="firstHeading" class="firstHeading"><?php $this->html('title') ?></h1>
7575 <div id="bodyContent">
7676 <h3 id="siteSub"><?php $this->msg('tagline') ?></h3>
77 - <div id="contentSub" <?php $this->html('userlangattributes') ?>><?php $this->html('subtitle') ?></div>
 77+ <div id="contentSub"<?php $this->html('userlangattributes') ?>><?php $this->html('subtitle') ?></div>
7878 <?php if($this->data['undelete']) { ?>
7979 <div id="contentSub2"><?php $this->html('undelete') ?></div>
8080 <?php } ?><?php if($this->data['newtalk'] ) { ?>
@@ -89,7 +89,7 @@
9090 <div class="visualClear"></div>
9191 </div>
9292 </div></div>
93 -<div id="column-one" <?php $this->html('userlangattributes') ?>>
 93+<div id="column-one"<?php $this->html('userlangattributes') ?>>
9494 <div id="p-cactions" class="portlet">
9595 <h5><?php $this->msg('views') ?></h5>
9696 <div class="pBody">
@@ -122,7 +122,7 @@
123123 <div class="portlet" id="p-personal">
124124 <h5><?php $this->msg('personaltools') ?></h5>
125125 <div class="pBody">
126 - <ul <?php $this->html('userlangattributes') ?>>
 126+ <ul<?php $this->html('userlangattributes') ?>>
127127 <?php foreach($this->data['personal_urls'] as $key => $item) { ?>
128128 <li id="<?php echo Sanitizer::escapeId( "pt-$key" ) ?>"<?php
129129 if ($item['active']) { ?> class="active"<?php } ?>><a href="<?php
@@ -159,7 +159,7 @@
160160 ?>
161161 </div><!-- end of the left (by default at least) column -->
162162 <div class="visualClear"></div>
163 -<div id="footer" <?php $this->html('userlangattributes') ?>>
 163+<div id="footer"<?php $this->html('userlangattributes') ?>>
164164 <?php
165165 if($this->data['poweredbyico']) { ?>
166166 <div id="f-poweredbyico"><?php $this->html('poweredbyico') ?></div>
@@ -300,7 +300,7 @@
301301 if( $this->data['language_urls'] ) {
302302 ?>
303303 <div id="p-lang" class="portlet">
304 - <h5 <?php $this->html('userlangattributes') ?>><?php $this->msg('otherlanguages') ?></h5>
 304+ <h5<?php $this->html('userlangattributes') ?>><?php $this->msg('otherlanguages') ?></h5>
305305 <div class="pBody">
306306 <ul>
307307 <?php foreach($this->data['language_urls'] as $langlink) { ?>
Index: trunk/phase3/skins/Modern.php
@@ -106,7 +106,7 @@
107107 for the margins -->
108108 <div id="mw_contentholder" <?php $this->html("specialpageattributes") ?>>
109109 <div class='mw-topboxes'>
110 - <div id="mw-js-message" style="display:none;" <?php $this->html('userlangattributes')?>></div>
 110+ <div id="mw-js-message" style="display:none;"<?php $this->html('userlangattributes')?>></div>
111111 <div class="mw-topbox" id="siteSub"><?php $this->msg('tagline') ?></div>
112112 <?php if($this->data['newtalk'] ) {
113113 ?><div class="usermessage mw-topbox"><?php $this->html('newtalk') ?></div>
@@ -116,7 +116,7 @@
117117 <?php } ?>
118118 </div>
119119
120 - <div id="contentSub" <?php $this->html('userlangattributes') ?>><?php $this->html('subtitle') ?></div>
 120+ <div id="contentSub"<?php $this->html('userlangattributes') ?>><?php $this->html('subtitle') ?></div>
121121
122122 <?php if($this->data['undelete']) { ?><div id="contentSub2"><?php $this->html('undelete') ?></div><?php } ?>
123123 <?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 } ?>
@@ -129,7 +129,7 @@
130130 </div><!-- mw_content -->
131131 </div><!-- mw_contentwrapper -->
132132
133 - <div id="mw_portlets" <?php $this->html("userlangattributes") ?>>
 133+ <div id="mw_portlets"<?php $this->html("userlangattributes") ?>>
134134
135135 <!-- portlets -->
136136 <?php
@@ -177,7 +177,7 @@
178178
179179
180180 <!-- footer -->
181 - <div id="footer" <?php $this->html('userlangattributes') ?>>
 181+ <div id="footer"<?php $this->html('userlangattributes') ?>>
182182 <ul id="f-list">
183183 <?php
184184 $footerlinks = array(
Index: trunk/phase3/includes/SkinTemplate.php
@@ -314,7 +314,7 @@
315315 $lang = $wgLang->getCode();
316316 $dir = $wgLang->getDir();
317317 if ( $lang !== $wgContLang->getCode() || $dir !== $wgContLang->getDir() ) {
318 - $attrs = "lang='$lang' xml:lang='$lang' dir='$dir'";
 318+ $attrs = " lang='$lang' xml:lang='$lang' dir='$dir'";
319319
320320 $tpl->set( 'userlangattributes', $attrs );
321321

Status & tagging log