/** * Gets the title text for the types special page. * Takes care of compatibility changes in MW 1.17 and 1.18. * 1.17 introduces SpecialPageFactory * 1.18 deprecates SpecialPage::getLocalNameFor * * @since 1.6 * * @return string */ protected function getSpecialPageTitleText() { return is_callable(array('SpecialPageFactory', 'getLocalNameFor')) ? SpecialPageFactory::getLocalNameFor('Types', $this->m_realLabel) : SpecialPage::getLocalNameFor('Types', $this->m_realLabel); }
/** * If the Title refers to a special page alias which is not the local default, * returns a new Title which points to the local default. Otherwise, returns $this. */ public function fixSpecialName() { if ($this->getNamespace() == NS_SPECIAL) { $canonicalName = SpecialPage::resolveAlias($this->mDbkeyform); if ($canonicalName) { $localName = SpecialPage::getLocalNameFor($canonicalName); if ($localName != $this->mDbkeyform) { return Title::makeTitle(NS_SPECIAL, $localName); } } } return $this; }
public function chromedArticleHeader() { if (!$this->wg->User->isAllowed('admindashboard')) { $this->displayRestrictionError(); return false; // skip rendering } $page = $this->getVal('page', ''); if (empty($page)) { $headerText = SpecialPage::getLocalNameFor($this->getVal('headerText', '')); } else { $headerText = SpecialPage::getLocalNameFor($page); } $this->headerText = $headerText; }