From: Daniel Friesen Date: Wed, 15 Feb 2012 19:32:36 +0000 (+0000) Subject: Add an OutputPage to the EditPage::showEditForm:initial to match the EditPage::showEd... X-Git-Tag: 1.31.0-rc.0~24699 X-Git-Url: https://git.heureux-cyclage.org/?a=commitdiff_plain;h=14b524c1185097e96aab258f678991d87c1ac118;p=lhc%2Fweb%2Fwiklou.git Add an OutputPage to the EditPage::showEditForm:initial to match the EditPage::showEditForm:fields hook so that people will stop global'ing $wgOut. e.g.: In WikiEditor. --- diff --git a/docs/hooks.txt b/docs/hooks.txt index 209ff2ee37..e1f261a19f 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -774,12 +774,13 @@ $request: Webrequest return value is ignored (should always return true) 'EditPage::showEditForm:fields': allows injection of form field into edit form -&$editor: the EditPage instance for reference -&$out: an OutputPage instance to write to +$editor: the EditPage instance for reference +$out: an OutputPage instance to write to return value is ignored (should always return true) 'EditPage::showEditForm:initial': before showing the edit form $editor: EditPage instance (object) +$out: an OutputPage instance to write to Return false to halt editing; you'll need to handle error messages, etc. yourself. Alternatively, modifying $error and returning true will cause the diff --git a/includes/EditPage.php b/includes/EditPage.php index d40925214d..28ace46a08 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1732,7 +1732,7 @@ class EditPage { $previewOutput = $this->getPreviewText(); } - wfRunHooks( 'EditPage::showEditForm:initial', array( &$this ) ); + wfRunHooks( 'EditPage::showEditForm:initial', array( &$this, &$wgOut ) ); $this->setHeaders();