From acc62d7361514759a9114b561ec1162865708f0f Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sat, 16 Aug 2008 21:16:25 +0000 Subject: [PATCH] (bug 14468) Lines in classic RecentChanges and Watchlist now have classes "odd" and "even" to make colouring using css possible. Implemented in OldChangesList::recentChangesLine using an additional parameter, while keeping behaviour for other uses unchanged. Did not see any use adding this to ChangesList::recentChangesLine --- RELEASE-NOTES | 16 +++++++++------- includes/ChangesList.php | 14 ++++++++++++-- includes/specials/SpecialRecentchanges.php | 2 +- includes/specials/SpecialWatchlist.php | 2 +- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 2248751efe..cee93deab3 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -37,15 +37,15 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN Backwards compatibility is maintained. * $wgEnablePersistentCookies has been added. Setting to false disables the setting of persistent cookies. Defaults to true. - + === New features in 1.14 === -* New URL syntaxes for Special:ListUsers - 'Special:ListUsers/USER' and - 'Special:ListUsers/GROUP/USER', in addition to the older syntax +* New URL syntaxes for Special:ListUsers - 'Special:ListUsers/USER' and + 'Special:ListUsers/GROUP/USER', in addition to the older syntax 'Special:ListUsers/GROUP' where GROUP is a valid group name. -* Configurable er-namespace and per-page notices for the edit form, +* Configurable er-namespace and per-page notices for the edit form, respectively MediaWiki:Editnotice-# where # is the namespace number, and - MediaWiki:Editnotice-#-PAGENAME where # is the page's namespace number and + MediaWiki:Editnotice-#-PAGENAME where # is the page's namespace number and PAGENAME is the page name minus the namespace prefix. * (bug 8068) New __INDEX__ and __NOINDEX__ magic words allow user control of search engine indexing on a per-article basis. @@ -80,7 +80,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 14929) removeUnusedAccounts.php now supports 'ignore-touched' and 'ignore-groups'. Patch by Louperivois * (bug 15127) Work around minor display glitch in Opera. -* By default, reject file uploads that look like ZIP files, to avoid the +* By default, reject file uploads that look like ZIP files, to avoid the so-called GIFAR vulnerability. * (bug 15141) Give ability to only list protected pages with the cascading option enabled on Special:ProtectedPages @@ -88,7 +88,9 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN Show/Hide logged in users, Show/Hide anonymous, Invert namespace selection * Added hook 'UserrightsChangeableGroups' to allow modification of what groups may be added or removed via the Special:UserRights interface. - +* (bug 14468) Lines in classic RecentChanges and Watchlist have classes "odd" + and "even" to make colouring using css possible. + === Bug fixes in 1.14 === * (bug 14907) DatabasePostgres::fieldType now defined. diff --git a/includes/ChangesList.php b/includes/ChangesList.php index bad9445a01..d7f5bf76ec 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -306,7 +306,7 @@ class OldChangesList extends ChangesList { /** * Format a line using the old system (aka without any javascript). */ - public function recentChangesLine( &$rc, $watched = false ) { + public function recentChangesLine( &$rc, $watched = false, $linenumber = NULL ) { global $wgContLang, $wgRCShowChangedSize, $wgUser; $fname = 'ChangesList::recentChangesLineOld'; @@ -321,7 +321,17 @@ class OldChangesList extends ChangesList { $this->insertDateHeader($s,$rc_timestamp); - $s .= '
  • '; + // use even/odd class only if linenumber is given (feature from bug 14468) + if( $linenumber ) { + if( $linenumber & 1 ) { + $s .= '
  • '; + } + else { + $s .= '
  • '; + } + } else { + $s .= '
  • '; + } // Moved pages if( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) { diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index 4f43c8e0f9..fc09a4de7d 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -378,7 +378,7 @@ class SpecialRecentChanges extends SpecialPage { } $rc->numberofWatchingusers = $watcherCache[$obj->rc_namespace][$obj->rc_title]; } - $s .= $list->recentChangesLine( $rc, !empty( $obj->wl_user ) ); + $s .= $list->recentChangesLine( $rc, !empty( $obj->wl_user ), $counter ); --$limit; } } diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index 3e729f27ae..e8386edc94 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -342,7 +342,7 @@ function wfSpecialWatchlist( $par ) { $rc->numberofWatchingusers = 0; } - $s .= $list->recentChangesLine( $rc, $updated ); + $s .= $list->recentChangesLine( $rc, $updated, $counter ); } $s .= $list->endRecentChangesList(); -- 2.20.1