Follow-up to r90265: directionality improvements as part of bug 6100 (under $wgBetter...
[lhc/web/wiklou.git] / includes / Pager.php
index 8eb6c7c..3d87eb7 100644 (file)
@@ -93,6 +93,8 @@ abstract class IndexPager implements Pager {
 
        /**
         * Result object for the query. Warning: seek before use.
+        *
+        * @var ResultWrapper
         */
        public $mResult;
 
@@ -415,8 +417,10 @@ abstract class IndexPager implements Pager {
         * @return Associative array
         */
        function getDefaultQuery() {
+               global $wgRequest;
+
                if ( !isset( $this->mDefaultQuery ) ) {
-                       $this->mDefaultQuery = $_GET;
+                       $this->mDefaultQuery = $wgRequest->getQueryValues();
                        unset( $this->mDefaultQuery['title'] );
                        unset( $this->mDefaultQuery['dir'] );
                        unset( $this->mDefaultQuery['offset'] );
@@ -941,7 +945,7 @@ abstract class TablePager extends IndexPager {
         * A navigation bar with images
         */
        function getNavigationBar() {
-               global $wgStylePath, $wgContLang;
+               global $wgStylePath, $wgContLang, $wgLang, $wgBetterDirectionality;
 
                if ( !$this->isNavigationBarShown() ) {
                        return '';
@@ -966,7 +970,8 @@ abstract class TablePager extends IndexPager {
                        'next' => 'arrow_disabled_right_25.png',
                        'last' => 'arrow_disabled_last_25.png',
                );
-               if( $wgContLang->isRTL() ) {
+               $isRTL = ( $wgBetterDirectionality ? $wgLang->isRTL() : $wgContLang->isRTL() );
+               if( $isRTL ) {
                        $keys = array_keys( $labels );
                        $images = array_combine( $keys, array_reverse( $images ) );
                        $disabledImages = array_combine( $keys, array_reverse( $disabledImages ) );
@@ -1025,14 +1030,16 @@ abstract class TablePager extends IndexPager {
 
        /**
         * Get <input type="hidden"> elements for use in a method="get" form.
-        * Resubmits all defined elements of the $_GET array, except for a
+        * Resubmits all defined elements of the query string, except for a
         * blacklist, passed in the $blacklist parameter.
         *
         * @return String: HTML fragment
         */
        function getHiddenFields( $blacklist = array() ) {
+               global $wgRequest;
+
                $blacklist = (array)$blacklist;
-               $query = $_GET;
+               $query = $wgRequest->getQueryValues();
                foreach ( $blacklist as $name ) {
                        unset( $query[$name] );
                }