* Don't show hist link if hidden
[lhc/web/wiklou.git] / includes / SpecialCategories.php
index 6ffe65b..a653d2a 100644 (file)
@@ -17,25 +17,13 @@ function wfSpecialCategories() {
 }
 
 /**
+ * TODO: Allow sorting by count.  We need to have a unique index to do this
+ * properly.
+ *
  * @addtogroup SpecialPage
  * @addtogroup Pager
  */
 class CategoryPager extends AlphabeticPager {
-       private $mOrderType = 'abc';
-
-       public function __construct() {
-               parent::__construct();
-               if( $this->mRequest->getText( 'order' ) == 'count' ) {
-                       $this->mOrderType = 'count';
-               }
-               if( $this->mRequest->getText( 'direction' ) == 'asc' ) {
-                       $this->mDefaultDirection = false;
-               } elseif( $this->mRequest->getText( 'direction' ) == 'desc'
-               || $this->mOrderType == 'count' ) {
-                       $this->mDefaultDirection = true;
-               }
-       }
-
        function getQueryInfo() {
                global $wgRequest;
                return array(
@@ -46,13 +34,18 @@ class CategoryPager extends AlphabeticPager {
        }
        
        function getIndexField() {
-               # We can't use mOrderType here, since this is called from the parent
-               # constructor.  Hmm.
-               if( $this->mRequest->getText( 'order' ) == 'count' ) {
-                       return 'cat_pages';
-               } else {
-                       return "cat_title";
-               }
+#              return array( 'abc' => 'cat_title', 'count' => 'cat_pages' );
+               return 'cat_title';
+       }
+
+#      protected function getOrderTypeMessages() {
+#              return array( 'abc' => 'special-categories-sort-abc',
+#                      'count' => 'special-categories-sort-count' );
+#      }
+
+       protected function getDefaultDirections() {
+#              return array( 'abc' => false, 'count' => true );
+               return false;
        }
        
        /* Override getBody to apply LinksBatch on resultset before actually outputting anything. */
@@ -80,39 +73,6 @@ class CategoryPager extends AlphabeticPager {
                                $wgLang->formatNum( $result->cat_pages ) );
                return Xml::tags('li', null, "$titleText ($count)" ) . "\n";
        }
-
-       /** Override this to order by count */
-       public function getNavigationBar() {
-               $nav = parent::getNavigationBar() . ' (';
-               if( $this->mOrderType == 'abc' ) {
-                       $nav .= $this->makeLink(
-                               wfMsgHTML( 'special-categories-sort-count' ),
-                               array( 'order' => 'count' )
-                       );
-               } else {
-                       $nav .= $this->makeLink(
-                               wfMsgHTML( 'special-categories-sort-abc' ),
-                               array( 'order' => 'abc' )
-                       );
-               }
-               $nav .= ') (';
-               # FIXME, these are stupid query names.  "order" and "dir" are already
-               # used.
-               if( $this->mDefaultDirection ) {
-                       # Descending
-                       $nav .= $this->makeLink(
-                               wfMsgHTML( 'special-categories-sort-asc' ),
-                               array( 'direction' => 'asc' )
-                       );
-               } else {
-                       $nav .= $this->makeLink(
-                               wfMsgHTML( 'special-categories-sort-desc' ),
-                               array( 'direction' => 'desc' )
-                       );
-               }
-               $nav .= ')';
-               return $nav;
-       }
 }