Watchlist now has a specialized <div> tag that contains a unique class for each page
authorX! <soxred93@users.mediawiki.org>
Mon, 18 May 2009 01:12:52 +0000 (01:12 +0000)
committerX! <soxred93@users.mediawiki.org>
Mon, 18 May 2009 01:12:52 +0000 (01:12 +0000)
RELEASE-NOTES
includes/ChangesList.php
includes/specials/SpecialWatchlist.php

index b2f2c1b..16233a1 100644 (file)
@@ -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 <div> tag that contains a unique class for each page
 
 === Bug fixes in 1.16 ===
 
index 3efa66f..69eeed9 100644 (file)
@@ -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 <div class="watchlist-(namespace)-(page)"> 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<li class=\"".implode( ' ', $classes )."\">$s</li>\n";
+               return "$dateheader<li class=\"".implode( ' ', $classes )."\">".$watchlist_start.$s.$watchlist_end."</li>\n";
        }
 }
 
index b14577b..c715a13 100644 (file)
@@ -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 ) ) {