Merge "Removed READ_LATEST default from Revision::newFromPageId()."
[lhc/web/wiklou.git] / includes / content / CssContent.php
1 <?php
2 /**
3 * @since 1.21
4 */
5 class CssContent extends TextContent {
6 public function __construct( $text ) {
7 parent::__construct( $text, CONTENT_MODEL_CSS );
8 }
9
10 /**
11 * Returns a Content object with pre-save transformations applied using
12 * Parser::preSaveTransform().
13 *
14 * @param $title Title
15 * @param $user User
16 * @param $popts ParserOptions
17 * @return Content
18 */
19 public function preSaveTransform( Title $title, User $user, ParserOptions $popts ) {
20 global $wgParser;
21 // @todo: make pre-save transformation optional for script pages
22
23 $text = $this->getNativeData();
24 $pst = $wgParser->preSaveTransform( $text, $title, $user, $popts );
25
26 return new CssContent( $pst );
27 }
28
29
30 protected function getHtml( ) {
31 $html = "";
32 $html .= "<pre class=\"mw-code mw-css\" dir=\"ltr\">\n";
33 $html .= $this->getHighlightHtml( );
34 $html .= "\n</pre>\n";
35
36 return $html;
37 }
38 }