本文整理汇总了PHP中OutputPage::setProperty方法的典型用法代码示例。如果您正苦于以下问题:PHP OutputPage::setProperty方法的具体用法?PHP OutputPage::setProperty怎么用?PHP OutputPage::setProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OutputPage
的用法示例。
在下文中一共展示了OutputPage::setProperty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onOutputPageParserOutput
/**
* Propogate if we should create a ToC from ParserOutput -> OutputPage.
*
* Its assumed we should create a ToC on the following conditions:
* * __NOCOLLABORATIONHUBTOC__ is not on page
* * Somebody added parser metadata to the OutputPage (More likely to be a real page)
* * The limit report was enabled (More likely to be a real page)
* These conditions are hacky. Ideally we'd come up with a more
* robust way of determining if this is really a wikipage.
*
* Eventually, the TOC will be output by onOutputPageBeforeHTML hook if this
* hook signals it is ok.
*
* @param $out OutputPage
* @param $pout ParserOutput
*/
public static function onOutputPageParserOutput(OutputPage $out, ParserOutput $pout)
{
if ($out->getProperty('CollaborationHubSubpage')) {
// We've already been here, so we can't abort
// outputting the TOC at this stage.
wfDebug(__METHOD__ . ' TOC already outputted, possibly incorrectly.');
return;
}
if ($pout->getProperty('nocollaborationhubtoc') !== false) {
// TOC disabled, mark as done.
$out->setProperty('CollaborationHubSubpage', true);
} elseif ($pout->getLimitReportData()) {
$out->setProperty('CollaborationHubSubpage', "in-progress");
}
}
示例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)
{
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;
}
示例3: 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;
}