/** * This will be called by OutputPage::headElement when it is creating the * "<body>" tag, - adds output property bodyClassName to the existing classes * @param OutputPage $out * @param array $bodyAttrs */ public function addToBodyAttributes($out, &$bodyAttrs) { // does nothing by default - used by Special:MobileMenu $classes = $out->getProperty('bodyClassName'); $bodyAttrs['class'] .= ' ' . $classes; }
/** * 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"); } }