X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fcontent%2FContentHandler.php;h=f8d0879df4c5b43b6dec04d737b1a27309821de9;hb=e66370b637a2bc9fb3fbf7b5b5db80dd38e40b80;hp=8c806c65172f6fb8e0a0de893b48674f07522ca8;hpb=0d8e9eacae1f47c60518f871dbb73f4539413d39;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/content/ContentHandler.php b/includes/content/ContentHandler.php index 8c806c6517..f8d0879df4 100644 --- a/includes/content/ContentHandler.php +++ b/includes/content/ContentHandler.php @@ -626,8 +626,15 @@ abstract class ContentHandler { public function createDifferenceEngine( IContextSource $context, $old = 0, $new = 0, $rcid = 0, //FIXME: Deprecated, no longer used $refreshCache = false, $unhide = false ) { - $diffEngineClass = $this->getDiffEngineClass(); + // hook: get difference engine + $differenceEngine = null; + if ( !Hooks::run( 'GetDifferenceEngine', + array( $context, $old, $new, $refreshCache, $unhide, &$differenceEngine ) + ) ) { + return $differenceEngine; + } + $diffEngineClass = $this->getDiffEngineClass(); return new $diffEngineClass( $context, $old, $new, $rcid, $refreshCache, $unhide ); } @@ -1050,6 +1057,24 @@ abstract class ContentHandler { return false; } + /** + * Return true if this content model supports direct editing, such as via EditPage. + * + * @return bool Default is false, and true for TextContent and it's derivatives. + */ + public function supportsDirectEditing() { + return false; + } + + /** + * Whether or not this content model supports direct editing via ApiEditPage + * + * @return bool Default is false, and true for TextContent and derivatives. + */ + public function supportsDirectApiEditing() { + return $this->supportsDirectEditing(); + } + /** * Logs a deprecation warning, visible if $wgDevelopmentWarnings, but only if * self::$enableDeprecationWarnings is set to true.