* API: All pages list
[mediawiki.git] / includes / SpecialUncategorizedimages.php
blob3815697630d0cc807eedb30959b2a49aa0c10cc8
1 <?php
3 /**
4 * Special page lists images which haven't been categorised
6 * @package MediaWiki
7 * @subpackage Special pages
8 * @author Rob Church <robchur@gmail.com>
9 */
11 class UncategorizedImagesPage extends QueryPage {
13 function getName() {
14 return 'Uncategorizedimages';
17 function sortDescending() {
18 return false;
21 function isExpensive() {
22 return true;
25 function isSyndicated() {
26 return false;
29 function getSQL() {
30 $dbr =& wfGetDB( DB_SLAVE );
31 extract( $dbr->tableNames( 'page', 'categorylinks' ) );
32 $ns = NS_IMAGE;
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";
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 );
49 function wfSpecialUncategorizedimages() {
50 $uip = new UncategorizedImagesPage();
51 list( $limit, $offset ) = wfCheckLimits();
52 return $uip->doQuery( $offset, $limit );