本文整理汇总了PHP中SpecialPage::getLocalNameFor方法的典型用法代码示例。如果您正苦于以下问题:PHP SpecialPage::getLocalNameFor方法的具体用法?PHP SpecialPage::getLocalNameFor怎么用?PHP SpecialPage::getLocalNameFor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpecialPage
的用法示例。
在下文中一共展示了SpecialPage::getLocalNameFor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSpecialPageTitleText
/**
* 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);
}
示例2: fixSpecialName
/**
* 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;
}
示例3: chromedArticleHeader
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;
}