Added OldChangesListRecentChangesLine hook for customizing RC messages in OldChangesL...
authorDavid McCabe <david@users.mediawiki.org>
Wed, 3 Sep 2008 22:13:03 +0000 (22:13 +0000)
committerDavid McCabe <david@users.mediawiki.org>
Wed, 3 Sep 2008 22:13:03 +0000 (22:13 +0000)
docs/hooks.txt
includes/ChangesList.php

index cb84704..f17f317 100644 (file)
@@ -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 "<li>...</li>" 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
index bad9445..c7316c1 100644 (file)
@@ -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 .= "</ul>\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 <li>...</li>, for hooks' convenience.
+               $this->insertDateHeader($dateheader,$rc_timestamp);
 
-               $s .= '<li>';
+               $s = '<li>';
 
                // Moved pages
                if( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
@@ -374,10 +374,12 @@ class OldChangesList extends ChangesList {
 
                $s .= "</li>\n";
 
+               wfRunHooks('OldChangesListRecentChangesLine', array(&$this, &$s, &$rc));
+
                wfProfileOut( $fname.'-rest' );
 
                wfProfileOut( $fname );
-               return $s;
+               return $dateheader . $s;
        }
 }