r51007 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51006‎ | r51007 | r51008 >
Date:11:03, 26 May 2009
Author:soxred93
Status:ok (Comments)
Tags:
Comment:
Modification of r50714, adding element to the li class, rather than a separate div class.
Modified paths:
  • /trunk/phase3/includes/ChangesList.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ChangesList.php
@@ -55,7 +55,7 @@
5656 }
5757
5858 /**
59 - * Sets the list to use a <div class="watchlist-(namespace)-(page)"> tag
 59+ * Sets the list to use a <li class="watchlist-(namespace)-(page)"> tag
6060 * @param bool $value
6161 */
6262 public function setWatchlistDivs( $value = true ) {
@@ -458,17 +458,13 @@
459459 }
460460
461461 if( $this->watchlist ) {
462 - $watchlist_start = Xml::openElement( 'div', array( 'class' => Sanitizer::escapeClass( 'watchlist-'.$rc->mAttribs['rc_namespace'].'-'.$rc->mAttribs['rc_title'] ) ) );
463 - $watchlist_end = Xml::closeElement( 'div' );
 462+ $classes[] = Sanitizer::escapeClass( 'watchlist-'.$rc->mAttribs['rc_namespace'].'-'.$rc->mAttribs['rc_title'] );
464463 }
465 - else {
466 - $watchlist_start = $watchlist_end = null;
467 - }
468 -
 464+
469465 wfRunHooks( 'OldChangesListRecentChangesLine', array(&$this, &$s, $rc) );
470466
471467 wfProfileOut( __METHOD__ );
472 - return "$dateheader<li class=\"".implode( ' ', $classes )."\">".$watchlist_start.$s.$watchlist_end."</li>\n";
 468+ return "$dateheader<li class=\"".implode( ' ', $classes )."\">".$s."</li>\n";
473469 }
474470 }
475471

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r50714Watchlist now has a specialized <div> tag that contains a unique class for ea...soxred9301:12, 18 May 2009

Comments

#Comment by Ms2ger (talk | contribs)   15:46, 26 May 2009

Thanks, that's cleaner. The release notes should be changed to reflect this, though.

#Comment by MZMcBride (talk | contribs)   04:57, 3 June 2009

Hmmm. I wonder if there are benefits to using the page ID instead of the page namespace / page title.

Status & tagging log