* (bug 15701) Protection form was too wide for some browsers as 2 columns, switching...
authorAlex Z <mrzman@users.mediawiki.org>
Thu, 25 Sep 2008 02:08:59 +0000 (02:08 +0000)
committerAlex Z <mrzman@users.mediawiki.org>
Thu, 25 Sep 2008 02:08:59 +0000 (02:08 +0000)
* Move the "unlock move permissions" checkbox to a more logical place with the options for move protection, instead of with the cascading checkbox.

includes/ProtectionForm.php
skins/common/protect.js

index 060fb59..8508831 100644 (file)
@@ -311,10 +311,11 @@ class ProtectionForm {
                        if( wfEmptyMsg( 'restriction-' . $action, $msg ) ) {
                                $msg = $action;
                        }
-                       $label = Xml::element( 'label', array( 'for' => "mwProtect-level-$action" ), $msg );
-                       $out .= "<tr><td><table>" .
-                               "<tr><th>$label</th><th></th></tr>" .
-                               "<tr><td>" . $this->buildSelector( $action, $selected ) . "</td><td>";
+                       $out .= "<tr><td>".
+                       Xml::openElement( 'fieldset' ) .
+                       Xml::element( 'legend', null, $msg ) .
+                       Xml::openElement( 'table', array( 'id' => "mw-protect-table-$action" ) ) .
+                               "<tr><td>" . $this->buildSelector( $action, $selected ) . "</td></tr><tr><td>";
 
                        $reasonDropDown = Xml::listDropDown( 'wpProtectReasonSelection',
                                wfMsgForContent( 'protect-dropdown' ),
@@ -377,7 +378,10 @@ class ProtectionForm {
                                                Xml::input( "mwProtect-expiry-$action", 50, $this->mExpiry[$action], $attribs ) .
                                        '</td>
                                </tr></table>';
-                       $out .= "</td></tr></table></td></tr>";
+                       $out .= "</td></tr>" .
+                       Xml::closeElement( 'table' ) .
+                       Xml::closeElement( 'fieldset' ) .
+                       "</td></tr>";
                }
 
                $out .= Xml::closeElement( 'tbody' ) . Xml::closeElement( 'table' );
@@ -519,7 +523,7 @@ class ProtectionForm {
                }
                $script .= "[" . implode(',',$CascadeableLevels) . "];\n";
                $options = (object)array(
-                       'tableId' => 'mw-protect-table2',
+                       'tableId' => 'mw-protect-table-move',
                        'labelText' => wfMsg( 'protect-unchain' ),
                        'numTypes' => count($this->mApplicableTypes),
                        'existingMatch' => 1 == count( array_unique( $this->mExistingExpiry ) ),
index ab1ea30..d9650c8 100644 (file)
@@ -19,14 +19,13 @@ var ProtectionForm = {
                var box = document.getElementById( opts.tableId );
                if( !box )
                        return false;
-
-               var tbody = box.getElementsByTagName( 'tbody' )[0];
+               
+               var boxbody = box.getElementsByTagName('tbody')[0]
                var row = document.createElement( 'tr' );
-               tbody.appendChild( row );
+               boxbody.insertBefore( row, boxbody.firstChild );
 
                this.existingMatch = opts.existingMatch;
 
-               row.appendChild( document.createElement( 'td' ) );
                var cell = document.createElement( 'td' );
                row.appendChild( cell );
                // If there is only one protection type, there is nothing to chain