Pulling out r42105 for now -- "Added 2 hooks. One in Parser to allow custom handling...
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 15 Oct 2008 20:57:02 +0000 (20:57 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 15 Oct 2008 20:57:02 +0000 (20:57 +0000)
The namespace parsing thing feels very hacky and grabs bits out of an internal implementation function which doesn't feel like a stable interface.
Would recommend thinking about this and coming up with a more serious stable interface for it.

RELEASE-NOTES
docs/hooks.txt
includes/EditPage.php
includes/parser/Parser.php

index 6574a8b..9e5a780 100644 (file)
@@ -164,11 +164,6 @@ The following extensions are migrated into MediaWiki 1.14:
   several uses of the same image.
 * (bug 1250) Users can still use "show preview" and "show changes" even if the 
   wiki is set to read-only mode.
-* Added 'ParserLinkNSCheck' hook in the parser, allowing extensions to catch and handle 
-  links based on namespace (for instance, to add code to handle [[Tag: Foo]] similarly 
-  to how [[Category: Foo]] is handled.
-* Added 'EditPageNoPermission' hook to allow special handling/output when a non-editor 
-  views an edit page.
 * Added a call to the 'UnwatchArticleComplete' hook to the watchlist editor.  This 
        should make it so that ALL user-accessible methods of removing a page from a watchlist
   lead to this hook being called (it was previously only called from within Article.php
index 5209796..7cab756 100644 (file)
@@ -492,15 +492,6 @@ rendered inline in wiki pages or galleries in category pages.
 &$skip: skip this template and link it?
 &$id: the id of the revision being parsed
 
-'ParserLinkNSCheck': after Image and Category links are handled, before general link processing
-Allows an extension to catch arbitrary namespaces and hande their links differently
-&$parser: the parser instance
-&$title: The title instance
-&$s: The current value of s, as used in replaceInternalLinks2
-&$text: The text of the link
-&$prefix:The bit of text just before the link begins, depending on language settings
-&$trail: The bit of text after the link ends, depending on language settings
-
 'BeforeParserMakeImageLinkObj': before an image is rendered by Parser
 &$parser: Parser object
 &$nt: the image title
@@ -596,10 +587,6 @@ $text: content of the edit box
 $error: error message to return
 $summary: Edit summary for page
 
-'EditPageNoPermission': allows modification of permission Errors before the readonly page is loaded
-&$editpage: The editpage instance 
-&$permErrors: the permission Errors from editpage->getEditPermissionErrors()
-
 'EditFormPreloadText': Allows population of the edit form when creating new pages
 &$text: Text to preload with
 &$title: Title object representing the page being created
index 9639697..be4dee1 100644 (file)
@@ -385,7 +385,6 @@ class EditPage {
                $permErrors = $this->getEditPermissionErrors();
                if ( $permErrors ) {
                        wfDebug( __METHOD__.": User can't edit\n" );
-                       wfRunHooks( 'EditPageNoPermission', array( &$this, &$permErrors ) );
                        $this->readOnlyPage( $this->getContent(), true, $permErrors, 'edit' );
                        wfProfileOut( __METHOD__ );
                        return;
index 7070be6..0021e98 100644 (file)
@@ -1801,10 +1801,6 @@ class Parser
                                        wfProfileOut( __METHOD__."-category" );
                                        continue;
                                }
-                               # Give extensions a chance to catch other namespace links
-                               if ( !wfRunHooks( 'ParserLinkNSCheck', array( &$this, &$nt, &$s, &$text, &$prefix, &$trail ) ) ) {
-                                 continue;
-                               }
                        }
 
                        # Self-link checking