Checking permissions for $wgUser while doing an edit with another user is not a good...
[lhc/web/wiklou.git] / includes / api / ApiParamInfo.php
index 8770bd4..450191e 100644 (file)
@@ -1,10 +1,9 @@
 <?php
-
 /**
- * Created on Dec 01, 2007
- *
  * API for MediaWiki 1.8+
  *
+ * Created on Dec 01, 2007
+ *
  * Copyright © 2008 Roan Kattouw <Firstname>.<Lastname>@home.nl
  *
  * This program is free software; you can redistribute it and/or modify
  *
  * You should have received a copy of the GNU General Public License along
  * with this program; if not, write to the Free Software Foundation, Inc.,
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
  */
 
 if ( !defined( 'MEDIAWIKI' ) ) {
@@ -118,6 +119,10 @@ class ApiParamInfo extends ApiBase {
                        if ( isset( $p[ApiBase::PARAM_DEPRECATED] ) && $p[ApiBase::PARAM_DEPRECATED] ) {
                                $a['deprecated'] = '';
                        }
+                       if ( isset( $p[ApiBase::PARAM_REQUIRED] ) && $p[ApiBase::PARAM_REQUIRED] ) {
+                               $a['required'] = '';
+                       }
+
                        if ( !is_array( $p ) ) {
                                if ( is_bool( $p ) ) {
                                        $a['type'] = 'bool';
@@ -136,19 +141,15 @@ class ApiParamInfo extends ApiBase {
                        if ( isset( $p[ApiBase::PARAM_DFLT] ) ) {
                                $a['default'] = $p[ApiBase::PARAM_DFLT];
                        }
-                       if ( isset( $p[ApiBase::PARAM_ISMULTI] ) ) {
-                               if ( $p[ApiBase::PARAM_ISMULTI] ) {
-                                       $a['multi'] = '';
-                                       $a['limit'] = $this->getMain()->canApiHighLimits() ?
-                                                       ApiBase::LIMIT_SML2 :
-                                                       ApiBase::LIMIT_SML1;
-                               }
+                       if ( isset( $p[ApiBase::PARAM_ISMULTI] ) && $p[ApiBase::PARAM_ISMULTI] ) {
+                               $a['multi'] = '';
+                               $a['limit'] = $this->getMain()->canApiHighLimits() ?
+                                               ApiBase::LIMIT_SML2 :
+                                               ApiBase::LIMIT_SML1;
                        }
 
-                       if ( isset( $p[ApiBase::PARAM_ALLOW_DUPLICATES] ) ) {
-                               if ( $p[ApiBase::PARAM_ALLOW_DUPLICATES] ) {
-                                       $a['allowsduplicates'] = '';
-                               }
+                       if ( isset( $p[ApiBase::PARAM_ALLOW_DUPLICATES] ) && $p[ApiBase::PARAM_ALLOW_DUPLICATES] ) {
+                               $a['allowsduplicates'] = '';
                        }
 
                        if ( isset( $p[ApiBase::PARAM_TYPE] ) ) {
@@ -205,7 +206,7 @@ class ApiParamInfo extends ApiBase {
        }
 
        public function getDescription() {
-               return 'Obtain information about certain API parameters';
+               return 'Obtain information about certain API parameters and errors';
        }
 
        protected function getExamples() {