Merge "API: Use message-per-value for apihelp-query+usercontribs-param-prop"
[lhc/web/wiklou.git] / includes / api / ApiUndelete.php
index 39b63f4..cd50ee6 100644 (file)
@@ -30,6 +30,8 @@
 class ApiUndelete extends ApiBase {
 
        public function execute() {
+               $this->useTransactionalTimeLimit();
+
                $params = $this->extractRequestParams();
 
                if ( !$this->getUser()->isAllowed( 'undelete' ) ) {
@@ -37,7 +39,12 @@ class ApiUndelete extends ApiBase {
                }
 
                if ( $this->getUser()->isBlocked() ) {
-                       $this->dieUsageMsg( 'blockedtext' );
+                       $this->dieUsage(
+                               'You have been blocked from editing',
+                               'blocked',
+                               0,
+                               array( 'blockinfo' => ApiQueryUserInfo::getBlockInfo( $this->getUser()->getBlock() ) )
+                       );
                }
 
                $titleObj = Title::newFromText( $params['title'] );
@@ -69,7 +76,7 @@ class ApiUndelete extends ApiBase {
                }
 
                if ( $retval[1] ) {
-                       wfRunHooks( 'FileUndeleteComplete',
+                       Hooks::run( 'FileUndeleteComplete',
                                array( $titleObj, $params['fileids'], $this->getUser(), $params['reason'] ) );
                }
 
@@ -121,7 +128,7 @@ class ApiUndelete extends ApiBase {
                return 'csrf';
        }
 
-       public function getExamplesMessages() {
+       protected function getExamplesMessages() {
                return array(
                        'action=undelete&title=Main%20Page&token=123ABC&reason=Restoring%20main%20page'
                                => 'apihelp-undelete-example-page',