* Add a CSS id to the 2nd table
authorRaimond Spekking <raymond@users.mediawiki.org>
Thu, 13 Mar 2008 10:05:11 +0000 (10:05 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Thu, 13 Mar 2008 10:05:11 +0000 (10:05 +0000)
* Prettify input form for RTL wikis a bit

includes/ProtectionForm.php

index 03e4c8c..bd16063 100644 (file)
@@ -208,8 +208,13 @@ class ProtectionForm {
                return $ok;
        }
 
+       /**
+        * Build the input form
+        *
+        * @return $out string HTML form
+        */
        function buildForm() {
-               global $wgUser;
+               global $wgUser, $wgContLang;
 
                $out = '';
                if( !$this->disabled ) {
@@ -243,7 +248,7 @@ class ProtectionForm {
 
                $out .= Xml::closeElement( 'tbody' ) .
                        Xml::closeElement( 'table' ) .
-                       Xml::openElement( 'table' ) .
+                       Xml::openElement( 'table', array( 'id' => 'mw-protect-table2' ) ) .
                        Xml::openElement( 'tbody' );
 
                global $wgEnableCascadingProtection;
@@ -257,8 +262,9 @@ class ProtectionForm {
                }
 
                $attribs = array( 'id' => 'expires' ) + $this->disabledAttrib;
-               $out .= '<tr>
-                               <td>' .
+               $align = $wgContLang->isRtl() ? 'left' : 'right';
+               $out .= "<tr>
+                               <td align='$align'>" .
                                        Xml::label( wfMsgExt( 'protectexpiry', array( 'parseinline' ) ), 'expires' ) .
                                '</td>
                                <td>' .
@@ -269,7 +275,7 @@ class ProtectionForm {
                if( !$this->disabled ) {
                        $id = 'mwProtect-reason';
                        $out .= "<tr>
-                                       <td>" .
+                                       <td align='$align'>" .
                                                Xml::label( wfMsg( 'protectcomment' ), $id ) .
                                        '</td>
                                        <td>' .