From efb47a9d9087d5d9a96e53fd7a23344cc6364ec4 Mon Sep 17 00:00:00 2001 From: Jan Paul Posma Date: Sun, 27 Feb 2011 14:50:56 +0000 Subject: [PATCH] Added hook to support partial rendering for the InlineEditor extension. Doesn't affect normal behaviour. --- Cite_body.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Cite_body.php b/Cite_body.php index a73e9821..cf67f082 100644 --- a/Cite_body.php +++ b/Cite_body.php @@ -1013,6 +1013,14 @@ class Cite { } return true; } + + /** + * Hook for the InlineEditor extension. If any reference is in the text, the entire + * page should be reparsed, so we return false in that case. + */ + function checkAnyRefs( &$output ) { + return ( empty( $this->mRefs ) ); + } /** * Initialize the parser hooks @@ -1025,6 +1033,7 @@ class Cite { $wgHooks['ParserClearState'][] = array( self::$instance, 'clearState' ); $wgHooks['ParserBeforeTidy'][] = array( self::$instance, 'checkRefsNoReferences' ); + $wgHooks['InlineEditorPartialAfterParse'][] = array( self::$instance, 'checkAnyRefs' ); } $parser->setHook( 'ref' , array( self::$instance, 'ref' ) ); $parser->setHook( 'references' , array( self::$instance, 'references' ) );