<?php
/**
- *
- *
- * Created on Aug 29, 2014
- *
* Copyright © 2014 Wikimedia Foundation and contributors
*
* This program is free software; you can redistribute it and/or modify
if ( $params['wrap'] ) {
$data = [
'mime' => 'text/html',
+ 'filename' => 'api-help.html',
'help' => $html,
];
ApiResult::setSubelementsList( $data, 'help' );
$result->reset();
$result->addValue( null, 'text', $html, ApiResult::NO_SIZE_CHECK );
$result->addValue( null, 'mime', 'text/html', ApiResult::NO_SIZE_CHECK );
+ $result->addValue( null, 'filename', 'api-help.html', ApiResult::NO_SIZE_CHECK );
}
}
$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 );
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 );
}
}
+ 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]