Merge "Update some external conversion tables to latest versions"
[lhc/web/wiklou.git] / includes / content / CssContentHandler.php
1 <?php
2
3 /**
4 * @since 1.21
5 */
6 class CssContentHandler extends TextContentHandler {
7
8 public function __construct( $modelId = CONTENT_MODEL_CSS ) {
9 parent::__construct( $modelId, array( CONTENT_FORMAT_CSS ) );
10 }
11
12 public function unserializeContent( $text, $format = null ) {
13 $this->checkFormat( $format );
14
15 return new CssContent( $text );
16 }
17
18 public function makeEmptyContent() {
19 return new CssContent( '' );
20 }
21
22 /**
23 * Returns the english language, because CSS is english, and should be handled as such.
24 *
25 * @return Language wfGetLangObj( 'en' )
26 *
27 * @see ContentHandler::getPageLanguage()
28 */
29 public function getPageLanguage( Title $title, Content $content = null ) {
30 return wfGetLangObj( 'en' );
31 }
32
33 /**
34 * Returns the english language, because CSS is english, and should be handled as such.
35 *
36 * @return Language wfGetLangObj( 'en' )
37 *
38 * @see ContentHandler::getPageViewLanguage()
39 */
40 public function getPageViewLanguage( Title $title, Content $content = null ) {
41 return wfGetLangObj( 'en' );
42 }
43 }