From: Roan Kattouw Date: Sun, 2 Mar 2008 14:14:43 +0000 (+0000) Subject: (bug 12542) Adding a bunch of hooks to SpecialListusers.php, modified patch by Daniel... X-Git-Tag: 1.31.0-rc.0~49290 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%29%20.%20%22?a=commitdiff_plain;h=d2a7be1488c9aae0368aedd5180e1d7649838e2e;p=lhc%2Fweb%2Fwiklou.git (bug 12542) Adding a bunch of hooks to SpecialListusers.php, modified patch by Daniel Friesen --- diff --git a/docs/hooks.txt b/docs/hooks.txt index 1a0dd33d32..eebdfe7328 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -962,6 +962,26 @@ $content_actions: array of tabs 'SpecialContributionsBeforeMainOutput': Before the form on Special:Contributions $id: User identifier +'SpecialListusersDefaultQuery': called right before the end of UsersPager::getDefaultQuery() +$pager: The UsersPager instance +$query: The query array to be returned + +'SpecialListusersFormatRow': called right before the end of UsersPager::formatRow() +$item: HTML to be returned. Will be wrapped in
  • after the hook finishes +$row: Database row object + +'SpecialListusersHeader': called before closing the
    in UsersPager::getPageHeader() +$pager: The UsersPager instance +$out: The header HTML + +'SpecialListusersHeaderForm': called before adding the submit button in UsersPager::getPageHeader() +$pager: The UsersPager instance +$out: The header HTML + +'SpecialListusersQueryInfo': called right before the end of UsersPager::getQueryInfo() +$pager: The UsersPager instance +$query: The query array to be returned + 'SpecialMovepageAfterMove': called after moving a page $movePage: MovePageForm object $oldTitle: old title (object) diff --git a/includes/SpecialListusers.php b/includes/SpecialListusers.php index 460d4259cd..48e0819bfb 100644 --- a/includes/SpecialListusers.php +++ b/includes/SpecialListusers.php @@ -68,7 +68,7 @@ class UsersPager extends AlphabeticPager { list ($user,$user_groups,$ipblocks) = wfGetDB()->tableNamesN('user','user_groups','ipblocks'); - return array( + $query = array( 'tables' => " $user LEFT JOIN $user_groups ON user_id=ug_user LEFT JOIN $ipblocks ON user_id=ipb_user AND ipb_auto=0 ", 'fields' => array('user_name', 'MAX(user_id) AS user_id', @@ -78,6 +78,8 @@ class UsersPager extends AlphabeticPager { 'conds' => $conds ); + wfRunHooks( 'SpecialListusersQueryInfo', array( $this, &$query ) ); + return $query; } function formatRow( $row ) { @@ -94,8 +96,10 @@ class UsersPager extends AlphabeticPager { } else { $groups = ''; } - - return '
  • ' . wfSpecialList( $name, $groups ) . '
  • '; + + $item = wfSpecialList( $name, $groups ); + wfRunHooks( 'SpecialListusersFormatRow', array( &$item, $row ) ); + return "
  • {$item}
  • "; } function getBody() { @@ -136,11 +140,14 @@ class UsersPager extends AlphabeticPager { $out .= Xml::option( User::getGroupName( $group ), $group, $group == $this->requestedGroup ); $out .= Xml::closeElement( 'select' ) . ' '; + wfRunHooks( 'SpecialListusersHeaderForm', array( $this, &$out ) ); + # Submit button and form bottom if( $this->mLimit ) $out .= Xml::hidden( 'limit', $this->mLimit ); - $out .= Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . - '
    ' . + $out .= Xml::submitButton( wfMsg( 'allpagessubmit' ) ); + wfRunHooks( 'SpecialListusersHeader', array( $this, &$out ) ); + $out .= '' . Xml::closeElement( 'form' ); return $out; @@ -156,6 +163,7 @@ class UsersPager extends AlphabeticPager { $query['group'] = $this->requestedGroup; if( $this->requestedUser != '' ) $query['username'] = $this->requestedUser; + wfRunHooks( 'SpecialListusersDefaultQuery', array( $this, &$query ) ); return $query; } @@ -213,5 +221,3 @@ function wfSpecialListusers( $par = null ) { $wgOut->addHTML( $s ); } - -