* Special:AllPages: Move hardcoded styles from code to CSS
authorRaimond Spekking <raymond@users.mediawiki.org>
Wed, 15 Apr 2009 09:36:53 +0000 (09:36 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Wed, 15 Apr 2009 09:36:53 +0000 (09:36 +0000)
RELEASE-NOTES
includes/DefaultSettings.php
includes/specials/SpecialAllpages.php
skins/common/shared.css
skins/modern/rtl.css
skins/monobook/rtl.css
skins/simple/rtl.css

index 223ac7e..0092726 100644 (file)
@@ -164,6 +164,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Added new hook 'MessageCacheReplace' into MessageCache.php. For instance 
   to allow extensions to update caches in similar way as MediaWiki invalidates
   a cached MonoBook sidebar
+* Special:AllPages: Move hardcoded styles from code to CSS
 
 === Bug fixes in 1.15 ===
 * (bug 16968) Special:Upload no longer throws useless warnings.
index ee97f32..86d855c 100644 (file)
@@ -1477,7 +1477,7 @@ $wgCacheEpoch = '20030516000000';
  * to ensure that client-side caches don't keep obsolete copies of global
  * styles.
  */
-$wgStyleVersion = '210';
+$wgStyleVersion = '211';
 
 
 # Server-side caching:
index bded883..ad46d29 100644 (file)
@@ -114,8 +114,7 @@ class SpecialAllpages extends IncludableSpecialPage {
         * @param integer $namespace (default NS_MAIN)
         */
        function showToplevel( $namespace = NS_MAIN, $from = '', $to = '' ) {
-               global $wgOut, $wgContLang;
-               $align = $wgContLang->isRtl() ? 'left' : 'right';
+               global $wgOut;
 
                # TODO: Either make this *much* faster or cache the title index points
                # in the querycache table.
@@ -198,13 +197,13 @@ class SpecialAllpages extends IncludableSpecialPage {
                }
 
                # At this point, $lines should contain an even number of elements.
-               $out .= "<table class='allpageslist' style='background: inherit;'>";
+               $out .= Xml::openElement( 'table', array( 'class' => 'allpageslist' ) );
                while( count ( $lines ) > 0 ) {
                        $inpoint = array_shift( $lines );
                        $outpoint = array_shift( $lines );
                        $out .= $this->showline( $inpoint, $outpoint, $namespace );
                }
-               $out .= '</table>';
+               $out .= Xml::closeElement( 'table' );
                $nsForm = $this->namespaceForm( $namespace, $from, $to );
 
                # Is there more?
@@ -213,11 +212,17 @@ class SpecialAllpages extends IncludableSpecialPage {
                } else {
                        if( isset($from) || isset($to) ) {
                                global $wgUser;
-                               $out2 = '<table style="background: inherit;" width="100%" cellpadding="0" cellspacing="0" border="0">';
-                               $out2 .= '<tr valign="top"><td>' . $nsForm;
-                               $out2 .= '</td><td align="' . $align . '" style="font-size: smaller; margin-bottom: 1em;">' .
-                                       $wgUser->getSkin()->makeKnownLinkObj( $this->getTitle(), wfMsgHtml ( 'allpages' ) );
-                               $out2 .= "</td></tr></table>";
+                               $out2 = Xml::openElement( 'table', array( 'class' => 'mw-allpages-table-form' ) ).
+                                               '<tr>
+                                                       <td>' .
+                                                               $nsForm .
+                                                       '</td>
+                                                       <td class="mw-allpages-nav">' .
+                                                               $wgUser->getSkin()->link( $this->getTitle(), wfMsgHtml ( 'allpages' ),
+                                                                       array(), array(), 'known' ) .
+                                                       "</td>
+                                               </tr>" .
+                                       Xml::closeElement( 'table' );
                        } else {
                                $out2 = $nsForm;
                        }
@@ -233,7 +238,6 @@ class SpecialAllpages extends IncludableSpecialPage {
         */
        function showline( $inpoint, $outpoint, $namespace = NS_MAIN ) {
                global $wgContLang;
-               $align = $wgContLang->isRtl() ? 'left' : 'right';
                $inpointf = htmlspecialchars( str_replace( '_', ' ', $inpoint ) );
                $outpointf = htmlspecialchars( str_replace( '_', ' ', $outpoint ) );
                // Don't let the length runaway
@@ -248,7 +252,7 @@ class SpecialAllpages extends IncludableSpecialPage {
                        "<a href=\"$link\">$inpointf</a></td><td>",
                        "</td><td><a href=\"$link\">$outpointf</a>"
                );
-               return '<tr><td align="' . $align . '">'.$out.'</td></tr>';
+               return '<tr><td class="mw-allpages-nav">' . $out . '</td></tr>';
        }
 
        /**
@@ -264,8 +268,6 @@ class SpecialAllpages extends IncludableSpecialPage {
                $fromList = $this->getNamespaceKeyAndText($namespace, $from);
                $toList = $this->getNamespaceKeyAndText( $namespace, $to );
                $namespaces = $wgContLang->getNamespaces();
-               $align = $wgContLang->isRtl() ? 'left' : 'right';
-
                $n = 0;
 
                if ( !$fromList || !$toList ) {
@@ -299,8 +301,7 @@ class SpecialAllpages extends IncludableSpecialPage {
                        );
 
                        if( $res->numRows() > 0 ) {
-                               $out = '<table style="background: inherit;" border="0" width="100%">';
-
+                               $out = Xml::openElement( 'table', array( 'class' => 'mw-allpages-table-chunk' ) );
                                while( ( $n < $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) {
                                        $t = Title::makeTitle( $s->page_namespace, $s->page_title );
                                        if( $t ) {
@@ -316,13 +317,13 @@ class SpecialAllpages extends IncludableSpecialPage {
                                        $out .= "<td width=\"33%\">$link</td>";
                                        $n++;
                                        if( $n % 3 == 0 ) {
-                                               $out .= '</tr>';
+                                               $out .= "</tr>\n";
                                        }
                                }
                                if( ($n % 3) != 0 ) {
-                                       $out .= '</tr>';
+                                       $out .= "</tr>\n";
                                }
-                               $out .= '</table>';
+                               $out .= Xml::closeElement( 'table' );
                        } else {
                                $out = '';
                        }
@@ -370,11 +371,13 @@ class SpecialAllpages extends IncludableSpecialPage {
                        $self = $this->getTitle();
 
                        $nsForm = $this->namespaceForm( $namespace, $from, $to );
-                       $out2 = '<table style="background: inherit;" width="100%" cellpadding="0" cellspacing="0" border="0">';
-                       $out2 .= '<tr valign="top"><td>' . $nsForm;
-                       $out2 .= '</td><td align="' . $align . '" style="font-size: smaller; margin-bottom: 1em;">' .
-                                       $sk->makeKnownLinkObj( $self,
-                                               wfMsgHtml ( 'allpages' ) );
+                       $out2 = Xml::openElement( 'table', array( 'class' => 'mw-allpages-table-form' ) ).
+                                               '<tr>
+                                                       <td>' .
+                                                               $nsForm .
+                                                       '</td>
+                                                       <td class="mw-allpages-nav">' .
+                                                               $sk->link( $self, wfMsgHtml ( 'allpages' ), array(), array(), 'known' );
 
                        # Do we put a previous link ?
                        if( isset( $prevTitle ) &&  $pt = $prevTitle->getText() ) {
@@ -399,7 +402,7 @@ class SpecialAllpages extends IncludableSpecialPage {
 
                $wgOut->addHTML( $out2 . $out );
                if( isset($prevLink) or isset($nextLink) ) {
-                       $wgOut->addHTML( '<hr /><p style="font-size: smaller; float: ' . $align . '">' );
+                       $wgOut->addHTML( '<hr /><p class="mw-allpages-nav">' );
                        if( isset( $prevLink ) ) {
                                $wgOut->addHTML( $prevLink );
                        }
index c7eca9c..31b5df3 100644 (file)
@@ -300,6 +300,23 @@ td#mw-emailuser-sender, td#mw-emailuser-recipient {
        font-weight: bold;
 }
 
+/* Special:Allpages styling */
+table.allpageslist {
+       background-color: transparent;
+}
+table.mw-allpages-table-form, table.mw-allpages-table-chunk {
+       background-color: transparent;
+       width: 100%;
+}
+td.mw-allpages-nav, p.mw-allpages-nav {
+       text-align: right;
+       font-size: smaller;
+       margin-bottom: 1em;
+}
+table.mw-allpages-table-form tr  {
+       vertical-align: top;
+}
+
 /* Special:Prefixindex styling */
 table#mw-prefixindex-list-table,
 table#mw-prefixindex-nav-table {
index d2dcace..ab22827 100644 (file)
@@ -152,6 +152,10 @@ html > body div#mw_contentholder ul#filetoc {
        display: block;
 }
 
+/* Special:Allpages styling */
+td.mw-allpages-nav, p.mw-allpages-nav {
+       text-align: left;
+
 /* Special:Prefixindex styling */
 td#mw-prefixindex-nav-form  {
        text-align: left;
index 9b8e4f4..19e5e9d 100644 (file)
@@ -240,6 +240,11 @@ html > body div#bodyContent ul {
 html > body div#bodyContent ul#filetoc {
        display: block;
 }
+
+/* Special:Allpages styling */
+td.mw-allpages-nav, p.mw-allpages-nav {
+       text-align: left;
+
 /* Special:Prefixindex styling */
 td#mw-prefixindex-nav-form  {
        text-align: left;
index 53b3dc0..d49ef01 100644 (file)
@@ -174,6 +174,11 @@ table.filehistory th {
 html > body div#bodyContent ul {
        display: table;
 }
+
+/* Special:Allpages styling */
+td.mw-allpages-nav, p.mw-allpages-nav {
+       text-align: left;
+
 /* Special:Prefixindex styling */
 td#mw-prefixindex-nav-form  {
        text-align: left;