MediaWiki  REL1_24
CssContent.php
Go to the documentation of this file.
00001 <?php
00033 class CssContent extends TextContent {
00034 
00039     public function __construct( $text, $modelId = CONTENT_MODEL_CSS ) {
00040         parent::__construct( $text, $modelId );
00041     }
00042 
00055     public function preSaveTransform( Title $title, User $user, ParserOptions $popts ) {
00056         global $wgParser;
00057         // @todo Make pre-save transformation optional for script pages
00058 
00059         $text = $this->getNativeData();
00060         $pst = $wgParser->preSaveTransform( $text, $title, $user, $popts );
00061 
00062         return new static( $pst );
00063     }
00064 
00068     protected function getHtml() {
00069         $html = "";
00070         $html .= "<pre class=\"mw-code mw-css\" dir=\"ltr\">\n";
00071         $html .= htmlspecialchars( $this->getNativeData() );
00072         $html .= "\n</pre>\n";
00073 
00074         return $html;
00075     }
00076 
00077 }