/** * Do not return secondary actions on the user page * * @param BaseTemplate $tpl * @return string[] */ protected function getSecondaryActions(BaseTemplate $tpl) { if ($this->isUserPage) { return array(); } else { return parent::getSecondaryActions($tpl); } }
/** * Returns an array of links for page secondary actions * @param BaseTemplate $tpl * @return Array */ protected function getSecondaryActions(BaseTemplate $tpl) { $buttons = parent::getSecondaryActions($tpl); $title = $this->getTitle(); $namespaces = $tpl->data['content_navigation']['namespaces']; if ($this->isTalkAllowed()) { // FIXME [core]: This seems unnecessary.. $subjectId = $title->getNamespaceKey(''); $talkId = $subjectId === 'main' ? 'talk' : "{$subjectId}_talk"; $talkButton = isset($namespaces[$talkId]) && !$title->isTalkPage() ? $namespaces[$talkId]['text'] : ''; $talkTitle = $title->getTalkPage(); $buttons['talk'] = array('attributes' => array('href' => $talkTitle->getLinkURL(), 'class' => MobileUI::iconClass('talk', 'before', 'talk'), 'data-title' => $talkTitle->getFullText()), 'label' => $talkButton); } return $buttons; }