X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiImageRotate.php;h=b8e16ab724093f9dafbda58d4107138b5b452a77;hb=1e654405af3a9f41cd9ccf6803a610b559dff92c;hp=3ecb0d5800703143fc119d284c023970a71e702a;hpb=4975761eb2a5387ab53fe340cc60d566fce9dae0;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiImageRotate.php b/includes/api/ApiImageRotate.php index 3ecb0d5800..b8e16ab724 100644 --- a/includes/api/ApiImageRotate.php +++ b/includes/api/ApiImageRotate.php @@ -24,10 +24,6 @@ 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 @@ -37,15 +33,15 @@ class ApiImageRotate extends ApiBase { */ private static function addValues( array &$result, $values, $flag = null, $name = null ) { foreach ( $values as $val ) { - if( $val instanceof Title ) { + if ( $val instanceof Title ) { $v = array(); ApiQueryBase::addTitleInfo( $v, $val ); - } elseif( $name !== null ) { + } elseif ( $name !== null ) { $v = array( $name => $val ); } else { $v = $val; } - if( $flag !== null ) { + if ( $flag !== null ) { $v[$flag] = ''; } $result[] = $v; @@ -145,6 +141,7 @@ class ApiImageRotate extends ApiBase { if ( $this->mPageSet === null ) { $this->mPageSet = new ApiPageSet( $this, 0, NS_FILE ); } + return $this->mPageSet; } @@ -163,6 +160,7 @@ class ApiImageRotate extends ApiBase { if ( $permissionErrors ) { // Just return the first error $msg = $this->parseMsg( $permissionErrors[0] ); + return $msg['info']; } @@ -191,11 +189,13 @@ class ApiImageRotate extends ApiBase { 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', @@ -203,7 +203,7 @@ class ApiImageRotate extends ApiBase { } public function getDescription() { - return 'Rotate one or more images'; + return 'Rotate one or more images.'; } public function needsToken() { @@ -216,6 +216,7 @@ class ApiImageRotate extends ApiBase { public function getPossibleErrors() { $pageSet = $this->getPageSet(); + return array_merge( parent::getPossibleErrors(), $pageSet->getFinalPossibleErrors()