50 if ( !
isset( $wgCategoryTreeDefaultOptions[
'mode'] )
51 ||
is_null( $wgCategoryTreeDefaultOptions[
'mode'] )
56 if ( !
isset( $wgCategoryTreeDefaultOptions[
'hideprefix'] )
57 ||
is_null( $wgCategoryTreeDefaultOptions[
'hideprefix'] )
62 if ( !
isset( $wgCategoryTreeCategoryPageOptions[
'mode'] )
63 ||
is_null( $wgCategoryTreeCategoryPageOptions[
'mode'] )
66 $wgCategoryTreeCategoryPageOptions[
'mode'] = ( $mode )
76 if ( !$wgCategoryTreeAllowTag ) {
79 $parser->setHook(
'categorytree',
'CategoryTreeHooks::parserHook' );
80 $parser->setFunctionHook(
'categorytree',
'CategoryTreeHooks::parserFunction' );
101 if (
preg_match(
'/^\s*(\S.*?)\s*=\s*(.*?)\s*$/', $p, $m ) ) {
115 return [
$html,
'noparse' =>
true,
'isHTML' =>
true ];
127 if ( !$wgCategoryTreeSidebarRoot ) {
133 $sidebar[
'categorytree-portlet'] =
$html;
152 $allowMissing =
false
155 # flag for use by CategoryTreeHooks::parserOutput
156 $parser->mOutput->mCategoryTreeTag =
true;
161 $attr = Sanitizer::validateTagAttributes( $argv,
'div' );
163 $hideroot =
isset( $argv[
'hideroot'] )
165 $onlyroot =
isset( $argv[
'onlyroot'] )
167 $depthArg =
isset( $argv[
'depth'] ) ? (
int)$argv[
'depth'] :
null;
174 return $ct->getTag(
$parser, $cat, $hideroot, $attr, $depth, $allowMissing );
186 if ( self::shouldForceHeaders() ) {
190 if ( !empty( $parserOutput->mCategoryTreeTag ) ) {
202 if ( !self::shouldForceHeaders() ) {
234 if ( !$wgCategoryTreeHijackPageCategories ) {
239 foreach ( $categories as $category =>
$type ) {
257 $ct =
new CategoryTree( $wgCategoryTreeCategoryPageOptions );
260 'defaultCtOptions' => $ct->getOptionsAsJsStructure(),
273 $categoryDbKeys = [];
274 foreach ( $trackingCategories as $catMsg =>
$data ) {
275 foreach (
$data[
'cats'] as $catTitle ) {
276 $categoryDbKeys[] = $catTitle->getDbKey();
280 if ( $categoryDbKeys ) {
284 [
'cat_id',
'cat_title',
'cat_pages',
'cat_subcats',
'cat_files' ],
288 foreach (
$res as $row ) {
289 $categories[$row->cat_title] = Category::newFromRow( $row );
292 $specialPage->categoryTreeCategories = $categories;
305 if ( !
isset( $specialPage->categoryTreeCategories ) ) {
310 if (
isset( $specialPage->categoryTreeCategories[$catTitle->getDbKey()] ) ) {
311 $cat = $specialPage->categoryTreeCategories[$catTitle->getDbKey()];
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
if(! $wgDBerrorLogTZ) $wgRequest
Class for viewing MediaWiki article and history.
Hooks for the CategoryTree extension, an AJAX based gadget to display the category structure of a wik...
static outputPageMakeCategoryLinks(OutputPage &$out, array $categories, array &$links)
OutputPageMakeCategoryLinks hook, override category links.
static onSpecialTrackingCategoriesPreprocess(SpecialPage $specialPage, array $trackingCategories)
Hook handler for the SpecialTrackingCategories::preprocess hook @suppress PhanUndeclaredProperty Spec...
static parserHook( $cat, array $argv, Parser $parser=null, $allowMissing=false)
Entry point for the <categorytree> tag parser hook.
static parserFunction(Parser $parser,... $params)
Entry point for the {{#categorytree}} tag parser function.
static setHooks(Parser $parser)
static parserOutput(OutputPage $outputPage, ParserOutput $parserOutput)
Hook callback that injects messages and things into the <head> tag, if needed in the current page.
static articleFromTitle(Title $title, Article &$article=null)
ArticleFromTitle hook, override category page handling.
static initialize()
Adjusts config once MediaWiki is fully initialised TODO: Don't do this, lazy initialize the config.
static addHeaders(OutputPage $out)
BeforePageDisplay and BeforePageDisplayMobile hooks.
static onSpecialTrackingCategoriesGenerateCatLink(SpecialPage $specialPage, Title $catTitle, &$html)
Hook handler for the SpecialTrackingCategories::generateCatLink hook @suppress PhanUndeclaredProperty...
static shouldForceHeaders()
static getDataForJs()
Get exported data for the "ext.categoryTree" ResourceLoader module.
static onSkinBuildSidebar(Skin $skin, array &$sidebar)
Hook implementation for injecting a category tree into the sidebar.
Core functions for the CategoryTree extension, an AJAX based gadget to display the category structure...
static setHeaders(OutputPage $outputPage)
Add ResourceLoader modules to the OutputPage object.
static decodeBoolean( $value)
Helper function to convert a string to a boolean value.
static decodeMode( $mode)
static createCountString(IContextSource $context, Category $cat=null, $countMode)
Create a string which format the page, subcat and file counts of a category @suppress PhanParamReqAft...
static capDepth( $mode, $depth)
Internal function to cap depth @suppress PhanPluginDuplicateConditionalNullCoalescing until PHP7 is r...
This class should be covered by a general architecture document which does not exist as of January 20...
PHP Parser - Processes wiki markup (which uses a more user-friendly syntax, such as "[[link]]" for ma...
The main skin class which provides methods and properties for all other skins.
Parent class for all special pages.
getContext()
Gets the context this SpecialPage is executed in.
Represents a title within MediaWiki.
see documentation in includes Linker php for Linker::makeImageLink or false for current used if you return false $parser
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not it can be in the form of< username >< more info > e g for bot passwords intended to be added to log contexts Fields it might only if the login was with a bot password it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html
return true to allow those checks to and false if checking is done remove or add to the links of a group of changes in EnhancedChangesList Hook subscribers can return false to omit this line from recentchanges use this to change the tables headers change it to an object instance and return false override the list derivative used the name of the old file & $article
$data
Utility to generate mapping file used in mw.Title (phpCharToUpper.json)
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))