/** * Builds and returns the HTML representing a group of a WikibaseEntity's site-links. * * @param SiteLink[] $siteLinks the site links to render * @param ItemId|null $itemId The id of the item * @param string $group a site group ID * * @return string */ private function getHtmlForSiteLinkGroup(array $siteLinks, ItemId $itemId = null, $group) { $siteLinksForTable = $this->getSiteLinksForTable($this->getSitesForGroup($group), $siteLinks); return $this->templateFactory->render('wikibase-sitelinkgroupview', htmlspecialchars('sitelinks-' . $group, ENT_QUOTES), wfMessage('wikibase-sitelinks-' . $group)->parse(), '', $this->templateFactory->render('wikibase-sitelinklistview', $this->getHtmlForSiteLinks($siteLinksForTable, $group === 'special')), htmlspecialchars($group), $this->sectionEditLinkGenerator->getSiteLinksEditSection($itemId), count($siteLinksForTable) > 1 ? ' mw-collapsible' : ''); }