* (bug 7405) Make Linker methods static. Patch by Dan Li.
[lhc/web/wiklou.git] / includes / QueryPage.php
index 8377d99..f7b9d1a 100644 (file)
@@ -4,11 +4,6 @@
  * @package MediaWiki
  */
 
-/**
- *
- */
-require_once 'Feed.php';
-
 /**
  * List of query page classes and their associated special pages, for periodic update purposes
  */
@@ -35,6 +30,7 @@ $wgQueryPages = array(
        array( 'ShortPagesPage',                'Shortpages'                    ),
        array( 'UncategorizedCategoriesPage',   'Uncategorizedcategories'       ),
        array( 'UncategorizedPagesPage',        'Uncategorizedpages'            ),
+       array( 'UncategorizedImagesPage', 'Uncategorizedimages' ),
        array( 'UnusedCategoriesPage',          'Unusedcategories'              ),
        array( 'UnusedimagesPage',              'Unusedimages'                  ),
        array( 'WantedCategoriesPage',          'Wantedcategories'              ),
@@ -56,21 +52,21 @@ if ( !$wgDisableCounters )
  *
  * @package MediaWiki
  */
-abstract class QueryPage {
+class QueryPage {
        /**
         * Whether or not we want plain listoutput rather than an ordered list
         *
         * @var bool
         */
-       private $listoutput = false;
+       var $listoutput = false;
        
        /**
         * The offset and limit in use, as passed to the query() function
         *
         * @var integer
         */
-       protected $offset = 0;
-       protected $limit = 0;
+       var $offset = 0;
+       var $limit = 0;
 
        /**
         * A mutator for $this->listoutput;
@@ -96,7 +92,7 @@ abstract class QueryPage {
         * @return Title
         */
        function getTitle() {
-               return Title::makeTitle( NS_SPECIAL, $this->getName() );
+               return SpecialPage::getTitleFor( $this->getName() );
        }
 
        /**
@@ -160,12 +156,11 @@ abstract class QueryPage {
        }
 
        /**
-        * Formats the results of the query for display. The skin is the current
-        * skin; you can use it for making links. The result is a single row of
-        * result data. You should be able to grab SQL results off of it.
+        * Formats the results of the query for display. The result is a single
+        * row of result data. You should be able to grab SQL results off of it.
         * If the function return "false", the line output will be skipped.
         */
-       function formatResult( $skin, $result ) {
+       function formatResult( $result ) {
                return '';
        }
 
@@ -279,7 +274,7 @@ abstract class QueryPage {
         * @param $shownavigation show navigation like "next 200"?
         */
        function doQuery( $offset, $limit, $shownavigation=true ) {
-               global $wgUser, $wgOut, $wgLang, $wgContLang;
+               global $wgOut, $wgLang, $wgContLang;
 
                $this->offset = $offset;
                $this->limit = $limit;
@@ -325,8 +320,6 @@ abstract class QueryPage {
 
                $this->preprocessResults( $dbr, $res );
 
-               $sk = $wgUser->getSkin( );
-
                if($shownavigation) {
                        $wgOut->addHTML( $this->getPageHeader() );
                        $top = wfShowingResults( $offset, $num);
@@ -347,7 +340,7 @@ abstract class QueryPage {
 
                        # Only read at most $num rows, because $res may contain the whole 1000
                        for ( $i = 0; $i < $num && $obj = $dbr->fetchObject( $res ); $i++ ) {
-                               $format = $this->formatResult( $sk, $obj );
+                               $format = $this->formatResult( $obj );
                                if ( $format ) {
                                        $attr = ( isset ( $obj->usepatrol ) && $obj->usepatrol &&
                                                                                $obj->patrolled == 0 ) ? ' class="not-patrolled"' : '';
@@ -358,7 +351,7 @@ abstract class QueryPage {
                        if($this->tryLastResult()) {
                                // flush the very last result
                                $obj = null;
-                               $format = $this->formatResult( $sk, $obj );
+                               $format = $this->formatResult( $obj );
                                if( $format ) {
                                        $attr = ( isset ( $obj->usepatrol ) && $obj->usepatrol &&
                                                                                $obj->patrolled == 0 ) ? ' class="not-patrolled"' : '';
@@ -452,10 +445,10 @@ abstract class QueryPage {
        }
 
        function feedTitle() {
-               global $wgLanguageCode, $wgSitename;
+               global $wgContLanguageCode, $wgSitename;
                $page = SpecialPage::getPage( $this->getName() );
                $desc = $page->getDescription();
-               return "$wgSitename - $desc [$wgLanguageCode]";
+               return "$wgSitename - $desc [$wgContLanguageCode]";
        }
 
        function feedDesc() {
@@ -463,7 +456,7 @@ abstract class QueryPage {
        }
 
        function feedUrl() {
-               $title = Title::MakeTitle( NS_SPECIAL, $this->getName() );
+               $title = SpecialPage::getTitleFor( $this->getName() );
                return $title->getFullURL();
        }
 }
@@ -477,10 +470,10 @@ abstract class QueryPage {
  */
 class PageQueryPage extends QueryPage {
 
-       function formatResult( $skin, $result ) {
+       function formatResult( $result ) {
                global $wgContLang;
                $nt = Title::makeTitle( $result->namespace, $result->title );
-               return $skin->makeKnownLinkObj( $nt, htmlspecialchars( $wgContLang->convert( $nt->getPrefixedText() ) ) );
+               return Linker::makeKnownLinkObj( $nt, htmlspecialchars( $wgContLang->convert( $nt->getPrefixedText() ) ) );
        }
 }