MediaWiki
REL1_19
|
00001 <?php 00029 // @todo FIXME: Make $requestedNamespace selectable, unify all subclasses into one 00030 class UncategorizedPagesPage extends PageQueryPage { 00031 protected $requestedNamespace = false; 00032 00033 function __construct( $name = 'Uncategorizedpages' ) { 00034 parent::__construct( $name ); 00035 } 00036 00037 function sortDescending() { 00038 return false; 00039 } 00040 00041 function isExpensive() { 00042 return true; 00043 } 00044 function isSyndicated() { return false; } 00045 00046 function getQueryInfo() { 00047 return array ( 00048 'tables' => array ( 'page', 'categorylinks' ), 00049 'fields' => array ( 'page_namespace AS namespace', 00050 'page_title AS title', 00051 'page_title AS value' ), 00052 // default for page_namespace is all content namespaces (if requestedNamespace is false) 00053 // otherwise, page_namespace is requestedNamespace 00054 'conds' => array ( 'cl_from IS NULL', 00055 'page_namespace' => ( $this->requestedNamespace!==false ? $this->requestedNamespace : MWNamespace::getContentNamespaces() ), 00056 'page_is_redirect' => 0 ), 00057 'join_conds' => array ( 'categorylinks' => array ( 00058 'LEFT JOIN', 'cl_from = page_id' ) ) 00059 ); 00060 } 00061 00062 function getOrderFields() { 00063 // For some crazy reason ordering by a constant 00064 // causes a filesort 00065 if( $this->requestedNamespace === false && count( MWNamespace::getContentNamespaces() ) > 1 ) 00066 return array( 'page_namespace', 'page_title' ); 00067 return array( 'page_title' ); 00068 } 00069 }