/** * Create a repo link directly to the item. * We can't use Special:ItemByTitle here as the item might have already been updated. * * @param Title $title * * @return string|null */ private function getItemUrl(Title $title) { $entityId = $this->siteLinkLookup->getItemIdForSiteLink(new SiteLink($this->siteId, $title->getPrefixedText())); if (!$entityId) { return null; } return $this->repoLinker->getEntityUrl($entityId); }
/** * @param string $userName * * @return string HTML */ private function buildUserTalkLink($userName) { // @todo: localize this once we can localize namespaces on the repo $link = $this->repoLinker->getPageUrl("User_talk:{$userName}"); $text = wfMessage('talkpagelinktext')->text(); return $this->repoLinker->formatLink($link, $text); }
/** * @param EntityId $entityId * * @return string */ private function getEntityUrl(EntityId $entityId) { $fragment = '#sitelinks-' . htmlspecialchars($this->langLinkSiteGroup, ENT_QUOTES); return $this->repoLinker->getEntityUrl($entityId) . $fragment; }
/** * Creating a Repo link with Item ID as anchor text * * @param IContextSource $context * @param ItemId $itemId * * @return array */ private function getItemPageInfo(IContextSource $context, ItemId $itemId) { $itemLink = $this->repoLinker->buildEntityLink($itemId, array('external')); return array($context->msg('wikibase-pageinfo-entity-id'), $itemLink); }