diff options
Diffstat (limited to 'extensions/ConfirmEdit/FancyCaptcha/ApiFancyCaptchaReload.php')
-rw-r--r-- | extensions/ConfirmEdit/FancyCaptcha/ApiFancyCaptchaReload.php | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/extensions/ConfirmEdit/FancyCaptcha/ApiFancyCaptchaReload.php b/extensions/ConfirmEdit/FancyCaptcha/ApiFancyCaptchaReload.php new file mode 100644 index 00000000..8cd28631 --- /dev/null +++ b/extensions/ConfirmEdit/FancyCaptcha/ApiFancyCaptchaReload.php @@ -0,0 +1,46 @@ +<?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', + ); + } +} |