X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/rappels.php?a=blobdiff_plain;f=includes%2Fapi%2FApiHelp.php;h=02404c425034fddd6e2accd1c878c71e67073990;hb=17d001b73a3bd291e0f77794fa60fa5495609d68;hp=12e778bfb6a4da0a46ce375873e319b3caf6086c;hpb=b95ca29602793f39191c06cd6941e3f32ab1bbb8;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiHelp.php b/includes/api/ApiHelp.php index 12e778bfb6..02404c4250 100644 --- a/includes/api/ApiHelp.php +++ b/includes/api/ApiHelp.php @@ -485,7 +485,9 @@ class ApiHelp extends ApiBase { $type = $settings[ApiBase::PARAM_TYPE]; $multi = !empty( $settings[ApiBase::PARAM_ISMULTI] ); $hintPipeSeparated = true; - $count = ApiBase::LIMIT_SML2 + 1; + $count = !empty( $settings[ApiBase::PARAM_ISMULTI_LIMIT2] ) + ? $settings[ApiBase::PARAM_ISMULTI_LIMIT2] + 1 + : ApiBase::LIMIT_SML2 + 1; if ( is_array( $type ) ) { $count = count( $type ); @@ -669,13 +671,25 @@ class ApiHelp extends ApiBase { if ( $multi ) { $extra = []; + $lowcount = !empty( $settings[ApiBase::PARAM_ISMULTI_LIMIT1] ) + ? $settings[ApiBase::PARAM_ISMULTI_LIMIT1] + : ApiBase::LIMIT_SML1; + $highcount = !empty( $settings[ApiBase::PARAM_ISMULTI_LIMIT2] ) + ? $settings[ApiBase::PARAM_ISMULTI_LIMIT2] + : ApiBase::LIMIT_SML2; + if ( $hintPipeSeparated ) { $extra[] = $context->msg( 'api-help-param-multi-separate' )->parse(); } - if ( $count > ApiBase::LIMIT_SML1 ) { - $extra[] = $context->msg( 'api-help-param-multi-max' ) - ->numParams( ApiBase::LIMIT_SML1, ApiBase::LIMIT_SML2 ) - ->parse(); + if ( $count > $lowcount ) { + if ( $lowcount === $highcount ) { + $msg = $context->msg( 'api-help-param-multi-max-simple' ) + ->numParams( $lowcount ); + } else { + $msg = $context->msg( 'api-help-param-multi-max' ) + ->numParams( $lowcount, $highcount ); + } + $extra[] = $msg->parse(); } if ( $extra ) { $info[] = implode( ' ', $extra ); @@ -697,6 +711,15 @@ class ApiHelp extends ApiBase { } } + if ( isset( $settings[self::PARAM_MAX_BYTES] ) ) { + $info[] = $context->msg( 'api-help-param-maxbytes' ) + ->numParams( $settings[self::PARAM_MAX_BYTES] ); + } + if ( isset( $settings[self::PARAM_MAX_CHARS] ) ) { + $info[] = $context->msg( 'api-help-param-maxchars' ) + ->numParams( $settings[self::PARAM_MAX_CHARS] ); + } + // Add default $default = isset( $settings[ApiBase::PARAM_DFLT] ) ? $settings[ApiBase::PARAM_DFLT]