TheDJ has uploaded a new change for review.
https://gerrit.wikimedia.org/r/120396
Change subject: New hook for readonly editpages
......................................................................
New hook for readonly editpages
Change-Id: I6885d617e18562acf0331e8db5790b53b489dbc2
EditPage::showReadOnlyForm:initial which is analogous to
EditPage::showEditForm:initial
---
M docs/hooks.txt
M includes/EditPage.php
2 files changed, 7 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/96/120396/1
diff --git a/docs/hooks.txt b/docs/hooks.txt
index e4037e6..b7ee118 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -1005,6 +1005,11 @@
contents of $error to be echoed at the top of the edit form as wikitext.
Return true without altering $error to allow the edit to proceed.
+'EditPage::showReadOnlyForm:initial: before showing the edit form
+$editor: EditPage instance (object)
+$out: an OutputPage instance to write to
+return value is ignored (should alway return true)
+
'EditPage::showStandardInputs:options': allows injection of form fields into
the editOptions area
$editor: EditPage instance (object)
diff --git a/includes/EditPage.php b/includes/EditPage.php
index d4b06fe..e0a7ed6 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -512,6 +512,8 @@
throw new PermissionsError( $action, $permErrors );
}
+ wfRunHooks( 'EditPage::showReadOnlyForm:initial', array(
&$this, &$wgOut ) );
+
$wgOut->setRobotPolicy( 'noindex,nofollow' );
$wgOut->setPageTitle( wfMessage( 'viewsource-title',
$this->getContextTitle()->getPrefixedText() ) );
$wgOut->addBacklinkSubtitle( $this->getContextTitle() );
--
To view, visit https://gerrit.wikimedia.org/r/120396
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6885d617e18562acf0331e8db5790b53b489dbc2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TheDJ <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits