Go to the documentation of this file.
52 if ( $sect ===
false ) {
75 if ( $sectionModelId != $myModelId ) {
77 throw new MWException(
"Incompatible content model for section: " .
78 "document uses $myModelId but " .
79 "section uses $sectionModelId." );
88 return $with; # XXX:
copy first?
92 # Inserting a new section
93 $subject = $sectionTitle ?
wfMessage(
'newsectionheaderdefaultlevel' )
94 ->rawParams( $sectionTitle )->inContentLanguage()->text() .
"\n\n" :
'';
95 if (
wfRunHooks(
'PlaceNewSection',
array( $this, $oldtext, $subject, &$text ) ) ) {
96 $text = strlen( trim( $oldtext ) ) > 0
97 ?
"{$oldtext}\n\n{$subject}{$text}"
98 :
"{$subject}{$text}";
101 # Replacing an existing section; roll out the big guns
123 $text =
wfMessage(
'newsectionheaderdefaultlevel' )
124 ->rawParams( $header )->inContentLanguage()->text();
182 if ( $wgMaxRedirects < 1 ) {
188 if ( $redir->matchStartAndRemove( $text ) ) {
193 if ( preg_match(
'!^\s*:?\s*\[{2}(.*?)(?:\|.*?)?\]{2}!', $text, $m ) ) {
196 if ( strpos( $m[1],
'%' ) !==
false ) {
198 $m[1] = rawurldecode( ltrim( $m[1],
':' ) );
231 # Remember that redirect pages can have categories, templates, etc.,
232 # so the regex has to be fairly general
233 $newText = preg_replace(
'/ \[ \[ [^\]]* \] \] /x',
254 global $wgArticleCountMethod;
262 switch ( $wgArticleCountMethod ) {
266 return strpos( $text,
',' ) !==
false;
268 if ( $hasLinks ===
null ) { # not known, find out
271 $title = $context->getTitle();
275 $links = $po->getLinks();
276 $hasLinks = !empty( $links );
290 $truncatedtext = parent::getTextForSummary( $maxlength );
292 # clean up unfinished links
293 # XXX: make this optional? wasn't there in autosummary, but required for
295 $truncatedtext = preg_replace(
'/\[\[([^\]]*)\]?$/',
'$1', $truncatedtext );
297 return $truncatedtext;
332 "getHtml() not implemented for wikitext. "
333 .
"Use getParserOutput()->getText()."
Set options of the Parser.
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
getRedirectTarget()
Implement redirect extraction for wikitext.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
preloadTransform(Title $title, ParserOptions $popts, $params=array())
Returns a Content object with preload transformations applied (or this object if no transformations a...
wfProfileIn( $functionname)
Begin profiling of a function.
static & get( $id)
Factory: creates an object representing an ID.
updateRedirect(Title $target)
This implementation replaces the first link on the page with the given new target if this Content obj...
const CONTENT_MODEL_WIKITEXT
replaceSection( $section, Content $with, $sectionTitle='')
wfProfileOut( $functionname='missing')
Stop profiling of a function.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing after in associative array form externallinks including delete and has completed for all link tables default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "<
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
getFullText()
Get the prefixed title with spaces, plus any fragment (part beginning with '#')
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
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...
when a variable name is used in a it is silently declared as a new masking the global
This class encapsulates "magic words" such as "#redirect", NOTOC, etc.
Content object for wiki text pages.
preSaveTransform(Title $title, User $user, ParserOptions $popts)
Returns a Content object with pre-save transformations applied using Parser::preSaveTransform().
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
presenting them properly to the user as errors is done by the caller $title
matchMagicWord(MagicWord $word)
This implementation calls $word->match() on the this TextContent object's text.
getNativeData()
Returns native representation of the data.
getTextForSummary( $maxlength=250)
static getMain()
Static methods.
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
Content object implementation for representing flat text.
Base interface for content objects.
Represents a title within MediaWiki.
addSectionHeader( $header)
Returns a new WikitextContent object with the given section heading prepended.
getModel()
Returns the ID of the content model used by this Content object.
getParserOutput(Title $title, $revId=null, ParserOptions $options=null, $generateHtml=true)
Returns a ParserOutput object resulting from parsing the content's text using $wgParser.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
match( $text)
Returns true if the text contains the word.
getNativeData()
Returns the text represented by this Content object, as a string.