Merge "Added some extra tests for ORMRow class"
[lhc/web/wiklou.git] / includes / api / ApiPatrol.php
index 04afd1d..45d19d0 100644 (file)
  * @file
  */
 
-if ( !defined( 'MEDIAWIKI' ) ) {
-       require_once ( 'ApiBase.php' );
-}
-
 /**
  * Allows user to patrol pages
  * @ingroup API
@@ -48,7 +44,7 @@ class ApiPatrol extends ApiBase {
                if ( !$rc instanceof RecentChange ) {
                        $this->dieUsageMsg( array( 'nosuchrcid', $params['rcid'] ) );
                }
-               $retval = RecentChange::markPatrolled( $params['rcid'] );
+               $retval = $rc->doMarkPatrolled( $this->getUser() );
 
                if ( $retval ) {
                        $this->dieUsageMsg( reset( $retval ) );
@@ -84,6 +80,16 @@ class ApiPatrol extends ApiBase {
                );
        }
 
+       public function getResultProperties() {
+               return array(
+                       '' => array(
+                               'rcid' => 'integer',
+                               'ns' => 'namespace',
+                               'title' => 'string'
+                       )
+               );
+       }
+
        public function getDescription() {
                return 'Patrol a page or revision';
        }
@@ -102,12 +108,16 @@ class ApiPatrol extends ApiBase {
                return 'patrol';
        }
 
-       protected function getExamples() {
+       public function getExamples() {
                return array(
                        'api.php?action=patrol&token=123abc&rcid=230672766'
                );
        }
 
+       public function getHelpUrls() {
+               return 'https://www.mediawiki.org/wiki/API:Patrol';
+       }
+
        public function getVersion() {
                return __CLASS__ . ': $Id$';
        }