Ditch over-verbose "statement of rights" in Special:Userrights; this isn't a sodding...
authorRob Church <robchurch@users.mediawiki.org>
Sat, 30 Jun 2007 04:04:34 +0000 (04:04 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Sat, 30 Jun 2007 04:04:34 +0000 (04:04 +0000)
includes/SpecialUserrights.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index 0558265..57b43c3 100644 (file)
@@ -229,12 +229,26 @@ class UserrightsForm extends HTMLForm {
        }
 
        /**
-        * Explains what groups the user can add and remove, and why.
+        * Prepare a list of groups the user is able to add and remove
         *
-        * @return string Explanatory sanitized HTML message
+        * @return string
         */
        private function explainRights() {
-               global $wgUser;
+               global $wgUser, $wgLang;
+               
+               $out = array();
+               list( $add, $remove ) = array_values( $this->changeableGroups() );
+               
+               if( count( $add ) > 0 )
+                       $out[] = wfMsgExt( 'userrights-available-add', 'parseinline', $wgLang->listToText( $add ) );
+               if( count( $remove ) > 0 )
+                       $out[] = wfMsgExt( 'userrights-available-remove', 'parseinline', $wgLang->listToText( $remove ) );
+                       
+               return count( $out ) > 0
+                       ? implode( ' ', $out )
+                       : wfMsgExt( 'userrights-available-none', 'parseinline' );
+               
+               
                $groups = $wgUser->getEffectiveGroups();
                foreach( $groups as $group ) {
                        if( $this->changeableByGroup( $group ) == array(
@@ -248,6 +262,8 @@ class UserrightsForm extends HTMLForm {
                $grouplists = array( $groups );
                list( $grouplists[1], $grouplists[2] ) = array_values( $this->changeableGroups() );
                
+               
+               
                // Now format them nicely for display (yay mutable variables? I'm sick
                // of thinking up new names)
                foreach( $grouplists as &$list ) {
index 5d37f18..6d07492 100644 (file)
@@ -1273,10 +1273,9 @@ containing all of the search terms will appear in the result).",
 'userrights-groupshelp'      => 'Select groups you want the user to be removed from or added to.
 Unselected groups will not be changed. You can deselect a group with CTRL + Left Click',
 'userrights-reason'          => 'Reason for change:',
-'userrights-list'            => 'Because you are a member of $1, you can add $2 and remove $3.',
-'userrights-list-nogroups'   => 'no groups',
-'userrights-list-groups'     => 'the {{PLURAL:$1|group|groups}} $2',
-'userrights-list-separator'  => ', ', # only translate this message to other languages if you have to change it
+'userrights-available-none' => 'You may not alter group membership.',
+'userrights-available-add' => 'You can add users to $1.',
+'userrights-available-remove' => 'You can remove users from $1.',
 
 # Groups
 'group'            => 'Group:',
index 7e14258..8aa4d28 100644 (file)
@@ -693,10 +693,9 @@ $wgMessageStructure = array(
                'userrights-groupsavailable',
                'userrights-groupshelp',
                'userrights-reason',
-               'userrights-list',
-               'userrights-list-nogroups',
-               'userrights-list-groups',
-               'userrights-list-separator',
+               'userrights-available-none',
+               'userrights-available-add',
+               'userrights-available-remove',
        ),
        'group' => array(
                'group',