MediaWiki  1.23.13
CssContent.php
Go to the documentation of this file.
1 <?php
33 class CssContent extends TextContent {
34 
38  public function __construct( $text ) {
39  parent::__construct( $text, CONTENT_MODEL_CSS );
40  }
41 
54  public function preSaveTransform( Title $title, User $user, ParserOptions $popts ) {
56  // @todo Make pre-save transformation optional for script pages
57 
58  $text = $this->getNativeData();
59  $pst = $wgParser->preSaveTransform( $text, $title, $user, $popts );
60 
61  return new CssContent( $pst );
62  }
63 
67  protected function getHtml() {
68  $html = "";
69  $html .= "<pre class=\"mw-code mw-css\" dir=\"ltr\">\n";
70  $html .= $this->getHighlightHtml();
71  $html .= "\n</pre>\n";
72 
73  return $html;
74  }
75 
76 }
ParserOptions
Set options of the Parser.
Definition: ParserOptions.php:31
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
$html
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html
Definition: hooks.txt:1530
CONTENT_MODEL_CSS
const CONTENT_MODEL_CSS
Definition: Defines.php:285
CssContent
Content object for CSS pages.
Definition: CssContent.php:33
TextContent\getHighlightHtml
getHighlightHtml()
Generates a syntax-highlighted version of the content, as HTML.
Definition: TextContent.php:263
CssContent\__construct
__construct( $text)
Definition: CssContent.php:38
CssContent\preSaveTransform
preSaveTransform(Title $title, User $user, ParserOptions $popts)
Returns a Content object with pre-save transformations applied using Parser::preSaveTransform().
Definition: CssContent.php:54
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
$title
presenting them properly to the user as errors is done by the caller $title
Definition: hooks.txt:1324
$user
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
Definition: hooks.txt:237
TextContent
Content object implementation for representing flat text.
Definition: TextContent.php:35
Title
Represents a title within MediaWiki.
Definition: Title.php:35
$wgParser
$wgParser
Definition: Setup.php:587
CssContent\getHtml
getHtml()
Definition: CssContent.php:67
User
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
Definition: User.php:59
TextContent\getNativeData
getNativeData()
Returns the text represented by this Content object, as a string.
Definition: TextContent.php:118