a slightly less huge margin and padding.
* (bug 13527) Use sitemaps.org format 0.9 instead of a Google-specific format
* Allow \C and \Q as TeX commands to match \R, \N, \Z
+* On Special:UserRights, when you can add a group you can't remove or remove
+ one you can't add, a notice is printed to warn you
=== Bug fixes in 1.13 ===
* Properly escape search terms with regex chars so they appear highlighted in
search results
* (bug 13768) pt_title field encoding fixed
+* Do not display empty columns on Special:UserRights if all groups are
+ changeable or all unchangeable
=== API changes in 1.13 ===
foreach ($allgroups as $group) {
$set = in_array( $group, $usergroups );
+ # Should the checkbox be disabled?
$disabled = !(
( $set && $this->canRemove( $group ) ) ||
( !$set && $this->canAdd( $group ) ) );
+ # Do we need to point out that this action is irreversible?
+ $irreversible = !$disabled && (
+ ($set && !$this->canAdd( $group )) ||
+ (!$set && !$this->canRemove( $group ) ) );
$attr = $disabled ? array( 'disabled' => 'disabled' ) : array();
- $checkbox = Xml::checkLabel( User::getGroupMember( $group ), "wpGroup-$group",
- "wpGroup-$group", $set, $attr );
+ $text = $irreversible
+ ? wfMsgHtml( 'userrights-irreversible-marker', User::getGroupMember( $group ) )
+ : User::getGroupMember( $group );
+ $checkbox = Xml::checkLabel( $text, "wpGroup-$group",
+ "wpGroup-$group", $set, $attr );
$checkbox = $disabled ? Xml::tags( 'span', array( 'class' => 'mw-userrights-disabled' ), $checkbox ) : $checkbox;
if ($disabled) {
if ($column) {
$ret .= Xml::openElement( 'table', array( 'border' => '0', 'class' => 'mw-userrights-groups' ) ) .
- "<tr>" .
- xml::element( 'th', null, wfMsg( 'userrights-changeable-col' ) ) .
- xml::element( 'th', null, wfMsg( 'userrights-unchangeable-col' ) ) .
- "</tr>
+ "<tr>
+";
+ if( $settable_col !== '' ) {
+ $ret .= xml::element( 'th', null, wfMsg( 'userrights-changeable-col' ) );
+ }
+ if( $unsettable_col !== '' ) {
+ $ret .= xml::element( 'th', null, wfMsg( 'userrights-unchangeable-col' ) );
+ }
+ $ret.= "</tr>
<tr>
- <td style='vertical-align:top;'>
+";
+ if( $settable_col !== '' ) {
+ $ret .=
+" <td style='vertical-align:top;'>
$settable_col
</td>
- <td style='vertical-align:top;'>
+";
+ }
+ if( $unsettable_col !== '' ) {
+ $ret .=
+" <td style='vertical-align:top;'>
$unsettable_col
</td>
- </tr>" .
- Xml::closeElement( 'table' );
+ </tr>";
+ }
+ $ret .= Xml::closeElement( 'table' );
}
return $ret;
'userrights-groupsavailable' => 'Available groups:',
'userrights-groups-help' => 'You may alter the groups this user is in.
A checked box means the user is in that group.
-An unchecked box means the user is not in that group.',
+An unchecked box means the user is not in that group.
+A * indicates that you cannot remove the group once you have added it, or vice versa.',
'userrights-reason' => 'Reason for change:',
'userrights-available-none' => 'You may not alter group membership.',
'userrights-available-add' => 'You can add any user to {{PLURAL:$2|this group|these groups}}: $1.',
'userrights-notallowed' => 'Your account does not have permission to assign user rights.',
'userrights-changeable-col' => 'Groups you can change',
'userrights-unchangeable-col' => 'Groups you cannot change',
+'userrights-irreversible-marker' => '$1*', # only translate this message to other languages if you have to change it
# Groups
'group' => 'Group:',