3 * A content object represents page content, e.g. the text to show on a page.
4 * Content objects have no knowledge about how they relate to Wiki pages.
13 * @return String a string representing the content in a way useful for building a full text search index.
14 * If no useful representation exists, this method returns an empty string.
16 * @todo: test that this actually works
17 * @todo: make sure this also works with LuceneSearch / WikiSearch
19 public function getTextForSearchIndex( );
24 * @return String the wikitext to include when another page includes this content, or false if the content is not
25 * includable in a wikitext page.
27 * @TODO: allow native handling, bypassing wikitext representation, like for includable special pages.
28 * @TODO: allow transclusion into other content models than Wikitext!
29 * @TODO: used in WikiPage and MessageCache to get message text. Not so nice. What should we use instead?!
31 public function getWikitextForTransclusion( );
34 * Returns a textual representation of the content suitable for use in edit summaries and log messages.
38 * @param int $maxlength maximum length of the summary text
39 * @return String the summary text
41 public function getTextForSummary( $maxlength = 250 );
44 * Returns native representation of the data. Interpretation depends on the data model used,
45 * as given by getDataModel().
49 * @return mixed the native representation of the content. Could be a string, a nested array
50 * structure, an object, a binary blob... anything, really.
52 * @NOTE: review all calls carefully, caller must be aware of content model!
54 public function getNativeData( );
57 * returns the content's nominal size in bogo-bytes.
61 public function getSize( );
64 * Returns the id of the content model used by this content objects.
65 * Corresponds to the CONTENT_MODEL_XXX constants.
69 * @return int the model id
71 public function getModel();
74 * Convenience method that returns the ContentHandler singleton for handling the content
75 * model this Content object uses.
77 * Shorthand for ContentHandler::getForContent( $this )
81 * @return ContentHandler
83 public function getContentHandler();
86 * Convenience method that returns the default serialization format for the content model
87 * model this Content object uses.
89 * Shorthand for $this->getContentHandler()->getDefaultFormat()
93 * @return ContentHandler
95 public function getDefaultFormat();
98 * Convenience method that returns the list of serialization formats supported
99 * for the content model model this Content object uses.
101 * Shorthand for $this->getContentHandler()->getSupportedFormats()
105 * @return array of supported serialization formats
107 public function getSupportedFormats();
110 * Returns true if $format is a supported serialization format for this Content object,
113 * Note that this should always return true if $format is null, because null stands for the
114 * default serialization.
116 * Shorthand for $this->getContentHandler()->isSupportedFormat( $format )
120 * @param String $format the format to check
121 * @return bool whether the format is supported
123 public function isSupportedFormat( $format );
126 * Convenience method for serializing this Content object.
128 * Shorthand for $this->getContentHandler()->serializeContent( $this, $format )
132 * @param null|String $format the desired serialization format (or null for the default format).
133 * @return String serialized form of this Content object
135 public function serialize( $format = null );
138 * Returns true if this Content object represents empty content.
142 * @return bool whether this Content object is empty
144 public function isEmpty();
147 * Returns whether the content is valid. This is intended for local validity checks, not considering global consistency.
148 * Content needs to be valid before it can be saved.
150 * This default implementation always returns true.
156 public function isValid();
159 * Returns true if this Content objects is conceptually equivalent to the given Content object.
162 * * Will return false if $that is null.
163 * * Will return true if $that === $this.
164 * * Will return false if $that->getModelName() != $this->getModel().
165 * * Will return false if $that->getNativeData() is not equal to $this->getNativeData(),
166 * where the meaning of "equal" depends on the actual data model.
168 * Implementations should be careful to make equals() transitive and reflexive:
170 * * $a->equals( $b ) <=> $b->equals( $a )
171 * * $a->equals( $b ) && $b->equals( $c ) ==> $a->equals( $c )
175 * @param Content $that the Content object to compare to
176 * @return bool true if this Content object is equal to $that, false otherwise.
178 public function equals( Content
$that = null );
181 * Return a copy of this Content object. The following must be true for the object returned
182 * if $copy = $original->copy()
184 * * get_class($original) === get_class($copy)
185 * * $original->getModel() === $copy->getModel()
186 * * $original->equals( $copy )
188 * If and only if the Content object is immutable, the copy() method can and should
189 * return $this. That is, $copy === $original may be true, but only for immutable content
194 * @return Content. A copy of this object
196 public function copy( );
199 * Returns true if this content is countable as a "real" wiki page, provided
200 * that it's also in a countable location (e.g. a current revision in the main namespace).
204 * @param $hasLinks Bool: if it is known whether this content contains links, provide this information here,
205 * to avoid redundant parsing to find out.
208 public function isCountable( $hasLinks = null ) ;
211 * Convenience method, shorthand for
212 * $this->getContentHandler()->getParserOutput( $this, $title, $revId, $options, $generateHtml )
214 * @note: subclasses should NOT override this to provide custom rendering.
215 * Override ContentHandler::getParserOutput() instead!
217 * @param Title $title
219 * @param null|ParserOptions $options
220 * @param Boolean $generateHtml whether to generate Html (default: true). If false,
221 * the result of calling getText() on the ParserOutput object returned by
222 * this method is undefined.
226 * @return ParserOutput
228 public function getParserOutput( Title
$title, $revId = null, ParserOptions
$options = null, $generateHtml = true );
231 * Construct the redirect destination from this content and return an
232 * array of Titles, or null if this content doesn't represent a redirect.
233 * The last element in the array is the final destination after all redirects
234 * have been resolved (up to $wgMaxRedirects times).
238 * @return Array of Titles, with the destination last
240 public function getRedirectChain();
243 * Construct the redirect destination from this content and return a Title,
244 * or null if this content doesn't represent a redirect.
245 * This will only return the immediate redirect target, useful for
246 * the redirect table and other checks that don't need full recursion.
250 * @return Title: The corresponding Title
252 public function getRedirectTarget();
255 * Construct the redirect destination from this content and return the
256 * Title, or null if this content doesn't represent a redirect.
257 * This will recurse down $wgMaxRedirects times or until a non-redirect target is hit
258 * in order to provide (hopefully) the Title of the final destination instead of another redirect.
264 public function getUltimateRedirectTarget();
267 * Returns whether this Content represents a redirect.
268 * Shorthand for getRedirectTarget() !== null.
274 public function isRedirect();
277 * Returns the section with the given id.
281 * @param String $sectionId the section's id, given as a numeric string. The id "0" retrieves the section before
282 * the first heading, "1" the text between the first heading (included) and the second heading (excluded), etc.
283 * @return Content|Boolean|null the section, or false if no such section exist, or null if sections are not supported
285 public function getSection( $sectionId );
288 * Replaces a section of the content and returns a Content object with the section replaced.
292 * @param $section empty/null/false or a section number (0, 1, 2, T1, T2...), or "new"
293 * @param $with Content: new content of the section
294 * @param $sectionTitle String: new section's subject, only if $section is 'new'
295 * @return string Complete article text, or null if error
297 public function replaceSection( $section, Content
$with, $sectionTitle = '' );
300 * Returns a Content object with pre-save transformations applied (or this object if no transformations apply).
304 * @param Title $title
306 * @param null|ParserOptions $popts
309 public function preSaveTransform( Title
$title, User
$user, ParserOptions
$popts );
312 * Returns a new WikitextContent object with the given section heading prepended, if supported.
313 * The default implementation just returns this Content object unmodified, ignoring the section header.
317 * @param $header String
320 public function addSectionHeader( $header );
323 * Returns a Content object with preload transformations applied (or this object if no transformations apply).
327 * @param Title $title
328 * @param null|ParserOptions $popts
331 public function preloadTransform( Title
$title, ParserOptions
$popts );
333 # TODO: handle ImagePage and CategoryPage
334 # TODO: make sure we cover lucene search / wikisearch.
335 # TODO: make sure ReplaceTemplates still works
336 # FUTURE: nice&sane integration of GeSHi syntax highlighting
337 # [11:59] <vvv> Hooks are ugly; make CodeHighlighter interface and a config to set the class which handles syntax highlighting
338 # [12:00] <vvv> And default it to a DummyHighlighter
340 # TODO: make sure we cover the external editor interface (does anyone actually use that?!)
342 # TODO: tie into API to provide contentModel for Revisions
343 # TODO: tie into API to provide serialized version and contentFormat for Revisions
344 # TODO: tie into API edit interface
345 # FUTURE: make EditForm plugin for EditPage
347 # FUTURE: special type for redirects?!
348 # FUTURE: MultipartMultipart < WikipageContent (Main + Links + X)
349 # FUTURE: LinksContent < LanguageLinksContent, CategoriesContent
351 // @TODO: add support for ar_content_format, ar_content_model, rev_content_format, rev_content_model to API
356 * A content object represents page content, e.g. the text to show on a page.
357 * Content objects have no knowledge about how they relate to Wiki pages.
361 abstract class AbstractContent
implements Content
{
364 * Name of the content model this Content object represents.
365 * Use with CONTENT_MODEL_XXX constants
367 * @var String $model_id
372 * @param int $model_id
374 public function __construct( $model_id = null ) {
375 $this->model_id
= $model_id;
379 * Returns the id of the content model used by this content objects.
380 * Corresponds to the CONTENT_MODEL_XXX constants.
384 * @return int the model id
386 public function getModel() {
387 return $this->model_id
;
391 * Throws an MWException if $model_id is not the id of the content model
392 * supported by this Content object.
394 * @param int $model_id the model to check
396 * @throws MWException
398 protected function checkModelID( $model_id ) {
399 if ( $model_id !== $this->model_id
) {
400 $model_name = ContentHandler
::getContentModelName( $model_id );
401 $own_model_name = ContentHandler
::getContentModelName( $this->model_id
);
403 throw new MWException( "Bad content model: expected {$this->model_id} ($own_model_name) but got found $model_id ($model_name)." );
408 * Convenience method that returns the ContentHandler singleton for handling the content
409 * model this Content object uses.
411 * Shorthand for ContentHandler::getForContent( $this )
415 * @return ContentHandler
417 public function getContentHandler() {
418 return ContentHandler
::getForContent( $this );
422 * Convenience method that returns the default serialization format for the content model
423 * model this Content object uses.
425 * Shorthand for $this->getContentHandler()->getDefaultFormat()
429 * @return ContentHandler
431 public function getDefaultFormat() {
432 return $this->getContentHandler()->getDefaultFormat();
436 * Convenience method that returns the list of serialization formats supported
437 * for the content model model this Content object uses.
439 * Shorthand for $this->getContentHandler()->getSupportedFormats()
443 * @return array of supported serialization formats
445 public function getSupportedFormats() {
446 return $this->getContentHandler()->getSupportedFormats();
450 * Returns true if $format is a supported serialization format for this Content object,
453 * Note that this will always return true if $format is null, because null stands for the
454 * default serialization.
456 * Shorthand for $this->getContentHandler()->isSupportedFormat( $format )
460 * @param String $format the format to check
461 * @return bool whether the format is supported
463 public function isSupportedFormat( $format ) {
465 return true; // this means "use the default"
468 return $this->getContentHandler()->isSupportedFormat( $format );
472 * Throws an MWException if $this->isSupportedFormat( $format ) doesn't return true.
475 * @throws MWException
477 protected function checkFormat( $format ) {
478 if ( !$this->isSupportedFormat( $format ) ) {
479 throw new MWException( "Format $format is not supported for content model " . $this->getModel() );
484 * Convenience method for serializing this Content object.
486 * Shorthand for $this->getContentHandler()->serializeContent( $this, $format )
490 * @param null|String $format the desired serialization format (or null for the default format).
491 * @return String serialized form of this Content object
493 public function serialize( $format = null ) {
494 return $this->getContentHandler()->serializeContent( $this, $format );
498 * Returns true if this Content object represents empty content.
502 * @return bool whether this Content object is empty
504 public function isEmpty() {
505 return $this->getSize() == 0;
509 * Returns if the content is valid. This is intended for local validity checks, not considering global consistency.
510 * It needs to be valid before it can be saved.
512 * This default implementation always returns true.
518 public function isValid() {
523 * Returns true if this Content objects is conceptually equivalent to the given Content object.
525 * Will returns false if $that is null.
526 * Will return true if $that === $this.
527 * Will return false if $that->getModelName() != $this->getModel().
528 * Will return false if $that->getNativeData() is not equal to $this->getNativeData(),
529 * where the meaning of "equal" depends on the actual data model.
531 * Implementations should be careful to make equals() transitive and reflexive:
533 * * $a->equals( $b ) <=> $b->equals( $a )
534 * * $a->equals( $b ) && $b->equals( $c ) ==> $a->equals( $c )
538 * @param Content $that the Content object to compare to
539 * @return bool true if this Content object is euqual to $that, false otherwise.
541 public function equals( Content
$that = null ) {
542 if ( is_null( $that ) ){
546 if ( $that === $this ) {
550 if ( $that->getModel() !== $this->getModel() ) {
554 return $this->getNativeData() === $that->getNativeData();
558 * Convenience method, shorthand for
559 * $this->getContentHandler()->getParserOutput( $this, $title, $revId, $options, $generateHtml )
561 * @note: subclasses should NOT override this to provide custom rendering.
562 * Override ContentHandler::getParserOutput() instead!
564 * @param Title $title
566 * @param null|ParserOptions $options
567 * @param Boolean $generateHtml whether to generate Html (default: true). If false,
568 * the result of calling getText() on the ParserOutput object returned by
569 * this method is undefined.
573 * @return ParserOutput
575 public function getParserOutput( Title
$title, $revId = null, ParserOptions
$options = null, $generateHtml = true ) {
576 return $this->getContentHandler()->getParserOutput( $this, $title, $revId, $options, $generateHtml );
580 * Construct the redirect destination from this content and return an
581 * array of Titles, or null if this content doesn't represent a redirect.
582 * The last element in the array is the final destination after all redirects
583 * have been resolved (up to $wgMaxRedirects times).
587 * @return Array of Titles, with the destination last
589 public function getRedirectChain() {
594 * Construct the redirect destination from this content and return a Title,
595 * or null if this content doesn't represent a redirect.
596 * This will only return the immediate redirect target, useful for
597 * the redirect table and other checks that don't need full recursion.
601 * @return Title: The corresponding Title
603 public function getRedirectTarget() {
608 * Construct the redirect destination from this content and return the
609 * Title, or null if this content doesn't represent a redirect.
610 * This will recurse down $wgMaxRedirects times or until a non-redirect target is hit
611 * in order to provide (hopefully) the Title of the final destination instead of another redirect.
617 public function getUltimateRedirectTarget() {
626 public function isRedirect() {
627 return $this->getRedirectTarget() !== null;
631 * Returns the section with the given id.
633 * The default implementation returns null.
637 * @param String $sectionId the section's id, given as a numeric string. The id "0" retrieves the section before
638 * the first heading, "1" the text between the first heading (included) and the second heading (excluded), etc.
639 * @return Content|Boolean|null the section, or false if no such section exist, or null if sections are not supported
641 public function getSection( $sectionId ) {
646 * Replaces a section of the content and returns a Content object with the section replaced.
650 * @param $section empty/null/false or a section number (0, 1, 2, T1, T2...), or "new"
651 * @param $with Content: new content of the section
652 * @param $sectionTitle String: new section's subject, only if $section is 'new'
653 * @return string Complete article text, or null if error
655 public function replaceSection( $section, Content
$with, $sectionTitle = '' ) {
660 * Returns a Content object with pre-save transformations applied (or this object if no transformations apply).
664 * @param Title $title
666 * @param null|ParserOptions $popts
669 public function preSaveTransform( Title
$title, User
$user, ParserOptions
$popts ) {
674 * Returns a new WikitextContent object with the given section heading prepended, if supported.
675 * The default implementation just returns this Content object unmodified, ignoring the section header.
679 * @param $header String
682 public function addSectionHeader( $header ) {
687 * Returns a Content object with preload transformations applied (or this object if no transformations apply).
691 * @param Title $title
692 * @param null|ParserOptions $popts
695 public function preloadTransform( Title
$title, ParserOptions
$popts ) {
701 * Content object implementation for representing flat text.
703 * TextContent instances are immutable
707 abstract class TextContent
extends AbstractContent
{
709 public function __construct( $text, $model_id = null ) {
710 parent
::__construct( $model_id );
712 $this->mText
= $text;
715 public function copy() {
716 return $this; #NOTE: this is ok since TextContent are immutable.
719 public function getTextForSummary( $maxlength = 250 ) {
722 $text = $this->getNativeData();
724 $truncatedtext = $wgContLang->truncate(
725 preg_replace( "/[\n\r]/", ' ', $text ),
726 max( 0, $maxlength ) );
728 return $truncatedtext;
732 * returns the text's size in bytes.
734 * @return int the size
736 public function getSize( ) {
737 $text = $this->getNativeData( );
738 return strlen( $text );
742 * Returns true if this content is not a redirect, and $wgArticleCountMethod is "any".
744 * @param $hasLinks Bool: if it is known whether this content contains links, provide this information here,
745 * to avoid redundant parsing to find out.
747 * @return bool true if the content is countable
749 public function isCountable( $hasLinks = null ) {
750 global $wgArticleCountMethod;
752 if ( $this->isRedirect( ) ) {
756 if ( $wgArticleCountMethod === 'any' ) {
764 * Returns the text represented by this Content object, as a string.
766 * @return String the raw text
768 public function getNativeData( ) {
769 $text = $this->mText
;
774 * Returns the text represented by this Content object, as a string.
776 * @return String the raw text
778 public function getTextForSearchIndex( ) {
779 return $this->getNativeData();
783 * Returns the text represented by this Content object, as a string.
785 * @return String the raw text
787 public function getWikitextForTransclusion( ) {
788 return $this->getNativeData();
792 * Diff this content object with another content object..
796 * @param Content $that the other content object to compare this content object to
797 * @param Language $lang the language object to use for text segmentation. If not given, $wgContentLang is used.
799 * @return DiffResult a diff representing the changes that would have to be made to this content object
800 * to make it equal to $that.
802 public function diff( Content
$that, Language
$lang = null ) {
805 $this->checkModelID( $that->getModel() );
807 #@todo: could implement this in DifferenceEngine and just delegate here?
809 if ( !$lang ) $lang = $wgContLang;
811 $otext = $this->getNativeData();
812 $ntext = $this->getNativeData();
814 # Note: Use native PHP diff, external engines don't give us abstract output
815 $ota = explode( "\n", $wgContLang->segmentForDiff( $otext ) );
816 $nta = explode( "\n", $wgContLang->segmentForDiff( $ntext ) );
818 $diff = new Diff( $ota, $nta );
828 class WikitextContent
extends TextContent
{
830 public function __construct( $text ) {
831 parent
::__construct($text, CONTENT_MODEL_WIKITEXT
);
835 * Returns the section with the given id.
837 * @param String $section
839 * @internal param String $sectionId the section's id
840 * @return Content|false|null the section, or false if no such section exist, or null if sections are not supported
842 public function getSection( $section ) {
845 $text = $this->getNativeData();
846 $sect = $wgParser->getSection( $text, $section, false );
848 return new WikitextContent( $sect );
852 * Replaces a section in the wikitext
854 * @param $section empty/null/false or a section number (0, 1, 2, T1, T2...), or "new"
855 * @param $with Content: new content of the section
856 * @param $sectionTitle String: new section's subject, only if $section is 'new'
858 * @throws MWException
859 * @return Content Complete article content, or null if error
861 public function replaceSection( $section, Content
$with, $sectionTitle = '' ) {
862 wfProfileIn( __METHOD__
);
864 $myModelId = $this->getModel();
865 $sectionModelId = $with->getModel();
867 if ( $sectionModelId != $myModelId ) {
868 $myModelName = ContentHandler
::getContentModelName( $myModelId );
869 $sectionModelName = ContentHandler
::getContentModelName( $sectionModelId );
871 throw new MWException( "Incompatible content model for section: document uses $myModelId ($myModelName), "
872 . "section uses $sectionModelId ($sectionModelName)." );
875 $oldtext = $this->getNativeData();
876 $text = $with->getNativeData();
878 if ( $section === '' ) {
879 return $with; #XXX: copy first?
880 } if ( $section == 'new' ) {
881 # Inserting a new section
882 $subject = $sectionTitle ?
wfMsgForContent( 'newsectionheaderdefaultlevel', $sectionTitle ) . "\n\n" : '';
883 if ( wfRunHooks( 'PlaceNewSection', array( $this, $oldtext, $subject, &$text ) ) ) {
884 $text = strlen( trim( $oldtext ) ) > 0
885 ?
"{$oldtext}\n\n{$subject}{$text}"
886 : "{$subject}{$text}";
889 # Replacing an existing section; roll out the big guns
892 $text = $wgParser->replaceSection( $oldtext, $section, $text );
895 $newContent = new WikitextContent( $text );
897 wfProfileOut( __METHOD__
);
902 * Returns a new WikitextContent object with the given section heading prepended.
904 * @param $header String
907 public function addSectionHeader( $header ) {
908 $text = wfMsgForContent( 'newsectionheaderdefaultlevel', $header ) . "\n\n" . $this->getNativeData();
910 return new WikitextContent( $text );
914 * Returns a Content object with pre-save transformations applied (or this object if no transformations apply).
916 * @param Title $title
918 * @param ParserOptions $popts
921 public function preSaveTransform( Title
$title, User
$user, ParserOptions
$popts ) { #FIXME: also needed for JS/CSS!
922 global $wgParser, $wgConteLang;
924 $text = $this->getNativeData();
925 $pst = $wgParser->preSaveTransform( $text, $title, $user, $popts );
927 return new WikitextContent( $pst );
931 * Returns a Content object with preload transformations applied (or this object if no transformations apply).
933 * @param Title $title
934 * @param ParserOptions $popts
937 public function preloadTransform( Title
$title, ParserOptions
$popts ) {
938 global $wgParser, $wgConteLang;
940 $text = $this->getNativeData();
941 $plt = $wgParser->getPreloadText( $text, $title, $popts );
943 return new WikitextContent( $plt );
946 public function getRedirectChain() {
947 $text = $this->getNativeData();
948 return Title
::newFromRedirectArray( $text );
951 public function getRedirectTarget() {
952 $text = $this->getNativeData();
953 return Title
::newFromRedirect( $text );
956 public function getUltimateRedirectTarget() {
957 $text = $this->getNativeData();
958 return Title
::newFromRedirectRecurse( $text );
962 * Returns true if this content is not a redirect, and this content's text is countable according to
963 * the criteria defined by $wgArticleCountMethod.
965 * @param Bool $hasLinks if it is known whether this content contains links, provide this information here,
966 * to avoid redundant parsing to find out.
967 * @param null|\Title $title
969 * @internal param \IContextSource $context context for parsing if necessary
971 * @return bool true if the content is countable
973 public function isCountable( $hasLinks = null, Title
$title = null ) {
974 global $wgArticleCountMethod, $wgRequest;
976 if ( $this->isRedirect( ) ) {
980 $text = $this->getNativeData();
982 switch ( $wgArticleCountMethod ) {
986 return strpos( $text, ',' ) !== false;
988 if ( $hasLinks === null ) { # not known, find out
990 $context = RequestContext
::getMain();
991 $title = $context->getTitle();
994 $po = $this->getParserOutput( $title, null, null, false );
995 $links = $po->getLinks();
996 $hasLinks = !empty( $links );
1005 public function getTextForSummary( $maxlength = 250 ) {
1006 $truncatedtext = parent
::getTextForSummary( $maxlength );
1008 #clean up unfinished links
1009 #XXX: make this optional? wasn't there in autosummary, but required for deletion summary.
1010 $truncatedtext = preg_replace( '/\[\[([^\]]*)\]?$/', '$1', $truncatedtext );
1012 return $truncatedtext;
1020 class MessageContent
extends TextContent
{
1021 public function __construct( $msg_key, $params = null, $options = null ) {
1022 parent
::__construct(null, CONTENT_MODEL_WIKITEXT
); #XXX: messages may be wikitext, html or plain text! and maybe even something else entirely.
1024 $this->mMessageKey
= $msg_key;
1026 $this->mParameters
= $params;
1028 if ( is_null( $options ) ) {
1031 elseif ( is_string( $options ) ) {
1032 $options = array( $options );
1035 $this->mOptions
= $options;
1039 * Returns the message as rendered HTML, using the options supplied to the constructor plus "parse".
1040 * @return String the message text, parsed
1042 public function getHtml( ) {
1043 $opt = array_merge( $this->mOptions
, array('parse') );
1045 return wfMsgExt( $this->mMessageKey
, $this->mParameters
, $opt );
1050 * Returns the message as raw text, using the options supplied to the constructor minus "parse" and "parseinline".
1052 * @return String the message text, unparsed.
1054 public function getNativeData( ) {
1055 $opt = array_diff( $this->mOptions
, array('parse', 'parseinline') );
1057 return wfMsgExt( $this->mMessageKey
, $this->mParameters
, $opt );
1065 class JavaScriptContent
extends TextContent
{
1066 public function __construct( $text ) {
1067 parent
::__construct($text, CONTENT_MODEL_JAVASCRIPT
);
1075 class CssContent
extends TextContent
{
1076 public function __construct( $text ) {
1077 parent
::__construct($text, CONTENT_MODEL_CSS
);