CollaborationKit
MediaWiki CollaborationKit extension
Loading...
Searching...
No Matches
CollaborationKitHooks Class Reference

Static Public Member Functions

static onSkinTemplateNavigation (&$sktemplate, &$links)
 Some extra tabs for editing.
 
static onParserFirstCallInit ( $parser)
 Register the {{#transcludelist:...}} and <collaborationkitloadliststyles> hooks.
 
static onCodeEditorGetPageLanguage ( $title, &$lang)
 Declares JSON as the code editor language for CollaborationKit pages.
 
static onOutputPageParserOutput (OutputPage $out, ParserOutput $pout)
 Propogate if we should create a ToC from ParserOutput -> OutputPage.
 
static onGetDoubleUnderscoreIDs (array &$magicWords)
 Register NOCOLLABORATIONHUBTOC as a magic word.
 

Member Function Documentation

◆ onCodeEditorGetPageLanguage()

static CollaborationKitHooks::onCodeEditorGetPageLanguage ( $title,
& $lang )
static

Declares JSON as the code editor language for CollaborationKit pages.

This hook only runs if the CodeEditor extension is enabled.

Parameters
Title$title
string&$langPage language.
Returns
bool

◆ onGetDoubleUnderscoreIDs()

static CollaborationKitHooks::onGetDoubleUnderscoreIDs ( array & $magicWords)
static

Register NOCOLLABORATIONHUBTOC as a magic word.

Parameters
array&$magicWordsAll double underscore magic ids

◆ onOutputPageParserOutput()

static CollaborationKitHooks::onOutputPageParserOutput ( OutputPage $out,
ParserOutput $pout )
static

Propogate if we should create a ToC from ParserOutput -> OutputPage.

Its assumed we should create a ToC on the following conditions:

  • NOCOLLABORATIONHUBTOC is not on page
  • Somebody added parser metadata to the OutputPage (More likely to be a real page)
  • The limit report was enabled (More likely to be a real page) These conditions are hacky. Ideally we'd come up with a more robust way of determining if this is really a wikipage.

Eventually, the TOC will be output by onOutputPageBeforeHTML hook if this hook signals it is ok.

Parameters
OutputPage$out
ParserOutput$pout

◆ onParserFirstCallInit()

static CollaborationKitHooks::onParserFirstCallInit ( $parser)
static

Register the {{#transcludelist:...}} and <collaborationkitloadliststyles> hooks.

#transcludelist is to allow users to transclude a CollaborationList with custom options. <collaborationkitloadliststyles> allows enabling our style modules directly from wikitext, so we can do plain wikitext transclusions of lists and have them work properly, since ContentHandler does not provide access to the parser when doing plain wikitext transclusion.

Parameters
Parser$parser

◆ onSkinTemplateNavigation()

static CollaborationKitHooks::onSkinTemplateNavigation ( & $sktemplate,
& $links )
static

Some extra tabs for editing.

Parameters
SkinTemplate&$sktemplate
array&$links
Returns
bool

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