Merge "Remove unused private field in OutputPage"
[lhc/web/wiklou.git] / includes / api / ApiUserrights.php
index 66af4c5..3ccdde2 100644 (file)
@@ -63,8 +63,8 @@ class ApiUserrights extends ApiBase {
                );
 
                $result = $this->getResult();
-               $result->setIndexedTagName( $r['added'], 'group' );
-               $result->setIndexedTagName( $r['removed'], 'group' );
+               ApiResult::setIndexedTagName( $r['added'], 'group' );
+               ApiResult::setIndexedTagName( $r['removed'], 'group' );
                $result->addValue( null, $this->getModuleName(), $r );
        }
 
@@ -119,28 +119,14 @@ class ApiUserrights extends ApiBase {
                        ),
                        'reason' => array(
                                ApiBase::PARAM_DFLT => ''
-                       )
-               );
-       }
-
-       public function getParamDescription() {
-               return array(
-                       'user' => 'User name',
-                       'userid' => 'User id',
-                       'add' => 'Add the user to these groups',
-                       'remove' => 'Remove the user from these groups',
+                       ),
                        'token' => array(
-                               /* Standard description automatically prepended */
-                               'For compatibility, the token used in the web UI is also accepted.'
+                               // Standard definition automatically inserted
+                               ApiBase::PARAM_HELP_MSG_APPEND => array( 'api-help-param-token-webui' ),
                        ),
-                       'reason' => 'Reason for the change',
                );
        }
 
-       public function getDescription() {
-               return 'Add/remove a user to/from groups.';
-       }
-
        public function needsToken() {
                return 'userrights';
        }
@@ -149,10 +135,12 @@ class ApiUserrights extends ApiBase {
                return $this->getUrUser( $params )->getName();
        }
 
-       public function getExamples() {
+       protected function getExamplesMessages() {
                return array(
-                       'api.php?action=userrights&user=FooBot&add=bot&remove=sysop|bureaucrat&token=123ABC',
-                       'api.php?action=userrights&userid=123&add=bot&remove=sysop|bureaucrat&token=123ABC'
+                       'action=userrights&user=FooBot&add=bot&remove=sysop|bureaucrat&token=123ABC'
+                               => 'apihelp-userrights-example-user',
+                       'action=userrights&userid=123&add=bot&remove=sysop|bureaucrat&token=123ABC'
+                               => 'apihelp-userrights-example-userid',
                );
        }