MediaWiki
master
|
Public Member Functions | |
__construct ($text) | |
addSectionHeader ($header) | |
Returns a new WikitextContent object with the given section heading prepended. | |
getParserOutput (Title $title, $revId=null, ParserOptions $options=null, $generateHtml=true) | |
Returns a ParserOutput object resulting from parsing the content's text using $wgParser. | |
getRedirectTarget () | |
Implement redirect extraction for wikitext. | |
getSection ($section) | |
getTextForSummary ($maxlength=250) | |
Returns a textual representation of the content suitable for use in edit summaries and log messages. | |
isCountable ($hasLinks=null, Title $title=null) | |
Returns true if this content is not a redirect, and this content's text is countable according to the criteria defined by $wgArticleCountMethod. | |
matchMagicWord (MagicWord $word) | |
preloadTransform (Title $title, ParserOptions $popts) | |
Returns a Content object with preload transformations applied (or this object if no transformations apply). | |
preSaveTransform (Title $title, User $user, ParserOptions $popts) | |
Returns a Content object with pre-save transformations applied using Parser::preSaveTransform(). | |
replaceSection ($section, Content $with, $sectionTitle= '') | |
updateRedirect (Title $target) | |
Protected Member Functions | |
getHtml () | |
Generates an HTML version of the content, for display. |
Definition at line 25 of file WikitextContent.php.
WikitextContent::__construct | ( | $ | modelId | ) |
string | null | $modelId |
Reimplemented from AbstractContent.
Definition at line 27 of file WikitextContent.php.
WikitextContent::addSectionHeader | ( | $ | header | ) |
Returns a new WikitextContent object with the given section heading prepended.
$header | string |
Reimplemented from AbstractContent.
Definition at line 96 of file WikitextContent.php.
References TextContent\getNativeData(), and wfMessage().
WikitextContent::getHtml | ( | ) | [protected] |
Generates an HTML version of the content, for display.
Used by getParserOutput() to construct a ParserOutput object.
This default implementation just calls getHighlightHtml(). Content models that have another mapping to HTML (as is the case for markup languages like wikitext) should override this method to generate the appropriate HTML.
Reimplemented from TextContent.
Definition at line 294 of file WikitextContent.php.
WikitextContent::getParserOutput | ( | Title $ | title, |
$ | revId = null , |
||
ParserOptions $ | options = null , |
||
$ | generateHtml = true |
||
) |
Returns a ParserOutput object resulting from parsing the content's text using $wgParser.
$title | Title |
$revId | int Revision to pass to the parser (default: null) |
$options | ParserOptions (default: null) |
$generateHtml | bool (default: false) |
Reimplemented from TextContent.
Definition at line 279 of file WikitextContent.php.
References $options, $wgParser, AbstractContent\getContentHandler(), TextContent\getNativeData(), and global.
Referenced by isCountable().
Implement redirect extraction for wikitext.
Reimplemented from AbstractContent.
Definition at line 151 of file WikitextContent.php.
References $title, array(), MagicWord\get(), TextContent\getNativeData(), global, and Title\newFromText().
WikitextContent::getSection | ( | $ | section | ) |
Reimplemented from AbstractContent.
Definition at line 34 of file WikitextContent.php.
References $section, $wgParser, TextContent\getNativeData(), and global.
WikitextContent::getTextForSummary | ( | $ | maxLength = 250 | ) |
Returns a textual representation of the content suitable for use in edit summaries and log messages.
$maxLength | int Maximum length of the summary text |
Reimplemented from TextContent.
Definition at line 254 of file WikitextContent.php.
WikitextContent::isCountable | ( | $ | hasLinks = null , |
Title $ | title = null |
||
) |
Returns true if this content is not a redirect, and this content's text is countable according to the criteria defined by $wgArticleCountMethod.
$hasLinks | Bool if it is known whether this content contains links, provide this information here, to avoid redundant parsing to find out (default: null). |
$title | Title: (default: null) |
Definition at line 222 of file WikitextContent.php.
References $title, empty, RequestContext\getMain(), TextContent\getNativeData(), getParserOutput(), global, and AbstractContent\isRedirect().
WikitextContent::matchMagicWord | ( | MagicWord $ | word | ) |
This implementation calls $word->match() on the this TextContent object's text.
MagicWord | $word |
Reimplemented from AbstractContent.
Definition at line 310 of file WikitextContent.php.
References TextContent\getNativeData(), and MagicWord\match().
WikitextContent::preloadTransform | ( | Title $ | title, |
ParserOptions $ | popts | ||
) |
Returns a Content object with preload transformations applied (or this object if no transformations apply).
$title | Title |
$popts | ParserOptions |
Reimplemented from AbstractContent.
Definition at line 132 of file WikitextContent.php.
References $wgParser, TextContent\getNativeData(), and global.
WikitextContent::preSaveTransform | ( | Title $ | title, |
User $ | user, | ||
ParserOptions $ | popts | ||
) |
Returns a Content object with pre-save transformations applied using Parser::preSaveTransform().
$title | Title |
$user | User |
$popts | ParserOptions |
Reimplemented from TextContent.
Definition at line 114 of file WikitextContent.php.
References $wgParser, TextContent\getNativeData(), and global.
WikitextContent::replaceSection | ( | $ | section, |
Content $ | with, | ||
$ | sectionTitle = '' |
||
) |
Reimplemented from AbstractContent.
Definition at line 50 of file WikitextContent.php.
References $section, $wgParser, array(), TextContent\copy(), AbstractContent\getModel(), Content\getModel(), Content\getNativeData(), TextContent\getNativeData(), global, wfMessage(), wfProfileIn(), wfProfileOut(), and wfRunHooks().
WikitextContent::updateRedirect | ( | Title $ | target | ) |
This implementation replaces the first link on the page with the given new target if this Content object is a redirect. Otherwise, this method returns $this.
Title | $target |
Reimplemented from AbstractContent.
Definition at line 194 of file WikitextContent.php.
References Title\getFullText(), TextContent\getNativeData(), and AbstractContent\isRedirect().