MediaWiki  1.23.2
MessageContent Class Reference

Wrapper allowing us to handle a system message as a Content object. More...

Inheritance diagram for MessageContent:
Collaboration diagram for MessageContent:

Public Member Functions

 __construct ( $msg, $params=null)
 
 copy ()
 
 getHtml ()
 Fully parse the text from wikitext to HTML. More...
 
 getNativeData ()
 Returns the message object, with any parameters already substituted. More...
 
 getParserOutput (Title $title, $revId=null, ParserOptions $options=null, $generateHtml=true)
 
 getSize ()
 
 getTextForSearchIndex ()
 
 getTextForSummary ( $maxlength=250)
 
 getWikitext ()
 Returns the message text. More...
 
 getWikitextForTransclusion ()
 
 isCountable ( $hasLinks=null)
 
- Public Member Functions inherited from AbstractContent
 __construct ( $modelId=null)
 
 addSectionHeader ( $header)
 
 convert ( $toModel, $lossy='')
 This base implementation calls the hook ConvertContent to enable custom conversions. More...
 
 equals (Content $that=null)
 
 getContentHandler ()
 
 getDefaultFormat ()
 
 getDeletionUpdates (WikiPage $page, ParserOutput $parserOutput=null)
 
 getModel ()
 
 getRedirectChain ()
 
 getRedirectTarget ()
 Subclasses that implement redirects should override this. More...
 
 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. More...
 
 getSection ( $sectionId)
 
 getSupportedFormats ()
 
 getUltimateRedirectTarget ()
 
 isEmpty ()
 
 isRedirect ()
 
 isSupportedFormat ( $format)
 
 isValid ()
 Subclasses may override this to implement (light weight) validation. More...
 
 matchMagicWord (MagicWord $word)
 This default implementation always returns false. More...
 
 preloadTransform (Title $title, ParserOptions $popts, $params=array())
 
 prepareSave (WikiPage $page, $flags, $baseRevId, User $user)
 
 preSaveTransform (Title $title, User $user, ParserOptions $popts)
 
 replaceSection ( $section, Content $with, $sectionTitle='')
 
 serialize ( $format=null)
 
 updateRedirect (Title $target)
 This default implementation always returns $this. More...
 

Protected Attributes

Message $mMessage
 
- Protected Attributes inherited from AbstractContent
string $model_id
 Name of the content model this Content object represents. More...
 

Additional Inherited Members

- Protected Member Functions inherited from AbstractContent
 checkFormat ( $format)
 
 checkModelID ( $modelId)
 

Detailed Description

Wrapper allowing us to handle a system message as a Content object.

Note that this is generally not used to represent content from the MediaWiki namespace, and that there is no MessageContentHandler. MessageContent is just intended as glue for wrapping a message programatically.

Definition at line 36 of file MessageContent.php.

Constructor & Destructor Documentation

◆ __construct()

MessageContent::__construct (   $msg,
  $params = null 
)
Parameters
Message | string$msgA Message object, or a message key.
string[]$paramsAn optional array of message parameters.

Definition at line 46 of file MessageContent.php.

References $params, CONTENT_MODEL_WIKITEXT, and wfMessage().

Member Function Documentation

◆ copy()

MessageContent::copy ( )
Returns
Content. A copy of this object
See also
Content::copy

Implements Content.

Definition at line 132 of file MessageContent.php.

◆ getHtml()

MessageContent::getHtml ( )

Fully parse the text from wikitext to HTML.

Returns
string Parsed HTML.

Definition at line 66 of file MessageContent.php.

Referenced by getParserOutput().

◆ getNativeData()

MessageContent::getNativeData ( )

Returns the message object, with any parameters already substituted.

Returns
Message The message object.

Implements Content.

Definition at line 84 of file MessageContent.php.

References $mMessage.

◆ getParserOutput()

MessageContent::getParserOutput ( Title  $title,
  $revId = null,
ParserOptions  $options = null,
  $generateHtml = true 
)
Parameters
Title$titleUnused.
int$revIdUnused.
ParserOptions$optionsUnused.
bool$generateHtmlWhether to generate HTML (default: true).
Returns
ParserOutput
See also
Content::getParserOutput

Implements Content.

Definition at line 158 of file MessageContent.php.

References $html, and getHtml().

◆ getSize()

MessageContent::getSize ( )
Returns
int
See also
Content::getSize

Implements Content.

Definition at line 123 of file MessageContent.php.

◆ getTextForSearchIndex()

MessageContent::getTextForSearchIndex ( )
Returns
string
See also
Content::getTextForSearchIndex

Implements Content.

Definition at line 94 of file MessageContent.php.

◆ getTextForSummary()

MessageContent::getTextForSummary (   $maxlength = 250)
Parameters
int$maxLengthMaximum length of the summary text, defaults to 250.
Returns
string The summary text.
See also
Content::getTextForSummary

Implements Content.

Definition at line 114 of file MessageContent.php.

◆ getWikitext()

MessageContent::getWikitext ( )

Returns the message text.

{{-transformation is done.

Returns
string Unescaped message text.

Definition at line 75 of file MessageContent.php.

Referenced by getWikitextForTransclusion().

◆ getWikitextForTransclusion()

MessageContent::getWikitextForTransclusion ( )
Returns
string
See also
Content::getWikitextForTransclusion

Implements Content.

Definition at line 103 of file MessageContent.php.

References getWikitext().

◆ isCountable()

MessageContent::isCountable (   $hasLinks = null)
Parameters
bool$hasLinks
Returns
bool Always false.
See also
Content::isCountable

Implements Content.

Definition at line 144 of file MessageContent.php.

Member Data Documentation

◆ $mMessage

Message MessageContent::$mMessage
protected

Definition at line 40 of file MessageContent.php.

Referenced by getNativeData().


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