/** * Called on special pages after the special tab is added but before variants have been added. * @see https://www.mediawiki.org/wiki/Manual:Hooks/SkinTemplateNavigation::SpecialPage * * @since 0.1 * * @param SkinTemplate $sktemplate * @param array $links * * @return false */ public static function onSpecialPageTabs(SkinTemplate &$sktemplate, array &$links) { $textParts = SpecialPageFactory::resolveAlias($sktemplate->getTitle()->getText()); if ($textParts[0] === 'Enroll' && !is_null($textParts[1]) && trim($textParts[1]) !== '') { // Remove the token from the title if needed. if (!$sktemplate->getRequest()->getCheck('wptoken')) { $textParts[1] = explode('/', $textParts[1]); if (count($textParts[1]) > 1) { array_pop($textParts[1]); } $textParts[1] = implode('/', $textParts[1]); } $title = EPCourse::getTitleFor($textParts[1]); if (!is_null($title)) { self::displayTabs($sktemplate, $links, $title); } } return false; }