Merge "Don't check namespace in SpecialWantedtemplates"
[lhc/web/wiklou.git] / includes / pager / TablePager.php
index 2218787..ea619f1 100644 (file)
@@ -42,9 +42,9 @@ abstract class TablePager extends IndexPager {
                        $this->mSort = $this->getDefaultSort();
                }
                if ( $this->getRequest()->getBool( 'asc' ) ) {
-                       $this->mDefaultDirection = false;
+                       $this->mDefaultDirection = IndexPager::DIR_ASCENDING;
                } elseif ( $this->getRequest()->getBool( 'desc' ) ) {
-                       $this->mDefaultDirection = true;
+                       $this->mDefaultDirection = IndexPager::DIR_DESCENDING;
                } /* Else leave it at whatever the class default is */
 
                parent::__construct();
@@ -128,7 +128,7 @@ abstract class TablePager extends IndexPager {
                                if ( $this->mSort == $field ) {
                                        // The table is sorted by this field already, make a link to sort in the other direction
                                        // We don't actually know in which direction other fields will be sorted by default…
-                                       if ( $this->mDefaultDirection ) {
+                                       if ( $this->mDefaultDirection == IndexPager::DIR_DESCENDING ) {
                                                $linkType = 'asc';
                                                $class = "$sortClass TablePager_sort-descending";
                                                $query['asc'] = '1';
@@ -233,6 +233,13 @@ abstract class TablePager extends IndexPager {
                }
        }
 
+       /**
+        * @return stdClass
+        */
+       protected function getCurrentRow() {
+               return $this->mCurrentRow;
+       }
+
        /**
         * Get any extra attributes to be applied to the given cell. Don't
         * take this as an excuse to hardcode styles; use classes and
@@ -402,13 +409,11 @@ abstract class TablePager extends IndexPager {
         * @return string HTML fragment
         */
        function getLimitForm() {
-               global $wgScript;
-
                return Html::rawElement(
                        'form',
                        array(
                                'method' => 'get',
-                               'action' => $wgScript
+                               'action' => wfScript(),
                        ),
                        "\n" . $this->getLimitDropdown()
                ) . "\n";