MediaWiki  1.23.0
JavaScriptContentHandler.php
Go to the documentation of this file.
1 <?php
31 
35  public function __construct( $modelId = CONTENT_MODEL_JAVASCRIPT ) {
36  parent::__construct( $modelId, array( CONTENT_FORMAT_JAVASCRIPT ) );
37  }
38 
47  public function unserializeContent( $text, $format = null ) {
48  $this->checkFormat( $format );
49 
50  return new JavaScriptContent( $text );
51  }
52 
58  public function makeEmptyContent() {
59  return new JavaScriptContent( '' );
60  }
61 
72  public function getPageLanguage( Title $title, Content $content = null ) {
73  return wfGetLangObj( 'en' );
74  }
75 
86  public function getPageViewLanguage( Title $title, Content $content = null ) {
87  return wfGetLangObj( 'en' );
88  }
89 
90 }
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
JavaScriptContentHandler\getPageLanguage
getPageLanguage(Title $title, Content $content=null)
Returns the english language, because JS is english, and should be handled as such.
Definition: JavaScriptContentHandler.php:72
JavaScriptContentHandler\makeEmptyContent
makeEmptyContent()
Definition: JavaScriptContentHandler.php:58
JavaScriptContentHandler\getPageViewLanguage
getPageViewLanguage(Title $title, Content $content=null)
Returns the english language, because JS is english, and should be handled as such.
Definition: JavaScriptContentHandler.php:86
wfGetLangObj
wfGetLangObj( $langcode=false)
Return a Language object from $langcode.
Definition: GlobalFunctions.php:1352
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
JavaScriptContentHandler\unserializeContent
unserializeContent( $text, $format=null)
Definition: JavaScriptContentHandler.php:47
JavaScriptContentHandler\__construct
__construct( $modelId=CONTENT_MODEL_JAVASCRIPT)
Definition: JavaScriptContentHandler.php:35
JavaScriptContent
Content for JavaScript pages.
Definition: JavaScriptContent.php:33
$title
presenting them properly to the user as errors is done by the caller $title
Definition: hooks.txt:1324
TextContentHandler
Base content handler implementation for flat text contents.
Definition: TextContentHandler.php:31
JavaScriptContentHandler
Content handler for JavaScript pages.
Definition: JavaScriptContentHandler.php:30
Content
Base interface for content objects.
Definition: Content.php:34
Title
Represents a title within MediaWiki.
Definition: Title.php:35
ContentHandler\checkFormat
checkFormat( $format)
Convenient for checking whether a format provided as a parameter is actually supported.
Definition: ContentHandler.php:558
CONTENT_MODEL_JAVASCRIPT
const CONTENT_MODEL_JAVASCRIPT
Definition: Defines.php:284
CONTENT_FORMAT_JAVASCRIPT
const CONTENT_FORMAT_JAVASCRIPT
Definition: Defines.php:299