本文整理汇总了PHP中ParserOutput::getTOCHTML方法的典型用法代码示例。如果您正苦于以下问题:PHP ParserOutput::getTOCHTML方法的具体用法?PHP ParserOutput::getTOCHTML怎么用?PHP ParserOutput::getTOCHTML使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParserOutput
的用法示例。
在下文中一共展示了ParserOutput::getTOCHTML方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onOutputPageParserOutput
/**
* OutputPageParserOutput hook handler
* Disables TOC in output before it grabs HTML
* @see https://www.mediawiki.org/wiki/Manual:Hooks/OutputPageParserOutput
*
* @param OutputPage $outputPage
* @param ParserOutput $po
* @return bool
*/
public static function onOutputPageParserOutput($outputPage, ParserOutput $po)
{
global $wgMFWikibaseImageCategory;
$context = MobileContext::singleton();
$isBeta = $context->isBetaGroupMember();
$mfUseWikibaseDescription = $context->getMFConfig()->get('MFUseWikibaseDescription');
if ($context->shouldDisplayMobileView()) {
$outputPage->enableTOC(false);
$outputPage->setProperty('MinervaTOC', $po->getTOCHTML() !== '');
if ($mfUseWikibaseDescription && $isBeta) {
$item = $po->getProperty('wikibase_item');
if ($item) {
$desc = ExtMobileFrontend::getWikibaseDescription($item);
$category = ExtMobileFrontend::getWikibasePropertyValue($item, $wgMFWikibaseImageCategory);
if ($desc) {
$outputPage->setProperty('wgMFDescription', $desc);
}
if ($category) {
$outputPage->setProperty('wgMFImagesCategory', $category);
}
}
}
// Enable wrapped sections
$po->setText(ExtMobileFrontend::DOMParse($outputPage, $po->getText(), $isBeta));
}
return true;
}
示例2: onOutputPageParserOutput
/**
* OutputPageParserOutput hook handler
* Disables TOC in output before it grabs HTML
* @see https://www.mediawiki.org/wiki/Manual:Hooks/OutputPageParserOutput
*
* @param OutputPage $outputPage
* @param ParserOutput $po
* @return bool
*/
public static function onOutputPageParserOutput($outputPage, ParserOutput $po)
{
$context = MobileContext::singleton();
$mfUseWikibaseDescription = $context->getMFConfig()->get('MFUseWikibaseDescription');
if ($context->shouldDisplayMobileView()) {
$outputPage->enableTOC(false);
$outputPage->setProperty('MinervaTOC', $po->getTOCHTML() !== '');
if ($mfUseWikibaseDescription && $context->isBetaGroupMember()) {
$item = $po->getProperty('wikibase_item');
if ($item) {
$desc = ExtMobileFrontend::getWikibaseDescription($item);
if ($desc) {
$outputPage->setProperty('wgMFDescription', $desc);
}
}
}
}
return true;
}