Index: trunk/phase3/includes/SpecialNewpages.php |
— | — | @@ -14,13 +14,15 @@ |
15 | 15 | var $username; |
16 | 16 | var $hideliu; |
17 | 17 | var $hidepatrolled; |
| 18 | + var $hidebots; |
18 | 19 | var $defaults; |
19 | 20 | |
20 | | - function NewPagesPage( $namespace, $username, $hideliu, $hidepatrolled, $defaults) { |
| 21 | + function NewPagesPage( $namespace, $username, $hideliu, $hidepatrolled, $hidebots, $defaults) { |
21 | 22 | $this->namespace = $namespace; |
22 | 23 | $this->username = $username; |
23 | 24 | $this->hideliu = $hideliu; |
24 | 25 | $this->hidepatrolled = $hidepatrolled; |
| 26 | + $this->hidebots = $hidebots; |
25 | 27 | $this->defaults = $defaults; |
26 | 28 | } |
27 | 29 | |
— | — | @@ -37,17 +39,18 @@ |
38 | 40 | global $wgGroupPermissions; |
39 | 41 | $where = ''; |
40 | 42 | if ($this->hidepatrolled) |
41 | | - $where = ' AND rc_patrolled = 0'; |
| 43 | + $where .= ' AND rc_patrolled = 0'; |
| 44 | + if ($this->hidebots) |
| 45 | + $where .= ' AND rc_bot = 0'; |
42 | 46 | if ($wgGroupPermissions['*']['createpage'] == true && $this->hideliu) { |
43 | | - return $where . ' AND rc_user = 0'; |
| 47 | + $where .= ' AND rc_user = 0'; |
44 | 48 | } else { |
45 | 49 | $title = Title::makeTitleSafe( NS_USER, $this->username ); |
46 | 50 | if( $title ) { |
47 | | - return $where . ' AND rc_user_text = ' . $dbo->addQuotes( $title->getText() ); |
48 | | - } else { |
49 | | - return $where; |
| 51 | + $where .= ' AND rc_user_text = ' . $dbo->addQuotes( $title->getText() ); |
50 | 52 | } |
51 | 53 | } |
| 54 | + return $where; |
52 | 55 | } |
53 | 56 | |
54 | 57 | private function makeNamespaceWhere() { |
— | — | @@ -171,12 +174,15 @@ |
172 | 175 | htmlspecialchars( $showhide[1-$this->hideliu] ), wfArrayToCGI( array( 'hideliu' => 1-$this->hideliu ), $nondefaults ) ); |
173 | 176 | $patrLink = $wgUser->getSkin()->makeKnownLink( $wgContLang->specialPage( 'Newpages' ), |
174 | 177 | htmlspecialchars( $showhide[1-$this->hidepatrolled] ), wfArrayToCGI( array( 'hidepatrolled' => 1-$this->hidepatrolled ), $nondefaults ) ); |
| 178 | + $botsLink = $wgUser->getSkin()->makeKnownLink( $wgContLang->specialPage( 'Newpages' ), |
| 179 | + htmlspecialchars( $showhide[1-$this->hidebots] ), wfArrayToCGI( array( 'hidebots' => 1-$this->hidebots ), $nondefaults ) ); |
175 | 180 | $links = array(); |
176 | 181 | if( $wgGroupPermissions['*']['createpage'] == true ) |
177 | 182 | $links[] = wfMsgHtml( 'rcshowhideliu', $liuLink ); |
178 | | - if( $wgUseNPPatrol ) |
179 | | - $links[] = wfMsgHtml( 'rcshowhidepatr', $patrLink ); |
180 | | - $hl = implode( ' | ', $links ); |
| 183 | + if( $wgUseNPPatrol ) |
| 184 | + $links[] = wfMsgHtml( 'rcshowhidepatr', $patrLink ); |
| 185 | + $links[] = wfMsgHtml( 'rcshowhidebots', $botsLink ); |
| 186 | + $hl = implode( ' | ', $links ); |
181 | 187 | |
182 | 188 | $form = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) . |
183 | 189 | Xml::hidden( 'title', $self->getPrefixedDBkey() ) . |
— | — | @@ -230,16 +236,17 @@ |
231 | 237 | list( $limit, $offset ) = wfCheckLimits(); |
232 | 238 | |
233 | 239 | $defaults = array( |
234 | | - /* bool */ 'hideliu' => false, |
235 | | - /* bool */ 'hidepatrolled' => false, |
236 | | - /* text */ 'namespace' => NS_MAIN, |
237 | | - /* text */ 'username' => '', |
238 | | - /* int */ 'offset' => $offset, |
239 | | - /* int */ 'limit' => $limit, |
240 | | - ); |
241 | | - |
242 | | - extract($defaults); |
| 240 | + /* bool */ 'hideliu' => false, |
| 241 | + /* bool */ 'hidepatrolled' => false, |
| 242 | + /* bool */ 'hidebots' => false, |
| 243 | + /* text */ 'namespace' => NS_MAIN, |
| 244 | + /* text */ 'username' => '', |
| 245 | + /* int */ 'offset' => $offset, |
| 246 | + /* int */ 'limit' => $limit, |
| 247 | +); |
243 | 248 | |
| 249 | + extract($defaults); |
| 250 | + |
244 | 251 | if ( $par ) { |
245 | 252 | $bits = preg_split( '/\s*,\s*/', trim( $par ) ); |
246 | 253 | foreach ( $bits as $bit ) { |
— | — | @@ -249,6 +256,8 @@ |
250 | 257 | $hideliu = true; |
251 | 258 | if ( 'hidepatrolled' == $bit ) |
252 | 259 | $hidepatrolled = true; |
| 260 | + if ( 'hidebots' == $bit ) |
| 261 | + $hidebots = true; |
253 | 262 | if ( is_numeric( $bit ) ) |
254 | 263 | $limit = $bit; |
255 | 264 | |
— | — | @@ -273,13 +282,14 @@ |
274 | 283 | $hideliu = $hliu; |
275 | 284 | if( $hpatrolled = $wgRequest->getBool( 'hidepatrolled' ) ) |
276 | 285 | $hidepatrolled = $hpatrolled; |
277 | | - |
| 286 | + if( $hbots = $wgRequest->getBool( 'hidebots' ) ) |
| 287 | + $hidebots = $hbots; |
278 | 288 | } |
279 | 289 | |
280 | 290 | if ( ! isset( $shownavigation ) ) |
281 | 291 | $shownavigation = ! $specialPage->including(); |
282 | 292 | |
283 | | - $npp = new NewPagesPage( $namespace, $username, $hideliu, $hidepatrolled, $defaults ); |
| 293 | + $npp = new NewPagesPage( $namespace, $username, $hideliu, $hidepatrolled, $hidebots, $defaults ); |
284 | 294 | |
285 | 295 | if ( ! $npp->doFeed( $wgRequest->getVal( 'feed' ), $limit ) ) |
286 | 296 | $npp->doQuery( $offset, $limit, $shownavigation ); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -44,11 +44,11 @@ |
45 | 45 | * Removed "Clear" link in watchlist editor tools, as people were afraid to |
46 | 46 | click it. Existing clear links will fall back to the raw editor, which is |
47 | 47 | very easy to clear your watchlist with. |
48 | | -* Allow hiding new pages by logged-in users on Special:Newpages |
49 | 48 | * (bug 1405) Add wgUseNPPatrol option to control patroling for new articles |
50 | 49 | on Special:Newpages |
51 | 50 | * LogLine hook added to allow formatting custom entries in Special:Log. |
52 | 51 | * Support for Iranian calendar |
| 52 | +* (bug 1401) Allow hiding logged-in users, bots and patrolled pages on Special:Newpages |
53 | 53 | |
54 | 54 | === Bug fixes in 1.12 === |
55 | 55 | |