MediaWiki  1.23.14
Content.php
Go to the documentation of this file.
1 <?php
34 interface Content {
35 
46  public function getTextForSearchIndex();
47 
60  public function getWikitextForTransclusion();
61 
72  public function getTextForSummary( $maxLength = 250 );
73 
86  public function getNativeData();
87 
93  public function getSize();
94 
103  public function getModel();
104 
115  public function getContentHandler();
116 
127  public function getDefaultFormat();
128 
139  public function getSupportedFormats();
140 
156  public function isSupportedFormat( $format );
157 
169  public function serialize( $format = null );
170 
178  public function isEmpty();
179 
192  public function isValid();
193 
217  public function equals( Content $that = null );
218 
237  public function copy();
238 
252  public function isCountable( $hasLinks = null );
253 
275  public function getParserOutput( Title $title, $revId = null,
276  ParserOptions $options = null, $generateHtml = true );
277 
278  // TODO: make RenderOutput and RenderOptions base classes
279 
309  public function getSecondaryDataUpdates( Title $title, Content $old = null,
310  $recursive = true, ParserOutput $parserOutput = null );
311 
322  public function getRedirectChain();
323 
334  public function getRedirectTarget();
335 
351  public function getUltimateRedirectTarget();
352 
361  public function isRedirect();
362 
374  public function updateRedirect( Title $target );
375 
389  public function getSection( $sectionId );
390 
403  public function replaceSection( $section, Content $with, $sectionTitle = '' );
404 
417  public function preSaveTransform( Title $title, User $user, ParserOptions $parserOptions );
418 
430  public function addSectionHeader( $header );
431 
444  public function preloadTransform( Title $title, ParserOptions $parserOptions, $params = array() );
445 
472  public function prepareSave( WikiPage $page, $flags, $baseRevId, User $user );
473 
489  public function getDeletionUpdates( WikiPage $page,
490  ParserOutput $parserOutput = null );
491 
501  public function matchMagicWord( MagicWord $word );
502 
515  public function convert( $toModel, $lossy = '' );
516  // @todo ImagePage and CategoryPage interfere with per-content action handlers
517  // @todo nice&sane integration of GeSHi syntax highlighting
518  // [11:59] <vvv> Hooks are ugly; make CodeHighlighter interface and a
519  // config to set the class which handles syntax highlighting
520  // [12:00] <vvv> And default it to a DummyHighlighter
521 
522 }
Content\getContentHandler
getContentHandler()
Convenience method that returns the ContentHandler singleton for handling the content model that this...
ParserOptions
Set options of the Parser.
Definition: ParserOptions.php:31
Content\getDefaultFormat
getDefaultFormat()
Convenience method that returns the default serialization format for the content model that this Cont...
Content\isRedirect
isRedirect()
Returns whether this Content represents a redirect.
Content\serialize
serialize( $format=null)
Convenience method for serializing this Content object.
ParserOutput
Definition: ParserOutput.php:24
php
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
Definition: skin.txt:62
Content\isValid
isValid()
Returns whether the content is valid.
Content\convert
convert( $toModel, $lossy='')
Converts this content object into another content object with the given content model,...
WikiPage
Class representing a MediaWiki article and history.
Definition: WikiPage.php:37
Content\getTextForSearchIndex
getTextForSearchIndex()
$params
$params
Definition: styleTest.css.php:40
Content\preloadTransform
preloadTransform(Title $title, ParserOptions $parserOptions, $params=array())
Returns a Content object with preload transformations applied (or this object if no transformations a...
Content\getDeletionUpdates
getDeletionUpdates(WikiPage $page, ParserOutput $parserOutput=null)
Returns a list of updates to perform when this content is deleted.
$flags
it s the revision text itself In either if gzip is the revision text is gzipped $flags
Definition: hooks.txt:2124
Content\getSize
getSize()
Returns the content's nominal size in bogo-bytes.
Content\prepareSave
prepareSave(WikiPage $page, $flags, $baseRevId, User $user)
Prepare Content for saving.
Content\getWikitextForTransclusion
getWikitextForTransclusion()
Content\getUltimateRedirectTarget
getUltimateRedirectTarget()
Construct the redirect destination from this content and return the Title, or null if this content do...
Content\getSection
getSection( $sectionId)
Returns the section with the given ID.
Content\getSupportedFormats
getSupportedFormats()
Convenience method that returns the list of serialization formats supported for the content model tha...
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
MagicWord
This class encapsulates "magic words" such as "#redirect", NOTOC, etc.
Definition: MagicWord.php:61
Content\isEmpty
isEmpty()
Returns true if this Content object represents empty content.
Content\matchMagicWord
matchMagicWord(MagicWord $word)
Returns true if this Content object matches the given magic word.
$options
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
Definition: hooks.txt:1530
$section
$section
Definition: Utf8Test.php:88
Content\equals
equals(Content $that=null)
Returns true if this Content objects is conceptually equivalent to the given Content object.
Content\addSectionHeader
addSectionHeader( $header)
Returns a new WikitextContent object with the given section heading prepended, if supported.
$title
presenting them properly to the user as errors is done by the caller $title
Definition: hooks.txt:1324
Content\getRedirectChain
getRedirectChain()
Construct the redirect destination from this content and return an array of Titles,...
Content\updateRedirect
updateRedirect(Title $target)
If this Content object is a redirect, this method updates the redirect target.
Content\getSecondaryDataUpdates
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 d...
Content\getNativeData
getNativeData()
Returns native representation of the data.
Content\isSupportedFormat
isSupportedFormat( $format)
Returns true if $format is a supported serialization format for this Content object,...
$user
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
Definition: hooks.txt:237
Content\preSaveTransform
preSaveTransform(Title $title, User $user, ParserOptions $parserOptions)
Returns a Content object with pre-save transformations applied (or this object if no transformations ...
Content
Base interface for content objects.
Definition: Content.php:34
Title
Represents a title within MediaWiki.
Definition: Title.php:35
Content\copy
copy()
Return a copy of this Content object.
Content\getTextForSummary
getTextForSummary( $maxLength=250)
Returns a textual representation of the content suitable for use in edit summaries and log messages.
Content\getModel
getModel()
Returns the ID of the content model used by this Content object.
Content\replaceSection
replaceSection( $section, Content $with, $sectionTitle='')
Replaces a section of the content and returns a Content object with the section replaced.
Content\getParserOutput
getParserOutput(Title $title, $revId=null, ParserOptions $options=null, $generateHtml=true)
Parse the Content object and generate a ParserOutput from the result.
Content\getRedirectTarget
getRedirectTarget()
Construct the redirect destination from this content and return a Title, or null if this content does...
Content\isCountable
isCountable( $hasLinks=null)
Returns true if this content is countable as a "real" wiki page, provided that it's also in a countab...
User
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
Definition: User.php:59