From: Marius Hoch Date: Sat, 1 Nov 2014 20:39:52 +0000 (+0100) Subject: Add an "ArticleDeleteAfterSuccess" hook X-Git-Tag: 1.31.0-rc.0~13383^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/cloturer.php?a=commitdiff_plain;h=e4cfd3da01053c576fe5bcb0f62eefa65033357e;p=lhc%2Fweb%2Fwiklou.git Add an "ArticleDeleteAfterSuccess" hook So that we can show what Wikibase did after the deletion. Change-Id: If99be002973e68c84125158ff9747b140fb38ea1 --- diff --git a/docs/hooks.txt b/docs/hooks.txt index 52eeab8356..d24c66d22e 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -528,6 +528,10 @@ $error: if the deletion was prohibited, the (raw HTML) error message to display $status: Status object, modify this to throw an error. Overridden by $error (added in 1.20) +'ArticleDeleteAfterSuccess': Output after an article has been deleted. +$title: Title of the article that has been deleted. +$outputPage: OutputPage that can be used to append the output. + 'ArticleDeleteComplete': After an article is deleted. $wikiPage: the WikiPage that was deleted $user: the user that deleted the article diff --git a/includes/page/Article.php b/includes/page/Article.php index 54fab29a55..ac86e8f799 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -1807,6 +1807,9 @@ class Article implements Page { $loglink = '[[Special:Log/delete|' . wfMessage( 'deletionlog' )->text() . ']]'; $outputPage->addWikiMsg( 'deletedtext', wfEscapeWikiText( $deleted ), $loglink ); + + wfRunHooks( 'ArticleDeleteAfterSuccess', array( $this->getTitle(), $outputPage ) ); + $outputPage->returnToMain( false ); } else { $outputPage->setPageTitle(