Ljonka has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/363357 )
Change subject: Add Hook EditPage::actionURLOptions with params: $editPage and &$options to add custom action link options ...................................................................... Add Hook EditPage::actionURLOptions with params: $editPage and &$options to add custom action link options In combination with the hooks 'UpdateEditUrlOptions' and 'ArticleUpdateBeforeRedirect' the url params can be transfered and changed on each step of edit process until return to starting point - the normal page view. Change-Id: I6a35d1d7968cfeeee671ad62db533356c0c1a203 --- M docs/hooks.txt M includes/EditPage.php 2 files changed, 9 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/57/363357/1 diff --git a/docs/hooks.txt b/docs/hooks.txt index 62e5bdb..3dfc2bd 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1363,6 +1363,10 @@ &$text: Text to preload with &$title: Title object representing the page being created +'EditPage::actionURLOptions': Change options in URL to use in the form's action attribute +$editPage: EditPage Object +&$options: array of url params, eg. $options['myparam'] = 'myvalue'; + 'EditPage::attemptSave': Called before an article is saved, that is before WikiPage::doEditContent() is called $editpage_Obj: the current EditPage object diff --git a/includes/EditPage.php b/includes/EditPage.php index 6be8771..f3d0dca 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -3713,7 +3713,11 @@ * @return string */ protected function getActionURL( Title $title ) { - return $title->getLocalURL( [ 'action' => $this->action ] ); + $options = [ 'action' => $this->action ]; + + Hooks::run( 'EditPage::actionURLOptions', [ $this, &$options ] ); + + return $title->getLocalURL( $options ); } /** -- To view, visit https://gerrit.wikimedia.org/r/363357 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6a35d1d7968cfeeee671ad62db533356c0c1a203 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Ljonka <l.verhovs...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits