Merge "Add a hook into LanguageConverter#getPreferredVariant() to allow extensions...
[lhc/web/wiklou.git] / includes / specials / SpecialUserrights.php
index 0a712ef..fd066ac 100644 (file)
@@ -761,7 +761,7 @@ class UserrightsPage extends SpecialPage {
        /**
         * Adds a table with checkboxes where you can select what groups to add/remove
         *
-        * @param array $usergroups Associative array of (group name as string =>
+        * @param UserGroupMembership[] $usergroups Associative array of (group name as string =>
         *   UserGroupMembership object) for groups the user belongs to
         * @param User $user
         * @return Array with 2 elements: the XHTML table element with checkxboes, and
@@ -835,7 +835,10 @@ class UserrightsPage extends SpecialPage {
                        }
                        $ret .= "\t<td style='vertical-align:top;'>\n";
                        foreach ( $column as $group => $checkbox ) {
-                               $attr = $checkbox['disabled'] ? [ 'disabled' => 'disabled' ] : [];
+                               $attr = [ 'class' => 'mw-userrights-groupcheckbox' ];
+                               if ( $checkbox['disabled'] ) {
+                                       $attr['disabled'] = 'disabled';
+                               }
 
                                $member = UserGroupMembership::getGroupMemberName( $group, $user->getName() );
                                if ( $checkbox['irreversible'] ) {
@@ -847,10 +850,6 @@ class UserrightsPage extends SpecialPage {
                                }
                                $checkboxHtml = Xml::checkLabel( $text, "wpGroup-" . $group,
                                        "wpGroup-" . $group, $checkbox['set'], $attr );
-                               $ret .= "\t\t" . ( ( $checkbox['disabled'] && $checkbox['disabled-expiry'] )
-                                       ? Xml::tags( 'div', [ 'class' => 'mw-userrights-disabled' ], $checkboxHtml )
-                                       : Xml::tags( 'div', [], $checkboxHtml )
-                               ) . "\n";
 
                                if ( $this->canProcessExpiries() ) {
                                        $uiUser = $this->getUser();
@@ -920,7 +919,10 @@ class UserrightsPage extends SpecialPage {
                                                $expiryHtml .= $expiryFormOptions->getHTML() . '<br />';
 
                                                // Add custom expiry field
-                                               $attribs = [ 'id' => "mw-input-wpExpiry-$group-other" ];
+                                               $attribs = [
+                                                       'id' => "mw-input-wpExpiry-$group-other",
+                                                       'class' => 'mw-userrights-expiryfield',
+                                               ];
                                                if ( $checkbox['disabled-expiry'] ) {
                                                        $attribs['disabled'] = 'disabled';
                                                }
@@ -939,8 +941,12 @@ class UserrightsPage extends SpecialPage {
                                                'id' => "mw-userrights-nested-wpGroup-$group",
                                                'class' => 'mw-userrights-nested',
                                        ];
-                                       $ret .= "\t\t\t" . Xml::tags( 'div', $divAttribs, $expiryHtml ) . "\n";
+                                       $checkboxHtml .= "\t\t\t" . Xml::tags( 'div', $divAttribs, $expiryHtml ) . "\n";
                                }
+                               $ret .= "\t\t" . ( ( $checkbox['disabled'] && $checkbox['disabled-expiry'] )
+                                       ? Xml::tags( 'div', [ 'class' => 'mw-userrights-disabled' ], $checkboxHtml )
+                                       : Xml::tags( 'div', [], $checkboxHtml )
+                               ) . "\n";
                        }
                        $ret .= "\t</td>\n";
                }