getTemplateData(); } /** * Returns the 'Last edited' message, e.g. 'Last edited on...' * @param array $data Data used to build the page * @return string */ protected function getHistoryLinkHtml( $data ) { $action = Action::getActionName( RequestContext::getMain() ); if ( isset( $data['historyLink'] ) && $action === 'view' ) { $args = [ 'historyIconClass' => MinervaUI::iconClass( 'history-base20', 'mw-ui-icon-small', '', 'wikimedia' ), 'arrowIconClass' => MinervaUI::iconClass( 'expand-gray', 'small', 'mf-mw-ui-icon-rotate-anti-clockwise indicator', // Uses icon in MobileFrontend so must be prefixed mf. // Without MobileFrontend it will not render. // Rather than maintain 2 versions (and variants) of the arrow icon which can conflict // with each othe and bloat CSS, we'll // use the MobileFrontend one. Long term when T177432 and T160690 are resolved // we should be able to use one icon definition and break this dependency. 'mf' ), ] + $data['historyLink']; $templateParser = new TemplateParser( __DIR__ ); return $templateParser->processTemplate( 'history', $args ); } return ''; } /** * Gets the main menu HTML. * @param array $data Data used to build the page * @return string */ protected function getMainMenuData( $data ) { return $data['mainMenu']['items']; } /** * Render the entire page * @deprecated please migrate code here to SkinMinerva::getTemplateData * @return array */ protected function getTemplateData() { $data = $this->data; $skinOptions = MediaWikiServices::getInstance()->getService( 'Minerva.SkinOptions' ); $templateParser = new TemplateParser( __DIR__ ); // prepare template data return [ 'banners' => $data['banners'], 'isAnon' => $data['username'] === null, 'userNotificationsHTML' => $data['userNotificationsHTML'] ?? '', 'data-main-menu' => $this->getMainMenuData( $data ), 'taglinehtml' => $data['taglinehtml'], 'headinghtml' => $data['headinghtml'] ?? '', 'postheadinghtml' => $data['postheadinghtml'] ?? '', 'userMenuHTML' => $data['userMenuHTML'], 'html-minerva-lastmodified' => $this->getHistoryLinkHtml( $data ), // Note mobile-license is only available on the mobile skin. It is outputted as part of // footer-info on desktop hence the conditional check. 'html-minerva-license' => ExtensionRegistry::getInstance()->isLoaded( 'MobileFrontend' ) ? MobileFrontendSkinHooks::getLicenseText( $this->getSkin() ) : '', 'isBeta' => $skinOptions->get( SkinOptions::BETA_MODE ), ]; } }