Use wfMessage() instead of wfMsgGetKey()
[lhc/web/wiklou.git] / includes / Pager.php
index 68acc51..bf613fd 100644 (file)
@@ -164,7 +164,7 @@ abstract class IndexPager implements Pager {
        }
 
        /**
-        * Return the result wrapper.
+        * @return ResultWrapper The result wrapper.
         */
        function getResult() {
                return $this->mResult;
@@ -195,7 +195,8 @@ abstract class IndexPager implements Pager {
                $numRows = $res->numRows();
                if ( $numRows ) {
                        # Remove any table prefix from index field
-                       $indexColumn = end( explode( '.', $this->mIndexField ) );
+                       $parts = explode( '.', $this->mIndexField );
+                       $indexColumn = end( $parts );
                        
                        $row = $res->fetchRow();
                        $firstIndex = $row[$indexColumn];
@@ -936,7 +937,9 @@ abstract class TablePager extends IndexPager {
        function getNavigationBar() {
                global $wgStylePath, $wgContLang;
 
-               if ( !$this->isNavigationBarShown() ) return '';
+               if ( !$this->isNavigationBarShown() ) {
+                       return '';
+               }
 
                $path = "$wgStylePath/common/images";
                $labels = array(
@@ -1044,20 +1047,26 @@ abstract class TablePager extends IndexPager {
        function getLimitForm() {
                global $wgScript;
 
+               return Xml::openElement(
+                       'form',
+                       array(
+                               'method' => 'get',
+                               'action' => $wgScript
+                       ) ) . "\n" . $this->getLimitDropdown() . "</form>\n";
+       }
+
+       /**
+        * Gets a limit selection dropdown
+        *
+        * @return string
+        */
+       function getLimitDropdown() {
                # Make the select with some explanatory text
                $msgSubmit = wfMsgHtml( 'table_pager_limit_submit' );
-               return
-                       Xml::openElement(
-                               'form',
-                               array(
-                                       'method' => 'get',
-                                       'action' => $wgScript
-                               )
-                       ) . "\n" .
-                       wfMsgHtml( 'table_pager_limit', $this->getLimitSelect() ) .
+
+               return wfMsgHtml( 'table_pager_limit', $this->getLimitSelect() ) .
                        "\n<input type=\"submit\" value=\"$msgSubmit\"/>\n" .
-                       $this->getHiddenFields( array( 'limit' ) ) .
-                       "</form>\n";
+                       $this->getHiddenFields( array( 'limit' ) );
        }
 
        /**