mediawiki-extensions-Scribunto/common/ScribuntoContentHandler.php
Liangent 1050d29845 Modules should be in English (while docs are not)
Change-Id: I15c10379ab2282a508322df3914d82e1fc463a22
2013-05-29 15:08:31 +00:00

57 lines
1.3 KiB
PHP

<?php
/**
* Scribunto Content Handler
*
* @file
* @ingroup Extensions
* @ingroup Scribunto
*
* @author Brad Jorsch <bjorsch@wikimedia.org>
*/
class ScribuntoContentHandler extends TextContentHandler {
public function __construct( $modelId = 'Scribunto', $formats = array( 'CONTENT_FORMAT_TEXT' ) ) {
parent::__construct( $modelId, $formats );
}
/**
* 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.
*
* @return Language wfGetLangObj( 'en' )
*/
public function getPageLanguage( Title $title, Content $content = null ) {
return wfGetLangObj( 'en' );
}
/**
* Scripts themselves should be in English.
*
* @return Language wfGetLangObj( 'en' )
*/
public function getPageViewLanguage( Title $title, Content $content = null ) {
return wfGetLangObj( 'en' );
}
}