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

Public Member Functions

 __construct ( $modelId='CollaborationListContent', $formats=[CONTENT_FORMAT_JSON, CONTENT_FORMAT_TEXT, self::FORMAT_WIKI])
 
 canBeUsedOn (Title $title)
 Can this content handler be used on a given page?
 
 unserializeContent ( $text, $format=null)
 Takes JSON string and creates a new CollaborationListContent object.
 
 serializeContent (Content $content, $format=null)
 Serializes the CollaborationListContent object.
 
 makeEmptyContent ()
 
 isParserCacheSupported ()
 FIXME is this really true?
 
 supportsDirectApiEditing ()
 
 supportsRedirects ()
 
 makeRedirectContent (Title $destination, $text='')
 Turns CollaborationListContent page into redirect.
 
 preSaveTransform (Content $content, PreSaveTransformParams $pstParams)
 Beautifies JSON and does subst: prior to save.
 

Static Public Member Functions

static makeMemberList ( $username, $initialDescription)
 Spawns a new "members" list, using the project creator as initial member.
 
static postMemberList (Title $title, $summary, IContextSource $context)
 Posts the newly created "members" list on-wiki.
 

Public Attributes

const FORMAT_WIKI = 'text/x-collabkit'
 

Protected Member Functions

 getContentClass ()
 

Constructor & Destructor Documentation

◆ __construct()

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

Member Function Documentation

◆ canBeUsedOn()

CollaborationListContentHandler::canBeUsedOn ( Title $title)

Can this content handler be used on a given page?

Parameters
Title$titlePage to check
Returns
bool

◆ getContentClass()

CollaborationListContentHandler::getContentClass ( )
protected
Returns
string

◆ isParserCacheSupported()

CollaborationListContentHandler::isParserCacheSupported ( )

FIXME is this really true?

Returns
bool

◆ makeEmptyContent()

CollaborationListContentHandler::makeEmptyContent ( )

◆ makeMemberList()

static CollaborationListContentHandler::makeMemberList ( $username,
$initialDescription )
static

Spawns a new "members" list, using the project creator as initial member.

Parameters
string$usernameUsername without "User:" prefix
string$initialDescriptionThe initial description of the list
Returns
CollaborationListContent

◆ makeRedirectContent()

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

Turns CollaborationListContent 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

◆ postMemberList()

static CollaborationListContentHandler::postMemberList ( Title $title,
$summary,
IContextSource $context )
static

Posts the newly created "members" list on-wiki.

Parameters
Title$title
string$summary
IContextSource$context
Todo
rework this to use a generic CollaborationList editor function once it exists
Returns
Status
+ Here is the caller graph for this function:

◆ preSaveTransform()

CollaborationListContentHandler::preSaveTransform ( Content $content,
PreSaveTransformParams $pstParams )

Beautifies JSON and does subst: prior to save.

Parameters
Content$content
PreSaveTransformParams$pstParams
Returns
CollaborationListContent

◆ serializeContent()

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

Serializes the CollaborationListContent object.

Parameters
Content | CollaborationListContent$content
string | null$format
Returns
string

◆ supportsDirectApiEditing()

CollaborationListContentHandler::supportsDirectApiEditing ( )
Returns
bool

◆ supportsRedirects()

CollaborationListContentHandler::supportsRedirects ( )
Returns
bool

◆ unserializeContent()

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

Takes JSON string and creates a new CollaborationListContent object.

Validation is intentionally not done at this step, as it is done later.

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

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