* Highlight flagged user contribs (bug 14814)
authorAaron Schulz <aaron@users.mediawiki.org>
Thu, 17 Jul 2008 14:55:30 +0000 (14:55 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Thu, 17 Jul 2008 14:55:30 +0000 (14:55 +0000)
* Necessary hooks added

docs/hooks.txt
includes/specials/SpecialContributions.php

index 2217a5e..1035232 100644 (file)
@@ -513,6 +513,11 @@ $catpage: CategoryPage instance
 $unpatrolled:  Whether or not we are showing unpatrolled changes.
 $watched:      Whether or not the change is watched by the user.
 
+'ContribsPager::getQueryInfo': Before the contributions query is about to run
+&$this:        Pager object for contributions
+&queryInfo:    The query for the contribs Pager
+
+
 'ContributionsToolLinks': Change tool links above Special:Contributions
 $id: User identifier
 $title: User page title
@@ -1225,6 +1230,11 @@ string &$error: output: HTML error to show if upload canceled by returning false
 'UploadComplete': Upon completion of a file upload
 $uploadForm: Upload form object. File can be accessed by $uploadForm->mLocalFile.
 
+'ContributionsLineEnding': Called before a contributions HTML line is finished
+$this: SpecialPage object for contributions
+$ret: the HTML line
+$row: the DB row for this line
+
 'UserArrayFromResult': called when creating an UserArray object from a database result
 &$userArray: set this to an object to override the default object returned
 $res: database result used to create the object
index c9cbc18..4a131f1 100644 (file)
@@ -43,7 +43,7 @@ class ContribsPager extends ReverseChronologicalPager {
        function getQueryInfo() {
                list( $index, $userCond ) = $this->getUserCond();
                $conds = array_merge( array('page_id=rev_page'), $userCond, $this->getNamespaceCond() );
-               return array(
+               $queryInfo = array(
                        'tables' => array( 'page', 'revision' ),
                        'fields' => array(
                                'page_namespace', 'page_title', 'page_is_new', 'page_latest', 'rev_id', 'rev_page',
@@ -51,8 +51,10 @@ class ContribsPager extends ReverseChronologicalPager {
                                'rev_user_text', 'rev_parent_id', 'rev_deleted'
                        ),
                        'conds' => $conds,
-                       'options' => array( 'USE INDEX' => $index )
+                       'options' => array( 'USE INDEX' => array('revision' => $index) )
                );
+               wfRunHooks( 'ContribsPager::getQueryInfo', array( &$this, &$queryInfo ) );
+               return $queryInfo;
        }
 
        function getUserCond() {
@@ -209,6 +211,9 @@ class ContribsPager extends ReverseChronologicalPager {
                if( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
                        $ret .= ' ' . wfMsgHtml( 'deletedrev' );
                }
+               // Let extensions add data
+               wfRunHooks( 'ContributionsLineEnding', array( &$this, &$ret, $row ) );
+               
                $ret = "<li>$ret</li>\n";
                wfProfileOut( __METHOD__ );
                return $ret;