/** * Entry point for the <categorytree> tag parser hook. * This loads CategoryTreeFunctions.php and calls CategoryTree::getTag() */ function efCategoryTreeParserHook($cat, $argv, $parser = null, $allowMissing = false) { global $wgOut; if ($parser) { $parser->mOutput->mCategoryTreeTag = true; # flag for use by efCategoryTreeParserOutput } else { CategoryTree::setHeaders($wgOut); } $ct = new CategoryTree($argv); $attr = Sanitizer::validateTagAttributes($argv, 'div'); $hideroot = isset($argv['hideroot']) ? CategoryTree::decodeBoolean($argv['hideroot']) : null; $onlyroot = isset($argv['onlyroot']) ? CategoryTree::decodeBoolean($argv['onlyroot']) : null; $depthArg = isset($argv['depth']) ? (int) $argv['depth'] : null; $depth = efCategoryTreeCapDepth($ct->getOption('mode'), $depthArg); if ($onlyroot) { $depth = 0; } return $ct->getTag($parser, $cat, $hideroot, $attr, $depth, $allowMissing); }