* EditPageNoSuchSection hook
authorAaron Schulz <aaron@users.mediawiki.org>
Mon, 18 Jan 2010 00:58:22 +0000 (00:58 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Mon, 18 Jan 2010 00:58:22 +0000 (00:58 +0000)
* Added message to bad section error for reviewed pages
* A few tiny cleanups

docs/hooks.txt
includes/EditPage.php

index 6eb4fd5..156feb9 100644 (file)
@@ -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.
index 73a2f04..85506fe 100644 (file)
@@ -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 );
        }