r81915 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81914‎ | r81915 | r81916 >
Date:20:36, 10 February 2011
Author:platonides
Status:ok
Tags:
Comment:
Follow up r81914. Don't build the <li> manually.
Modified paths:
  • /trunk/phase3/skins/MonoBook.php (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/MonoBook.php
@@ -203,12 +203,6 @@
204204 <div class="pBody">
205205 <ul><?php
206206 foreach($this->data['content_actions'] as $key => $tab) {
207 - echo '
208 - <li id="' . Sanitizer::escapeId( "ca-$key" ) . '"';
209 - if( $tab['class'] ) {
210 - echo ' class="'.htmlspecialchars($tab['class']).'"';
211 - }
212 - echo '>';
213207 $linkAttribs = array( 'href' => $tab['href'] );
214208
215209 if( isset( $tab["tooltiponly"] ) && $tab["tooltiponly"] ) {
@@ -219,8 +213,15 @@
220214 } else {
221215 $linkAttribs += $skin->tooltipAndAccesskeyAttribs( "ca-$key" );
222216 }
223 - echo Html::element( 'a', $linkAttribs, $tab['text'] );
224 - echo '</li>';
 217+ $linkHtml = Html::element( 'a', $linkAttribs, $tab['text'] );
 218+
 219+ /* Surround with a <li> */
 220+ $liAttribs = array( 'id' => Sanitizer::escapeId( "ca-$key" ) );
 221+ if( $tab['class'] ) {
 222+ $liAttribs['class'] = $tab['class'];
 223+ }
 224+ echo '
 225+ ' . Html::rawElement( 'li', $liAttribs, $linkHtml );
225226 } ?>
226227
227228 </ul>

Sign-offs

UserFlagDate
Krinkleinspected00:39, 2 March 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r81914Kill calls to tooltip() and tooltipAndAccesskeyAttribs() from MonoBook and Mo...platonides19:46, 10 February 2011

Status & tagging log