Merge "Use wikimedia/utfnormal library, add backwards-compatability layer"
[lhc/web/wiklou.git] / includes / api / ApiImageRotate.php
index 20396dd..6fd79f4 100644 (file)
@@ -73,7 +73,7 @@ class ApiImageRotate extends ApiBase {
                                $r['missing'] = '';
                        }
 
-                       $file = wfFindFile( $title );
+                       $file = wfFindFile( $title, array( 'latest' => true ) );
                        if ( !$file ) {
                                $r['result'] = 'Failure';
                                $r['errormessage'] = 'File does not exist';
@@ -184,7 +184,9 @@ class ApiImageRotate extends ApiBase {
                                ApiBase::PARAM_TYPE => array( '90', '180', '270' ),
                                ApiBase::PARAM_REQUIRED => true
                        ),
-                       'continue' => '',
+                       'continue' => array(
+                               ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
+                       ),
                );
                if ( $flags ) {
                        $result += $this->getPageSet()->getFinalParams( $flags );
@@ -193,26 +195,17 @@ class ApiImageRotate extends ApiBase {
                return $result;
        }
 
-       public function getParamDescription() {
-               $pageSet = $this->getPageSet();
-
-               return $pageSet->getFinalParamDescription() + array(
-                       'rotation' => 'Degrees to rotate image clockwise',
-                       'continue' => 'When more results are available, use this to continue',
-               );
-       }
-
-       public function getDescription() {
-               return 'Rotate one or more images.';
-       }
-
        public function needsToken() {
                return 'csrf';
        }
 
-       public function getExamples() {
+       protected function getExamplesMessages() {
                return array(
-                       'api.php?action=imagerotate&titles=Example.jpg&rotation=90&token=123ABC',
+                       'action=imagerotate&titles=File:Example.jpg&rotation=90&token=123ABC'
+                               => 'apihelp-imagerotate-example-simple',
+                       'action=imagerotate&generator=categorymembers&gcmtitle=Category:Flip&gcmtype=file&' .
+                               'rotation=180&token=123ABC'
+                               => 'apihelp-imagerotate-example-generator',
                );
        }
 }