* Populate rev_parent_id
[lhc/web/wiklou.git] / includes / ProtectionForm.php
index 03e4c8c..0d2d88c 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 ) {
@@ -222,7 +227,7 @@ class ProtectionForm {
 
                $out .= Xml::openElement( 'fieldset' ) .
                        Xml::element( 'legend', null, wfMsg( 'protect-legend' ) ) .
-                       Xml::openElement( 'table', array( 'id' => 'mwProtectSet' ) );
+                       Xml::openElement( 'table', array( 'id' => 'mwProtectSet' ) ) .
                        Xml::openElement( 'tbody' ) .
                        "<tr>\n";
 
@@ -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>' .
@@ -368,12 +374,7 @@ class ProtectionForm {
        function showLogExtract( &$out ) {
                # Show relevant lines from the protection log:
                $out->addHTML( Xml::element( 'h2', null, LogPage::logName( 'protect' ) ) );
-               $logViewer = new LogViewer(
-                       new LogReader(
-                               new FauxRequest(
-                                       array( 'page' => $this->mTitle->getPrefixedText(),
-                                              'type' => 'protect' ) ) ) );
-               $logViewer->showList( $out );
+               LogEventsList::showLogExtract( $out, 'protect', $this->mTitle->getPrefixedText() );
        }
 
 }