From 244dd9b4deba76cdcfee6740af94f7a8236cd080 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 18 Jan 2010 00:58:22 +0000 Subject: [PATCH] * EditPageNoSuchSection hook * Added message to bad section error for reviewed pages * A few tiny cleanups --- docs/hooks.txt | 4 ++++ includes/EditPage.php | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index 6eb4fd55db..156feb9bc9 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -694,6 +694,10 @@ textarea in the edit form $title: title of page being edited &$msg: localization message name, overridable. Default is either 'copyrightwarning' or 'copyrightwarning2' +'EditPageNoSuchSection': When a section edit request is given for an non-existent section +&$editpage: The current EditPage object +&$res: the HTML of the error text + 'EditPageTosSummary': Give a chance for site and per-namespace customizations of terms of service summary link that might exist separately from the copyright notice. diff --git a/includes/EditPage.php b/includes/EditPage.php index 73a2f04df4..85506fed35 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -2056,7 +2056,10 @@ INPUTS $wgOut->setRobotPolicy( 'noindex,nofollow' ); $wgOut->setArticleRelated( false ); - $wgOut->addWikiMsg( 'nosuchsectiontext', $this->section ); + $res = wfMsgExt( 'nosuchsectiontext', 'parse', $this->section ); + wfRunHooks( 'EditPageNoSuchSection', array( &$this, &$res ) ); + $wgOut->addHTML( $res ); + $wgOut->returnToMain( false, $this->mTitle ); } -- 2.20.1