From c1f9b1f7b1b77776192048005dcc66dcf3df2bfb Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 27 Dec 2014 15:41:37 +0100 Subject: Update to MediaWiki 1.24.1 --- includes/api/ApiImageRotate.php | 42 +++++++++++++++-------------------------- 1 file changed, 15 insertions(+), 27 deletions(-) (limited to 'includes/api/ApiImageRotate.php') diff --git a/includes/api/ApiImageRotate.php b/includes/api/ApiImageRotate.php index 7a60e831..20396dd7 100644 --- a/includes/api/ApiImageRotate.php +++ b/includes/api/ApiImageRotate.php @@ -24,16 +24,12 @@ class ApiImageRotate extends ApiBase { private $mPageSet = null; - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - /** * Add all items from $values into the result - * @param array $result output - * @param array $values values to add - * @param string $flag the name of the boolean flag to mark this element - * @param string $name if given, name of the value + * @param array $result Output + * @param array $values Values to add + * @param string $flag The name of the boolean flag to mark this element + * @param string $name If given, name of the value */ private static function addValues( array &$result, $values, $flag = null, $name = null ) { foreach ( $values as $val ) { @@ -56,6 +52,8 @@ class ApiImageRotate extends ApiBase { $params = $this->extractRequestParams(); $rotation = $params['rotation']; + $this->getResult()->beginContinuation( $params['continue'], array(), array() ); + $pageSet = $this->getPageSet(); $pageSet->execute(); @@ -135,6 +133,7 @@ class ApiImageRotate extends ApiBase { $apiResult = $this->getResult(); $apiResult->setIndexedTagName( $result, 'page' ); $apiResult->addValue( null, $this->getModuleName(), $result ); + $apiResult->endContinuation(); } /** @@ -145,6 +144,7 @@ class ApiImageRotate extends ApiBase { if ( $this->mPageSet === null ) { $this->mPageSet = new ApiPageSet( $this, 0, NS_FILE ); } + return $this->mPageSet; } @@ -163,6 +163,7 @@ class ApiImageRotate extends ApiBase { if ( $permissionErrors ) { // Just return the first error $msg = $this->parseMsg( $permissionErrors[0] ); + return $msg['info']; } @@ -183,43 +184,30 @@ class ApiImageRotate extends ApiBase { ApiBase::PARAM_TYPE => array( '90', '180', '270' ), ApiBase::PARAM_REQUIRED => true ), - 'token' => array( - ApiBase::PARAM_TYPE => 'string', - ApiBase::PARAM_REQUIRED => true - ), + 'continue' => '', ); if ( $flags ) { $result += $this->getPageSet()->getFinalParams( $flags ); } + return $result; } public function getParamDescription() { $pageSet = $this->getPageSet(); + return $pageSet->getFinalParamDescription() + array( 'rotation' => 'Degrees to rotate image clockwise', - 'token' => 'Edit token. You can get one of these through action=tokens', + 'continue' => 'When more results are available, use this to continue', ); } public function getDescription() { - return 'Rotate one or more images'; + return 'Rotate one or more images.'; } public function needsToken() { - return true; - } - - public function getTokenSalt() { - return ''; - } - - public function getPossibleErrors() { - $pageSet = $this->getPageSet(); - return array_merge( - parent::getPossibleErrors(), - $pageSet->getFinalPossibleErrors() - ); + return 'csrf'; } public function getExamples() { -- cgit v1.2.2