Separate the Special:Preferences title and the link to the preferences from the perso...
[lhc/web/wiklou.git] / includes / SpecialUncategorizedimages.php
1 <?php
2
3 /**
4 * Special page lists images which haven't been categorised
5 *
6 * @package MediaWiki
7 * @subpackage Special pages
8 * @author Rob Church <robchur@gmail.com>
9 */
10
11 class UncategorizedImagesPage extends QueryPage {
12
13 function getName() {
14 return 'Uncategorizedimages';
15 }
16
17 function sortDescending() {
18 return false;
19 }
20
21 function isExpensive() {
22 return true;
23 }
24
25 function isSyndicated() {
26 return false;
27 }
28
29 function getSQL() {
30 $dbr =& wfGetDB( DB_SLAVE );
31 extract( $dbr->tableNames( 'page', 'categorylinks' ) );
32 $ns = NS_IMAGE;
33
34 return "SELECT 'Uncategorizedimages' AS type, page_namespace AS namespace,
35 page_title AS title, page_title AS value
36 FROM {$page} LEFT JOIN {$categorylinks} ON page_id = cl_from
37 WHERE cl_from IS NULL AND page_namespace = {$ns} AND page_is_redirect = 0";
38 }
39
40 function formatResult( &$skin, $row ) {
41 global $wgContLang;
42 $title = Title::makeTitleSafe( NS_IMAGE, $row->title );
43 $label = htmlspecialchars( $wgContLang->convert( $title->getText() ) );
44 return $skin->makeKnownLinkObj( $title, $label );
45 }
46
47 }
48
49 function wfSpecialUncategorizedimages() {
50 $uip = new UncategorizedImagesPage();
51 list( $limit, $offset ) = wfCheckLimits();
52 return $uip->doQuery( $offset, $limit );
53 }
54
55 ?>