Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -962,6 +962,26 @@ |
963 | 963 | 'SpecialContributionsBeforeMainOutput': Before the form on Special:Contributions |
964 | 964 | $id: User identifier |
965 | 965 | |
| 966 | +'SpecialListusersDefaultQuery': called right before the end of UsersPager::getDefaultQuery() |
| 967 | +$pager: The UsersPager instance |
| 968 | +$query: The query array to be returned |
| 969 | + |
| 970 | +'SpecialListusersFormatRow': called right before the end of UsersPager::formatRow() |
| 971 | +$item: HTML to be returned. Will be wrapped in <li></li> after the hook finishes |
| 972 | +$row: Database row object |
| 973 | + |
| 974 | +'SpecialListusersHeader': called before closing the <fieldset> in UsersPager::getPageHeader() |
| 975 | +$pager: The UsersPager instance |
| 976 | +$out: The header HTML |
| 977 | + |
| 978 | +'SpecialListusersHeaderForm': called before adding the submit button in UsersPager::getPageHeader() |
| 979 | +$pager: The UsersPager instance |
| 980 | +$out: The header HTML |
| 981 | + |
| 982 | +'SpecialListusersQueryInfo': called right before the end of UsersPager::getQueryInfo() |
| 983 | +$pager: The UsersPager instance |
| 984 | +$query: The query array to be returned |
| 985 | + |
966 | 986 | 'SpecialMovepageAfterMove': called after moving a page |
967 | 987 | $movePage: MovePageForm object |
968 | 988 | $oldTitle: old title (object) |
Index: trunk/phase3/includes/SpecialListusers.php |
— | — | @@ -68,7 +68,7 @@ |
69 | 69 | |
70 | 70 | list ($user,$user_groups,$ipblocks) = wfGetDB()->tableNamesN('user','user_groups','ipblocks'); |
71 | 71 | |
72 | | - return array( |
| 72 | + $query = array( |
73 | 73 | 'tables' => " $user LEFT JOIN $user_groups ON user_id=ug_user LEFT JOIN $ipblocks ON user_id=ipb_user AND ipb_auto=0 ", |
74 | 74 | 'fields' => array('user_name', |
75 | 75 | 'MAX(user_id) AS user_id', |
— | — | @@ -78,6 +78,8 @@ |
79 | 79 | 'conds' => $conds |
80 | 80 | ); |
81 | 81 | |
| 82 | + wfRunHooks( 'SpecialListusersQueryInfo', array( $this, &$query ) ); |
| 83 | + return $query; |
82 | 84 | } |
83 | 85 | |
84 | 86 | function formatRow( $row ) { |
— | — | @@ -94,8 +96,10 @@ |
95 | 97 | } else { |
96 | 98 | $groups = ''; |
97 | 99 | } |
98 | | - |
99 | | - return '<li>' . wfSpecialList( $name, $groups ) . '</li>'; |
| 100 | + |
| 101 | + $item = wfSpecialList( $name, $groups ); |
| 102 | + wfRunHooks( 'SpecialListusersFormatRow', array( &$item, $row ) ); |
| 103 | + return "<li>{$item}</li>"; |
100 | 104 | } |
101 | 105 | |
102 | 106 | function getBody() { |
— | — | @@ -136,11 +140,14 @@ |
137 | 141 | $out .= Xml::option( User::getGroupName( $group ), $group, $group == $this->requestedGroup ); |
138 | 142 | $out .= Xml::closeElement( 'select' ) . ' '; |
139 | 143 | |
| 144 | + wfRunHooks( 'SpecialListusersHeaderForm', array( $this, &$out ) ); |
| 145 | + |
140 | 146 | # Submit button and form bottom |
141 | 147 | if( $this->mLimit ) |
142 | 148 | $out .= Xml::hidden( 'limit', $this->mLimit ); |
143 | | - $out .= Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . |
144 | | - '</fieldset>' . |
| 149 | + $out .= Xml::submitButton( wfMsg( 'allpagessubmit' ) ); |
| 150 | + wfRunHooks( 'SpecialListusersHeader', array( $this, &$out ) ); |
| 151 | + $out .= '</fieldset>' . |
145 | 152 | Xml::closeElement( 'form' ); |
146 | 153 | |
147 | 154 | return $out; |
— | — | @@ -156,6 +163,7 @@ |
157 | 164 | $query['group'] = $this->requestedGroup; |
158 | 165 | if( $this->requestedUser != '' ) |
159 | 166 | $query['username'] = $this->requestedUser; |
| 167 | + wfRunHooks( 'SpecialListusersDefaultQuery', array( $this, &$query ) ); |
160 | 168 | return $query; |
161 | 169 | } |
162 | 170 | |
— | — | @@ -213,5 +221,3 @@ |
214 | 222 | |
215 | 223 | $wgOut->addHTML( $s ); |
216 | 224 | } |
217 | | - |
218 | | - |