From aca3e5d864fab774eecedb93a4e415f7049f34ff Mon Sep 17 00:00:00 2001 From: David McCabe Date: Wed, 3 Sep 2008 22:13:03 +0000 Subject: [PATCH] Added OldChangesListRecentChangesLine hook for customizing RC messages in OldChangesList mode. TODO: Customize other ChangesList implementations. --- docs/hooks.txt | 5 +++++ includes/ChangesList.php | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index cb84704119..f17f3175e4 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -895,6 +895,11 @@ $baseID: the revision ID this was based off, if any whether to use the content language (true) or site language (false) (bool) &$transform: whether or not to expand variables and templates in the message (bool) +'OldChangesListRecentChangesLine': Customize entire Recent Changes line. +&$changeslist: The OldChangesList instance. +&$s: HTML of the form "
  • ...
  • " containing one RC entry. +&$rc: The RecentChange object. + 'OpenSearchUrls': Called when constructing the OpenSearch description XML. Hooks can alter or append to the array of URLs for search & suggestion formats. &$urls: array of associative arrays with Url element attributes diff --git a/includes/ChangesList.php b/includes/ChangesList.php index bad9445a01..c7316c19fb 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -130,7 +130,6 @@ class ChangesList { # Make date header if necessary $date = $wgLang->date( $rc_timestamp, true, true ); - $s = ''; if( $date != $this->lastdate ) { if( '' != $this->lastdate ) { $s .= "\n"; @@ -319,9 +318,10 @@ class OldChangesList extends ChangesList { # Should patrol-related stuff be shown? $unpatrolled = $wgUser->useRCPatrol() && $rc_patrolled == 0; - $this->insertDateHeader($s,$rc_timestamp); + $dateheader = ""; // $s now contains only
  • ...
  • , for hooks' convenience. + $this->insertDateHeader($dateheader,$rc_timestamp); - $s .= '
  • '; + $s = '
  • '; // Moved pages if( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) { @@ -374,10 +374,12 @@ class OldChangesList extends ChangesList { $s .= "
  • \n"; + wfRunHooks('OldChangesListRecentChangesLine', array(&$this, &$s, &$rc)); + wfProfileOut( $fname.'-rest' ); wfProfileOut( $fname ); - return $s; + return $dateheader . $s; } } -- 2.20.1