Debian Codegraph @

includes/specials/SpecialUncategorizedImages.php

raw symbols SCIP
1 <?php
2 /**
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 * http://www.gnu.org/copyleft/gpl.html
17 *
18 * @file
19 */
20
21 namespace MediaWiki\Specials;
22
23 use MediaWiki\SpecialPage\ImageQueryPage;
24 use Wikimedia\Rdbms\IConnectionProvider;
25
26 /**
27 * List of file pages which haven't been categorised
28 *
29 * @todo FIXME: Use an instance of UncategorizedPagesPage or something
30 *
31 * @ingroup SpecialPage
32 * @author Rob Church <[email protected]>
33 */
34 class SpecialUncategorizedImages extends ImageQueryPage {
35
36 /**
37 * @param IConnectionProvider $dbProvider
38 */
39 public function __construct( IConnectionProvider $dbProvider ) {
40 parent::__construct( 'Uncategorizedimages' );
41 $this->setDatabaseProvider( $dbProvider );
42 }
43
44 protected function sortDescending() {
45 return false;
46 }
47
48 public function isExpensive() {
49 return true;
50 }
51
52 public function isSyndicated() {
53 return false;
54 }
55
56 protected function getOrderFields() {
57 return [ 'title' ];
58 }
59
60 public function execute( $par ) {
61 $this->addHelpLink( 'Help:Categories' );
62 parent::execute( $par );
63 }
64
65 public function getQueryInfo() {
66 return [
67 'tables' => [ 'page', 'categorylinks' ],
68 'fields' => [
69 'namespace' => 'page_namespace',
70 'title' => 'page_title',
71 ],
72 'conds' => [
73 'cl_from' => null,
74 'page_namespace' => NS_FILE,
75 'page_is_redirect' => 0,
76 ],
77 'join_conds' => [
78 'categorylinks' => [
79 'LEFT JOIN',
80 'cl_from=page_id',
81 ],
82 ],
83 ];
84 }
85
86 protected function getGroupName() {
87 return 'maintenance';
88 }
89 }
90
91 /**
92 * Retain the old class name for backwards compatibility.
93 * @deprecated since 1.41
94 */
95 class_alias( SpecialUncategorizedImages::class, 'SpecialUncategorizedImages' );