From: Aaron Schulz Date: Mon, 18 Jan 2010 00:58:22 +0000 (+0000) Subject: * EditPageNoSuchSection hook X-Git-Tag: 1.31.0-rc.0~38219 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=244dd9b4deba76cdcfee6740af94f7a8236cd080;p=lhc%2Fweb%2Fwiklou.git * EditPageNoSuchSection hook * Added message to bad section error for reviewed pages * A few tiny cleanups --- 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 ); }