本文整理匯總了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;
}