Have ScribuntoContentHandler extend CodeContentHandler

Change-Id: I8d99ba9db7f804e898a74a47d9e4e02cac45e945
This commit is contained in:
Kunal Mehta 2014-09-15 01:43:15 -07:00 committed by Jforrester
parent 0c0ae3d681
commit 98436e2008

View file

@ -9,7 +9,7 @@
* @author Brad Jorsch <bjorsch@wikimedia.org>
*/
class ScribuntoContentHandler extends TextContentHandler {
class ScribuntoContentHandler extends CodeContentHandler {
/**
* @param string $modelId
@ -21,6 +21,10 @@ class ScribuntoContentHandler extends TextContentHandler {
parent::__construct( $modelId, $formats );
}
protected function getContentClass() {
return 'ScribuntoContent';
}
/**
* @param string $format
* @return bool
@ -33,49 +37,6 @@ class ScribuntoContentHandler extends TextContentHandler {
return parent::isSupportedFormat( $format );
}
/**
* Unserializes a ScribuntoContent object.
*
* @param $text string Serialized form of the content
* @param $format null|string The format used for serialization
* @return Content the ScribuntoContent object wrapping $text
*/
public function unserializeContent( $text, $format = null ) {
$this->checkFormat( $format );
return new ScribuntoContent( $text );
}
/**
* Creates an empty ScribuntoContent object.
*
* @return Content
*/
public function makeEmptyContent() {
return new ScribuntoContent( '' );
}
/**
* Scripts themselves should be in English.
*
* @param Title $title
* @param Content $content
* @return Language wfGetLangObj( 'en' )
*/
public function getPageLanguage( Title $title, Content $content = null ) {
return wfGetLangObj( 'en' );
}
/**
* Scripts themselves should be in English.
*
* @param Title $title
* @param Content $content
* @return Language wfGetLangObj( 'en' )
*/
public function getPageViewLanguage( Title $title, Content $content = null ) {
return wfGetLangObj( 'en' );
}
/**
* Only allow this content handler to be used in the Module namespace
* @param Title $title