MediaWiki REL1_34
|
Represents the content of a Scribunto script page. More...
Public Member Functions | |
__construct ( $text) | |
prepareSave (WikiPage $page, $flags, $parentRevId, User $user) | |
validate (Title $title) | |
Checks whether the script is valid. | |
Public Member Functions inherited from TextContent | |
__construct ( $text, $model_id=CONTENT_MODEL_TEXT) | |
convert ( $toModel, $lossy='') | |
This implementation provides lossless conversion between content models based on TextContent. | |
copy () | |
diff (Content $that, Language $lang=null) | |
Diff this content object with another content object. | |
getNativeData () | |
Returns the text represented by this Content object, as a string. | |
getSize () | |
Returns the text's size in bytes. | |
getText () | |
Returns the text represented by this Content object, as a string. | |
getTextForSearchIndex () | |
Returns the text represented by this Content object, as a string. | |
getTextForSummary ( $maxlength=250) | |
Returns a textual representation of the content suitable for use in edit summaries and log messages. | |
getWikitextForTransclusion () | |
Returns attempts to convert this content object to wikitext, and then returns the text string. | |
isCountable ( $hasLinks=null) | |
Returns true if this content is not a redirect, and $wgArticleCountMethod is "any". | |
preSaveTransform (Title $title, User $user, ParserOptions $popts) | |
Returns a Content object with pre-save transformations applied. | |
Public Member Functions inherited from AbstractContent | |
addSectionHeader ( $header) | |
equals (Content $that=null) | |
Decides whether two Content objects are equal. | |
getContentHandler () | |
getDefaultFormat () | |
getDeletionUpdates (WikiPage $page, ParserOutput $parserOutput=null) | |
getModel () | |
getParserOutput (Title $title, $revId=null, ParserOptions $options=null, $generateHtml=true) | |
Returns a ParserOutput object containing information derived from this content. | |
getRedirectChain () | |
getRedirectTarget () | |
Subclasses that implement redirects should override this. | |
getSecondaryDataUpdates (Title $title, Content $old=null, $recursive=true, ParserOutput $parserOutput=null) | |
Returns a list of DataUpdate objects for recording information about this Content in some secondary data store. | |
getSection ( $sectionId) | |
getSupportedFormats () | |
getUltimateRedirectTarget () | |
isEmpty () | |
isRedirect () | |
isSupportedFormat ( $format) | |
isValid () | |
Subclasses may override this to implement (light weight) validation. | |
matchMagicWord (MagicWord $word) | |
This default implementation always returns false. | |
preloadTransform (Title $title, ParserOptions $popts, $params=[]) | |
replaceSection ( $sectionId, Content $with, $sectionTitle='') | |
serialize ( $format=null) | |
updateRedirect (Title $target) | |
This default implementation always returns $this. | |
Protected Member Functions | |
fillParserOutput (Title $title, $revId, ParserOptions $options, $generateHtml, ParserOutput &$output) | |
Parse the Content object and generate a ParserOutput from the result. | |
highlight ( $text, ParserOutput $output, ScribuntoEngineBase $engine) | |
Adds syntax highlighting to the output (or do not touch it and return false). | |
Protected Member Functions inherited from TextContent | |
getHighlightHtml () | |
Generates an HTML version of the content, for display. | |
getHtml () | |
Generates an HTML version of the content, for display. | |
Protected Member Functions inherited from AbstractContent | |
checkFormat ( $format) | |
checkModelID ( $modelId) | |
equalsInternal (Content $that) | |
Checks whether $that is logically equal to this Content object. | |
Additional Inherited Members | |
Static Public Member Functions inherited from TextContent | |
static | normalizeLineEndings ( $text) |
Do a "\\r\\n" -> "\\n" and "\\r" -> "\\n" transformation as well as trim trailing whitespace. | |
Protected Attributes inherited from TextContent | |
string | $mText |
Protected Attributes inherited from AbstractContent | |
$model_id | |
Name of the content model this Content object represents. | |
Represents the content of a Scribunto script page.
Definition at line 15 of file ScribuntoContent.php.
ScribuntoContent::__construct | ( | $modelId | ) |
string | null | $modelId |
Reimplemented from AbstractContent.
Definition at line 17 of file ScribuntoContent.php.
|
protected |
Parse the Content object and generate a ParserOutput from the result.
Title | $title | The page title to use as a context for rendering |
null | int | $revId | The revision being rendered (optional) |
ParserOptions | $options | Any parser options |
bool | $generateHtml | Whether to generate HTML (default: true). |
ParserOutput | &$output | ParserOutput representing the HTML form of the text. |
Reimplemented from TextContent.
Definition at line 47 of file ScribuntoContent.php.
References $title, $wgParser, ParserOutput\addTemplate(), ParserOutput\addTrackingCategory(), Scribunto\getDocPage(), ParserOutput\getRawText(), ParserOptions\getTargetLanguage(), TextContent\getText(), highlight(), Scribunto\newDefaultEngine(), ParserOptions\setTargetLanguage(), ParserOutput\setText(), validate(), and wfMessage().
|
protected |
Adds syntax highlighting to the output (or do not touch it and return false).
string | $text | |
ParserOutput | $output | |
ScribuntoEngineBase | $engine |
Definition at line 140 of file ScribuntoContent.php.
References ParserOutput\addModuleStyles(), ScribuntoEngineBase\getGeSHiLanguage(), ParserOutput\getRawText(), SyntaxHighlight\highlight(), and ParserOutput\setText().
Referenced by fillParserOutput().
Reimplemented from AbstractContent.
Definition at line 33 of file ScribuntoContent.php.
References WikiPage\getTitle(), and validate().
ScribuntoContent::validate | ( | Title | $title | ) |
Checks whether the script is valid.
Title | $title |
Definition at line 27 of file ScribuntoContent.php.
References $title, Title\getPrefixedDBkey(), TextContent\getText(), and Scribunto\newDefaultEngine().
Referenced by fillParserOutput(), and prepareSave().