MediaWiki REL1_34
|
Core functions for the CategoryTree extension, an AJAX based gadget to display the category structure of a wiki. More...
Public Member Functions | |
__construct (array $options) | |
PhanTypeInvalidDimOffset. | |
getOption ( $name) | |
getOptionsAsCacheKey ( $depth=null) | |
getOptionsAsJsStructure ( $depth=null) | |
getTag (Parser $parser=null, $category, $hideroot=false, array $attr=[], $depth=1, $allowMissing=false) | |
Custom tag implementation. | |
renderChildren (Title $title, $depth=1) | |
Returns a string with an HTML representation of the children of the given category. | |
renderNode (Title $title, $children=0) | |
Returns a string with a HTML represenation of the given page. | |
renderNodeInfo (Title $title, Category $cat=null, $children=0) | |
Returns a string with a HTML represenation of the given page. | |
renderParents (Title $title) | |
Returns a string with an HTML representation of the parents of the given category. | |
Static Public Member Functions | |
static | capDepth ( $mode, $depth) |
Internal function to cap depth PhanPluginDuplicateConditionalNullCoalescing until PHP7 is required. | |
static | createCountString (IContextSource $context, Category $cat=null, $countMode) |
Create a string which format the page, subcat and file counts of a category PhanParamReqAfterOpt $cat is not optional but nullable. | |
static | decodeBoolean ( $value) |
Helper function to convert a string to a boolean value. | |
static | decodeHidePrefix ( $value) |
static | decodeMode ( $mode) |
static | makeTitle ( $title) |
Creates a Title object from a user provided (and thus unsafe) string. | |
static | setHeaders (OutputPage $outputPage) |
Add ResourceLoader modules to the OutputPage object. | |
Public Attributes | |
$mOptions = [] | |
Static Protected Member Functions | |
static | encodeOptions (array $options, $enc) |
Private Member Functions | |
isInverse () | |
Static Private Member Functions | |
static | decodeNamespaces ( $nn) |
Private Attributes | |
LinkRenderer | $linkRenderer |
Core functions for the CategoryTree extension, an AJAX based gadget to display the category structure of a wiki.
Definition at line 31 of file CategoryTree.php.
CategoryTree::__construct | ( | array | $options | ) |
PhanTypeInvalidDimOffset.
array | $options |
Definition at line 43 of file CategoryTree.php.
References CategoryTreeMode\ALL, CategoryTreeMode\CATEGORIES, decodeBoolean(), decodeHidePrefix(), decodeMode(), decodeNamespaces(), NS_CATEGORY, NS_FILE, CategoryTreeMode\PAGES, and CategoryTreeMode\PARENTS.
|
static |
Internal function to cap depth PhanPluginDuplicateConditionalNullCoalescing until PHP7 is required.
string | $mode | |
int | $depth |
Definition at line 771 of file CategoryTree.php.
References wfDebug().
Referenced by ApiCategoryTree\execute(), and CategoryTreeHooks\parserHook().
|
static |
Create a string which format the page, subcat and file counts of a category PhanParamReqAfterOpt $cat is not optional but nullable.
IContextSource | $context | |
Category | null | $cat | |
int | $countMode |
Definition at line 689 of file CategoryTree.php.
Referenced by CategoryTreeHooks\onSpecialTrackingCategoriesGenerateCatLink(), and renderNodeInfo().
|
static |
Helper function to convert a string to a boolean value.
Perhaps make this a global function in MediaWiki proper
mixed | $value |
Definition at line 182 of file CategoryTree.php.
Referenced by __construct(), and CategoryTreeHooks\parserHook().
|
static |
mixed | $value |
Definition at line 217 of file CategoryTree.php.
References CategoryTreeHidePrefix\ALWAYS, CategoryTreeHidePrefix\AUTO, CategoryTreeHidePrefix\CATEGORIES, and CategoryTreeHidePrefix\NEVER.
Referenced by __construct().
|
static |
mixed | $mode |
Definition at line 145 of file CategoryTree.php.
References CategoryTreeMode\ALL, CategoryTreeMode\CATEGORIES, CategoryTreeMode\PAGES, and CategoryTreeMode\PARENTS.
Referenced by __construct(), and CategoryTreeHooks\initialize().
|
staticprivate |
mixed | $nn |
Definition at line 100 of file CategoryTree.php.
References NS_MAIN.
Referenced by __construct().
|
staticprotected |
array | $options | |
string | $enc |
Exception |
Definition at line 272 of file CategoryTree.php.
Referenced by getOptionsAsJsStructure().
CategoryTree::getOption | ( | $name | ) |
string | $name |
Definition at line 85 of file CategoryTree.php.
Referenced by isInverse(), renderChildren(), and renderNodeInfo().
CategoryTree::getOptionsAsCacheKey | ( | $depth = null | ) |
string | null | $depth |
Definition at line 288 of file CategoryTree.php.
Referenced by ApiCategoryTree\getHTML().
CategoryTree::getOptionsAsJsStructure | ( | $depth = null | ) |
int | null | $depth |
Definition at line 308 of file CategoryTree.php.
References $mOptions, $s, and encodeOptions().
Referenced by getTag().
CategoryTree::getTag | ( | Parser | $parser = null, |
$category, | |||
$hideroot = false, | |||
array | $attr = [], | ||
$depth = 1, | |||
$allowMissing = false ) |
Custom tag implementation.
This is called by CategoryTreeHooks::parserHook, which is used to load CategoryTreeFunctions.php on demand. PhanParamReqAfterOpt $parser is not optional but nullable
Parser | null | $parser | |
string | $category | |
bool | $hideroot | |
array | $attr | |
int | $depth | |
bool | $allowMissing |
Definition at line 332 of file CategoryTree.php.
References $title, getOptionsAsJsStructure(), makeTitle(), renderChildren(), renderNode(), and wfMessage().
|
private |
Definition at line 92 of file CategoryTree.php.
References getOption(), and CategoryTreeMode\PARENTS.
Referenced by renderChildren().
|
static |
Creates a Title object from a user provided (and thus unsafe) string.
string | $title |
Definition at line 745 of file CategoryTree.php.
References $t, $title, and NS_CATEGORY.
Referenced by CategoryTreePage\execute(), ApiCategoryTree\execute(), ApiCategoryTree\getConditionalRequestData(), and getTag().
CategoryTree::renderChildren | ( | Title | $title, |
$depth = 1 ) |
Returns a string with an HTML representation of the children of the given category.
Title | $title | |
int | $depth |
Definition at line 396 of file CategoryTree.php.
References $dbr, $res, $s, $t, $title, CategoryTreeMode\ALL, DB_REPLICA, getOption(), isInverse(), NS_CATEGORY, CategoryTreeMode\PAGES, renderNodeInfo(), and wfGetDB().
Referenced by ApiCategoryTree\getHTML(), getTag(), and renderNodeInfo().
CategoryTree::renderNode | ( | Title | $title, |
$children = 0 ) |
Returns a string with a HTML represenation of the given page.
Title | $title | |
int | $children |
Definition at line 540 of file CategoryTree.php.
References $title, NS_CATEGORY, and renderNodeInfo().
Referenced by getTag().
Returns a string with a HTML represenation of the given page.
$info must be an associative array, containing at least a Title object under the 'title' key.
Definition at line 562 of file CategoryTree.php.
References $s, $title, CategoryTreeHidePrefix\ALWAYS, CategoryTreeHidePrefix\AUTO, CategoryTreeHidePrefix\CATEGORIES, CategoryTreeMode\CATEGORIES, createCountString(), getOption(), NS_CATEGORY, CategoryTreeMode\PAGES, CategoryTreeMode\PARENTS, renderChildren(), and wfMessage().
Referenced by renderChildren(), and renderNode().
CategoryTree::renderParents | ( | Title | $title | ) |
Returns a string with an HTML representation of the parents of the given category.
Title | $title |
Definition at line 494 of file CategoryTree.php.
References $dbr, $res, $s, $t, $title, DB_REPLICA, NS_CATEGORY, wfGetDB(), and wfMessage().
|
static |
Add ResourceLoader modules to the OutputPage object.
OutputPage | $outputPage |
Definition at line 260 of file CategoryTree.php.
References OutputPage\addModules(), and OutputPage\addModuleStyles().
Referenced by CategoryTreeHooks\addHeaders(), CategoryTreePage\execute(), CategoryTreeCategoryViewer\getCategoryTree(), CategoryTreeHooks\onSkinBuildSidebar(), CategoryTreeHooks\outputPageMakeCategoryLinks(), and CategoryTreeHooks\parserOutput().
|
private |
Definition at line 37 of file CategoryTree.php.
CategoryTree::$mOptions = [] |
Definition at line 32 of file CategoryTree.php.
Referenced by getOptionsAsJsStructure().