mediawiki-extensions-Confir.../ApiFancyCaptchaReload.php
Brad Jorsch 0532c2257a Add i18n for API module help
MediaWiki core change I04b1a384 added support for i18n of API module
help. This takes advantage of that while still maintaining backwards
compatibility with earlier versions of MediaWiki.

Once support for MediaWiki before 1.25 is dropped, the methods marked
deprecated in this patch may be removed.

Change-Id: I67395aff48185f3e09da31b51a08aa2541fe6a17
2014-10-29 16:37:38 -04:00

47 lines
967 B
PHP

<?php
/**
* Api module to reload FancyCaptcha
*
* @ingroup API
* @ingroup Extensions
*/
class ApiFancyCaptchaReload extends ApiBase {
public function execute() {
# Get a new FancyCaptcha form data
$captcha = new FancyCaptcha();
$captchaIndex = $captcha->getCaptchaIndex();
$result = $this->getResult();
$result->addValue( null, $this->getModuleName(), array ( 'index' => $captchaIndex ) );
return true;
}
/**
* @deprecated since MediaWiki core 1.25
*/
public function getDescription() {
return 'Get a new FancyCaptcha.';
}
public function getAllowedParams() {
return array();
}
/**
* @deprecated since MediaWiki core 1.25
*/
public function getExamples() {
return array( 'api.php?action=fancycaptchareload&format=xml' );
}
/**
* @see ApiBase::getExamplesMessages()
*/
protected function getExamplesMessages() {
return array(
'action=fancycaptchareload'
=> 'apihelp-fancycaptchareload-example-1',
);
}
}