CollaborationKit
MediaWiki CollaborationKit extension
Loading...
Searching...
No Matches
CollaborationHubContentHandler Class Reference
+ Inheritance diagram for CollaborationHubContentHandler:
+ Collaboration diagram for CollaborationHubContentHandler:

Public Member Functions

 __construct ( $modelId='CollaborationHubContent', $formats=[CONTENT_FORMAT_JSON, CONTENT_FORMAT_TEXT, self::FORMAT_WIKI])
 
 canBeUsedOn (Title $title)
 
 unserializeContent ( $text, $format=null)
 Constructs a CollaborationHubContent object.
 
 serializeContent (Content $content, $format=null)
 Serializes the CollaborationHubContent object.
 
 makeEmptyContent ()
 
 isParserCacheSupported ()
 
 supportsRedirects ()
 
 makeRedirectContent (Title $destination, $text='')
 Turns CollaborationHubContent page into redirect.
 

Static Public Member Functions

static edit (Title $title, $displayName, $image, $colour, $introduction, $footer, $content, $summary, IContextSource $context)
 Edit a Collaboration Hub via the edit API.
 
static onParserOutputPostCacheTransform ( $parserOutput, &$text, &$options)
 Post-parse out our button markers for uncachable permissions-dependent actions and stuff.
 

Public Attributes

const FORMAT_WIKI = 'text/x-collabkit'
 

Protected Member Functions

 getContentClass ()
 

Constructor & Destructor Documentation

◆ __construct()

CollaborationHubContentHandler::__construct ( $modelId = 'CollaborationHubContent',
$formats = [ CONTENT_FORMAT_JSON, CONTENT_FORMAT_TEXT, self::FORMAT_WIKI ] )
Parameters
string$modelId
string[]$formats

Member Function Documentation

◆ canBeUsedOn()

CollaborationHubContentHandler::canBeUsedOn ( Title $title)
Parameters
Title$titlePage to check
Returns
bool

◆ edit()

static CollaborationHubContentHandler::edit ( Title $title,
$displayName,
$image,
$colour,
$introduction,
$footer,
$content,
$summary,
IContextSource $context )
static

Edit a Collaboration Hub via the edit API.

Parameters
Title$title
string$displayName
string$image
string$colour
string$introduction
string$footer
array$content
string$summaryMessage key for edit summary
IContextSource$contextThe calling context
Returns
Status
+ Here is the caller graph for this function:

◆ getContentClass()

CollaborationHubContentHandler::getContentClass ( )
protected
Returns
string

◆ isParserCacheSupported()

CollaborationHubContentHandler::isParserCacheSupported ( )
Returns
bool

◆ makeEmptyContent()

CollaborationHubContentHandler::makeEmptyContent ( )

◆ makeRedirectContent()

CollaborationHubContentHandler::makeRedirectContent ( Title $destination,
$text = '' )

Turns CollaborationHubContent page into redirect.

Note that wikitext redirects are created, as generally, this content model is used in namespaces that support wikitext, and wikitext redirects are expected.

Parameters
Title$destinationThe page to redirect to
string$textText to include in the redirect.
Returns
Content

◆ onParserOutputPostCacheTransform()

static CollaborationHubContentHandler::onParserOutputPostCacheTransform ( $parserOutput,
& $text,
& $options )
static

Post-parse out our button markers for uncachable permissions-dependent actions and stuff.

Parameters
ParserOutput$parserOutput
string&$textThe text being transformed, before core transformations are done
array&$optionsThe options array being used for the transformation.
Returns
bool

◆ serializeContent()

CollaborationHubContentHandler::serializeContent ( Content $content,
$format = null )

Serializes the CollaborationHubContent object.

Parameters
Content | CollaborationHubContent$content
string | null$format
Returns
mixed

◆ supportsRedirects()

CollaborationHubContentHandler::supportsRedirects ( )
Returns
bool

◆ unserializeContent()

CollaborationHubContentHandler::unserializeContent ( $text,
$format = null )

Constructs a CollaborationHubContent object.

Does not perform any validation, as that is done at a later step (to allow for outputting of invalid content for debugging purposes.)

Parameters
string$text
string | null$format
Returns
CollaborationHubContent
+ Here is the call graph for this function:

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