BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
WikitextContent Class Reference
Inheritance diagram for WikitextContent:
Collaboration diagram for WikitextContent:

Public Member Functions

 __construct ($text)
 
 getSection ($sectionId)
 
 replaceSection ($sectionId, Content $with, $sectionTitle= '')
 
 addSectionHeader ($header)
 
 preSaveTransform (Title $title, User $user, ParserOptions $popts)
 
 preloadTransform (Title $title, ParserOptions $popts, $params=[])
 
 getRedirectTarget ()
 
 updateRedirect (Title $target)
 
 isCountable ($hasLinks=null, Title $title=null)
 
 getTextForSummary ($maxlength=250)
 
 matchMagicWord (MagicWord $word)
 
- Public Member Functions inherited from TextContent
 __construct ($text, $model_id=CONTENT_MODEL_TEXT)
 
 copy ()
 
 getTextForSummary ($maxlength=250)
 
 getSize ()
 
 isCountable ($hasLinks=null)
 
 getNativeData ()
 
 getTextForSearchIndex ()
 
 getWikitextForTransclusion ()
 
 preSaveTransform (Title $title, User $user, ParserOptions $popts)
 
 diff (Content $that, Language $lang=null)
 
 convert ($toModel, $lossy= '')
 
- Public Member Functions inherited from AbstractContent
 __construct ($modelId=null)
 
 getModel ()
 
 getContentHandler ()
 
 getDefaultFormat ()
 
 getSupportedFormats ()
 
 isSupportedFormat ($format)
 
 serialize ($format=null)
 
 isEmpty ()
 
 isValid ()
 
 equals (Content $that=null)
 
 getSecondaryDataUpdates (Title $title, Content $old=null, $recursive=true, ParserOutput $parserOutput=null)
 
 getRedirectChain ()
 
 getRedirectTarget ()
 
 getUltimateRedirectTarget ()
 
 isRedirect ()
 
 updateRedirect (Title $target)
 
 getSection ($sectionId)
 
 replaceSection ($sectionId, Content $with, $sectionTitle= '')
 
 preSaveTransform (Title $title, User $user, ParserOptions $popts)
 
 addSectionHeader ($header)
 
 preloadTransform (Title $title, ParserOptions $popts, $params=[])
 
 prepareSave (WikiPage $page, $flags, $parentRevId, User $user)
 
 getDeletionUpdates (WikiPage $page, ParserOutput $parserOutput=null)
 
 matchMagicWord (MagicWord $word)
 
 convert ($toModel, $lossy= '')
 
 getParserOutput (Title $title, $revId=null, ParserOptions $options=null, $generateHtml=true)
 

Protected Member Functions

 getRedirectTargetAndText ()
 
 fillParserOutput (Title $title, $revId, ParserOptions $options, $generateHtml, ParserOutput &$output)
 
 getHtml ()
 
- Protected Member Functions inherited from TextContent
 fillParserOutput (Title $title, $revId, ParserOptions $options, $generateHtml, ParserOutput &$output)
 
 getHtml ()
 
 getHighlightHtml ()
 
- Protected Member Functions inherited from AbstractContent
 checkModelID ($modelId)
 
 checkFormat ($format)
 
 fillParserOutput (Title $title, $revId, ParserOptions $options, $generateHtml, ParserOutput &$output)
 

Additional Inherited Members

- Static Public Member Functions inherited from TextContent
static normalizeLineEndings ($text)
 
- Protected Attributes inherited from TextContent
 $mText
 
- Protected Attributes inherited from AbstractContent
 $model_id
 

Detailed Description

Content object for wiki text pages.

Member Function Documentation

WikitextContent::addSectionHeader (   $header)

Returns a new WikitextContent object with the given section heading prepended.

Parameters
string$header
Returns
Content

Implements Content.

WikitextContent::fillParserOutput ( Title  $title,
  $revId,
ParserOptions  $options,
  $generateHtml,
ParserOutput $output 
)
protected

Returns a ParserOutput object resulting from parsing the content's text using $wgParser.

Parameters
Title$title
int$revIdRevision to pass to the parser (default: null)
ParserOptions$options(default: null)
bool$generateHtml(default: true)
ParserOutput&$outputParserOutput representing the HTML form of the text, may be manipulated or replaced.
WikitextContent::getHtml ( )
protected
Exceptions
MWException
WikitextContent::getRedirectTarget ( )

Implement redirect extraction for wikitext.

Returns
Title|null
See Also
Content::getRedirectTarget

Implements Content.

WikitextContent::getRedirectTargetAndText ( )
protected

Extract the redirect target and the remaining text on the page.

Note
migrated here from Title::newFromRedirectInternal()
Since
1.23
Returns
array List of two elements: Title|null and string.
WikitextContent::getSection (   $sectionId)
Parameters
string | int$sectionId
Returns
Content|bool|null
See Also
Content::getSection()

Implements Content.

WikitextContent::getTextForSummary (   $maxlength = 250)
Parameters
int$maxlength
Returns
string

Implements Content.

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.

Parameters
bool | null$hasLinksIf it is known whether this content contains links, provide this information here, to avoid redundant parsing to find out (default: null).
Title | null$titleOptional title, defaults to the title from the current main request.
Returns
bool
WikitextContent::matchMagicWord ( MagicWord  $word)

This implementation calls $word->match() on the this TextContent object's text.

Parameters
MagicWord$word
Returns
bool
See Also
Content::matchMagicWord()

Implements Content.

WikitextContent::preloadTransform ( Title  $title,
ParserOptions  $popts,
  $params = [] 
)

Returns a Content object with preload transformations applied (or this object if no transformations apply).

Parameters
Title$title
ParserOptions$popts
array$params
Returns
Content

Implements Content.

WikitextContent::preSaveTransform ( Title  $title,
User  $user,
ParserOptions  $popts 
)

Returns a Content object with pre-save transformations applied using Parser::preSaveTransform().

Parameters
Title$title
User$user
ParserOptions$popts
Returns
Content

Implements Content.

WikitextContent::replaceSection (   $sectionId,
Content  $with,
  $sectionTitle = '' 
)
Parameters
string | int | null | bool$sectionId
Content$with
string$sectionTitle
Exceptions
MWException
Returns
Content
See Also
Content::replaceSection()

Implements Content.

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.

Since
1.21
Parameters
Title$target
Returns
Content
See Also
Content::updateRedirect()

Implements Content.


The documentation for this class was generated from the following file: