Merge "Special:Allpages replace table with unordered list"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sat, 9 Aug 2014 19:06:54 +0000 (19:06 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 9 Aug 2014 19:06:54 +0000 (19:06 +0000)
1  2 
includes/specials/SpecialAllPages.php

@@@ -45,7 -45,7 +45,7 @@@ class SpecialAllPages extends Includabl
        /**
         * Constructor
         *
 -       * @param string $name name of the special page, as seen in links and URLs (default: 'Allpages')
 +       * @param string $name Name of the special page, as seen in links and URLs (default: 'Allpages')
         */
        function __construct( $name = 'Allpages' ) {
                parent::__construct( $name );
@@@ -54,7 -54,7 +54,7 @@@
        /**
         * Entry point : initialise variables and call subfunctions.
         *
 -       * @param string $par becomes "FOO" when called like Special:Allpages/FOO (default null)
 +       * @param string $par Becomes "FOO" when called like Special:Allpages/FOO (default null)
         */
        function execute( $par ) {
                $request = $this->getRequest();
                        );
  
                        if ( $res->numRows() > 0 ) {
-                               $out = Xml::openElement( 'table', array( 'class' => 'mw-allpages-table-chunk' ) );
+                               $out = Xml::openElement( 'ul', array( 'class' => 'mw-allpages-chunk' ) );
                                while ( ( $n < $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) {
                                        $t = Title::newFromRow( $s );
                                        if ( $t ) {
-                                               $link = ( $s->page_is_redirect ? '<div class="allpagesredirect">' : '' ) .
+                                               $out .= '<li' .
+                                                       ( $s->page_is_redirect ? ' class="allpagesredirect"' : '' ) .
+                                                       '>' .
                                                        Linker::link( $t ) .
-                                                       ( $s->page_is_redirect ? '</div>' : '' );
+                                                       "</li>\n";
                                        } else {
-                                               $link = '[[' . htmlspecialchars( $s->page_title ) . ']]';
+                                               $out .= '<li>[[' . htmlspecialchars( $s->page_title ) . "]]</li>\n";
                                        }
-                                       if ( $n % 3 == 0 ) {
-                                               $out .= '<tr>';
-                                       }
-                                       $out .= "<td style=\"width:33%\">$link</td>";
-                                       $n++;
-                                       if ( $n % 3 == 0 ) {
-                                               $out .= "</tr>\n";
-                                       }
-                               }
-                               if ( ( $n % 3 ) != 0 ) {
-                                       $out .= "</tr>\n";
                                }
-                               $out .= Xml::closeElement( 'table' );
+                               $out .= Xml::closeElement( 'ul' );
                        } else {
                                $out = '';
                        }