MediaWiki REL1_31
CategoryTreeHooks Class Reference

Hooks for the CategoryTree extension, an AJAX based gadget to display the category structure of a wiki. More...

Static Public Member Functions

static addHeaders (OutputPage $out)
 BeforePageDisplay and BeforePageDisplayMobile hooks.
 
static articleFromTitle ( $title, &$article)
 ArticleFromTitle hook, override category page handling.
 
static getConfigVars (&$vars)
 
static initialize ()
 Adjusts config once MediaWiki is fully initialised TODO: Don't do this, lazy initialize the config.
 
static onSpecialTrackingCategoriesGenerateCatLink ( $specialPage, $catTitle, &$html)
 Hook handler for the SpecialTrackingCategories::generateCatLink hook.
 
static onSpecialTrackingCategoriesPreprocess ( $specialPage, $trackingCategories)
 Hook handler for the SpecialTrackingCategories::preprocess hook.
 
static outputPageMakeCategoryLinks (&$out, $categories, &$links)
 OutputPageMakeCategoryLinks hook, override category links.
 
static parserFunction ( $parser)
 Entry point for the {{#categorytree}} tag parser function.
 
static parserHook ( $cat, $argv, $parser=null, $allowMissing=false)
 Entry point for the <categorytree> tag parser hook.
 
static parserOutput ( $outputPage, $parserOutput)
 Hook callback that injects messages and things into the <head> tag, if needed in the current page.
 
static setHooks ( $parser)
 
static shouldForceHeaders ()
 
static skinJoinCategoryLinks ( $skin, &$links, &$result)
 
static skinTemplateOutputPageBeforeExec ( $skin, $tpl)
 Hook implementation for injecting a category tree into the sidebar.
 

Detailed Description

Hooks for the CategoryTree extension, an AJAX based gadget to display the category structure of a wiki.

Definition at line 29 of file CategoryTreeHooks.php.

Member Function Documentation

◆ addHeaders()

static CategoryTreeHooks::addHeaders ( OutputPage $out)
static

BeforePageDisplay and BeforePageDisplayMobile hooks.

These hooks are used when $wgCategoryTreeForceHeaders is set. Otherwise similar to CategoryTreeHooks::parserOutput.

Parameters
OutputPage$out

Definition at line 194 of file CategoryTreeHooks.php.

References $out, and CategoryTree\setHeaders().

◆ articleFromTitle()

static CategoryTreeHooks::articleFromTitle ( $title,
& $article )
static

ArticleFromTitle hook, override category page handling.

Parameters
Title$title
Article&$article
Returns
bool

Definition at line 208 of file CategoryTreeHooks.php.

References NS_CATEGORY.

◆ getConfigVars()

static CategoryTreeHooks::getConfigVars ( & $vars)
static
Parameters
array&$vars
Returns
bool

Definition at line 262 of file CategoryTreeHooks.php.

References $vars.

◆ initialize()

static CategoryTreeHooks::initialize ( )
static

Adjusts config once MediaWiki is fully initialised TODO: Don't do this, lazy initialize the config.

Definition at line 42 of file CategoryTreeHooks.php.

References $wgRequest, and CategoryTree\decodeMode().

◆ onSpecialTrackingCategoriesGenerateCatLink()

static CategoryTreeHooks::onSpecialTrackingCategoriesGenerateCatLink ( $specialPage,
$catTitle,
& $html )
static

Hook handler for the SpecialTrackingCategories::generateCatLink hook.

Parameters
SpecialPage$specialPageSpecialTrackingCategories object
Title$catTitleTitle object of the linked category
string&$htmlResult html

Definition at line 307 of file CategoryTreeHooks.php.

References $html, and CategoryTree\createCountString().

◆ onSpecialTrackingCategoriesPreprocess()

static CategoryTreeHooks::onSpecialTrackingCategoriesPreprocess ( $specialPage,
$trackingCategories )
static

Hook handler for the SpecialTrackingCategories::preprocess hook.

Parameters
SpecialPage$specialPageSpecialTrackingCategories object
array$trackingCategories[ 'msg' => Title, 'cats' => Title[] ]

Definition at line 276 of file CategoryTreeHooks.php.

References $dbr, $res, DB_REPLICA, and wfGetDB().

◆ outputPageMakeCategoryLinks()

static CategoryTreeHooks::outputPageMakeCategoryLinks ( & $out,
$categories,
& $links )
static

OutputPageMakeCategoryLinks hook, override category links.

Parameters
OutputPage&$out
array$categories
array&$links
Returns
bool

Definition at line 222 of file CategoryTreeHooks.php.

References $type, and parserHook().

◆ parserFunction()

static CategoryTreeHooks::parserFunction ( $parser)
static

Entry point for the {{#categorytree}} tag parser function.

This is a wrapper around CategoryTreeHooks::parserHook

Parameters
Parser$parser
Returns
array|string

Definition at line 87 of file CategoryTreeHooks.php.

References $argv, $html, $params, $parser, parserHook(), and true.

◆ parserHook()

static CategoryTreeHooks::parserHook ( $cat,
$argv,
$parser = null,
$allowMissing = false )
static

Entry point for the <categorytree> tag parser hook.

This loads CategoryTreeFunctions.php and calls CategoryTree::getTag()

Parameters
string$cat
array$argv
Parser | null$parser
bool$allowMissing
Returns
bool|string

Definition at line 144 of file CategoryTreeHooks.php.

References $argv, $parser, $wgOut, CategoryTree\capDepth(), CategoryTree\decodeBoolean(), parserOutput(), and CategoryTree\setHeaders().

Referenced by outputPageMakeCategoryLinks(), parserFunction(), and skinTemplateOutputPageBeforeExec().

◆ parserOutput()

static CategoryTreeHooks::parserOutput ( $outputPage,
$parserOutput )
static

Hook callback that injects messages and things into the <head> tag, if needed in the current page.

Does nothing if $parserOutput->mCategoryTreeTag is not set

Parameters
OutputPage$outputPage
ParserOutput$parserOutput

Definition at line 178 of file CategoryTreeHooks.php.

References CategoryTree\setHeaders().

Referenced by parserHook().

◆ setHooks()

static CategoryTreeHooks::setHooks ( $parser)
static
Parameters
Parser$parser

Definition at line 72 of file CategoryTreeHooks.php.

References $parser.

◆ shouldForceHeaders()

static CategoryTreeHooks::shouldForceHeaders ( )
static

◆ skinJoinCategoryLinks()

static CategoryTreeHooks::skinJoinCategoryLinks ( $skin,
& $links,
& $result )
static
Parameters
Skin$skin
array&$links
string&$result
Returns
bool

Definition at line 243 of file CategoryTreeHooks.php.

◆ skinTemplateOutputPageBeforeExec()

static CategoryTreeHooks::skinTemplateOutputPageBeforeExec ( $skin,
$tpl )
static

Hook implementation for injecting a category tree into the sidebar.

Only does anything if $wgCategoryTreeSidebarRoot is set to a category name.

Parameters
Skin$skin
SkinTemplate$tpl

Definition at line 122 of file CategoryTreeHooks.php.

References $html, and parserHook().


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