From 625b0affd58fc4bf8646724a740b5b5ad15ec53e Mon Sep 17 00:00:00 2001 From: X! Date: Mon, 18 May 2009 01:12:52 +0000 Subject: [PATCH] Watchlist now has a specialized
tag that contains a unique class for each page --- RELEASE-NOTES | 1 + includes/ChangesList.php | 19 ++++++++++++++++++- includes/specials/SpecialWatchlist.php | 3 ++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index b2f2c1bdc6..16233a1dad 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -54,6 +54,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 18466) Add note or warning when overruling a move (semi-)protection * (bug 18342) insertTags works in edit summary box * (bug 18411) The upload form also checks post_max_size +* Watchlist now has a specialized
tag that contains a unique class for each page === Bug fixes in 1.16 === diff --git a/includes/ChangesList.php b/includes/ChangesList.php index 3efa66f9c5..69eeed9073 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -25,6 +25,7 @@ class RCCacheEntry extends RecentChange { class ChangesList { # Called by history lists and recent changes public $skin; + protected $watchlist = false; /** * Changeslist contructor @@ -52,6 +53,14 @@ class ChangesList { return $list; } } + + /** + * Sets the list to use a
tag + * @param bool $value + */ + public function setWatchlistDivs( $value = true ) { + $this->watchlist = $value; + } /** * As we use the same small set of messages in various methods and that @@ -447,11 +456,19 @@ class OldChangesList extends ChangesList { $s .= ' ' . wfMsgExt( 'number_of_watching_users_RCview', array( 'parsemag', 'escape' ), $wgLang->formatNum( $rc->numberofWatchingusers ) ); } + + if( $this->watchlist ) { + $watchlist_start = Xml::openElement( 'div', array( 'class' => Sanitizer::escapeClass( 'watchlist-'.$rc->mAttribs['rc_namespace'].'-'.$rc->mAttribs['rc_title'] ) ) ); + $watchlist_end = Xml::closeElement( 'div' ); + } + else { + $watchlist_start = $watchlist_end = null; + } wfRunHooks( 'OldChangesListRecentChangesLine', array(&$this, &$s, $rc) ); wfProfileOut( __METHOD__ ); - return "$dateheader
  • $s
  • \n"; + return "$dateheader
  • ".$watchlist_start.$s.$watchlist_end."
  • \n"; } } diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index b14577b552..c715a1337e 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -334,7 +334,8 @@ function wfSpecialWatchlist( $par ) { $dbr->dataSeek( $res, 0 ); $list = ChangesList::newFromUser( $wgUser ); - + $list->setWatchlistDivs(); + $s = $list->beginRecentChangesList(); $counter = 1; while ( $obj = $dbr->fetchObject( $res ) ) { -- 2.20.1