本文整理汇总了PHP中Skin::link方法的典型用法代码示例。如果您正苦于以下问题:PHP Skin::link方法的具体用法?PHP Skin::link怎么用?PHP Skin::link使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Skin
的用法示例。
在下文中一共展示了Skin::link方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: makeWlhLink
/**
* Make a "what links here" link for a given title
*
* @param Title $title Title to make the link for
* @param Skin $skin Skin to use
* @param object $result Result row
* @return string
*/
private function makeWlhLink($title, $skin, $result)
{
global $wgLang;
$wlh = SpecialPage::getTitleFor('Whatlinkshere');
$label = wfMsgExt('nlinks', array('parsemag', 'escape'), $wgLang->formatNum($result->value));
return $skin->link($wlh, $label, array(), array('target' => $title->getPrefixedText()));
}
示例2: setSubtitle
/**
* Set a subtitle like "Manage > FreeCol (open source game) > German"
* based on group and language code. The language part is not shown if
* it is 'en', and all three possible parts of the subtitle are linked.
*
* @param $group MessageGroup
* @param $code \string Language code.
*/
protected function setSubtitle( $group, $code ) {
global $wgLang;
$links[] = $this->skin->link(
$this->getTitle(),
wfMsgHtml( 'translate-manage-subtitle' )
);
$links[] = $this->skin->link(
$this->getTitle(),
htmlspecialchars( $group->getLabel() ),
array(),
array( 'group' => $group->getId() )
);
// Do not show language part for English.
if ( $code !== 'en' ) {
$langname = TranslateUtils::getLanguageName( $code, false, $wgLang->getCode() );
$links[] = $this->skin->link(
$this->getTitle(),
htmlspecialchars( $langname ),
array(),
array( 'group' => $group->getId(), 'language' => $code )
);
}
$this->out->setSubtitle( implode( ' > ', $links ) );
}
示例3: generateUndoLink
/**
* @param Skin $skin
* @param Title $title
* @param Revision $revision
* @param Revision $undoAfterRevision
* @return String Undo Link
*/
public static function generateUndoLink($skin, $title, $revision, $undoAfterRevision)
{
if (!$revision instanceof Revision || !$undoAfterRevision instanceof Revision || !$title instanceof Title || !$skin instanceof Skin) {
return null;
}
# Create undo tooltip for the first (=latest) line only
$undoTooltip = $revision->isCurrent() ? array('title' => wfMsg('tooltip-undo')) : array();
$undolink = $skin->link($title, wfMsgHtml('editundo'), $undoTooltip, array('action' => 'edit', 'undoafter' => $undoAfterRevision->getId(), 'undo' => $revision->getId()), array('known', 'noclasses'));
return "<span class=\"mw-history-undo\">{$undolink}</span>";
}
示例4: authorLink
function authorLink($author, $extraParams = array())
{
$repo = $this->mRepo->getName();
$special = SpecialPage::getTitleFor('Code', "{$repo}/author/{$author}");
return $this->skin->link($special, htmlspecialchars($author), array(), $extraParams);
}
示例5: drawCategoryBrowser
function drawCategoryBrowser($tree, &$skin, $count = 0)
{
$return = '';
$viewMode = WikihowCategoryViewer::getViewModeArray($this->getContext());
foreach ($tree as $element => $parent) {
/*
if ($element == "Category:WikiHow" ||
$element == "Category:Featured-Articles" ||
$element == "Category:Honors") {
continue;
}
*/
$count++;
$start = ' ' . self::BREADCRUMB_SEPARATOR;
/*
//not too many...
if ($count > self::BREADCRUMB_LIMIT && !self::$bShortened) {
$return .= '<li class="bread_ellipsis"><span>'.$start.'</span> ... </li>';
self::$bShortened = true;
break;
}
*/
$eltitle = Title::NewFromText($element);
if (empty($parent)) {
# element start a new list
$return .= "\n";
} else {
# grab the others elements
$return .= $this->drawCategoryBrowser($parent, $skin, $count);
}
# add our current element to the list
$return .= "<li>{$start} " . Skin::link($eltitle, $eltitle->getText(), array(), $viewMode) . "</li>";
}
return $return;
}
示例6: formatResult
/**
*
* @param Skin $skin
* @param File $result
* @return string
*/
function formatResult($skin, $result)
{
global $wgContLang, $wgLang;
$nt = $result->getTitle();
$text = $wgContLang->convert($nt->getText());
$plink = $skin->link(Title::newFromText($nt->getPrefixedText()), $text);
$userText = $result->getUser('text');
$user = $skin->link(Title::makeTitle(NS_USER, $userText), $userText);
$time = $wgLang->timeanddate($result->getTimestamp());
return "{$plink} . . {$user} . . {$time}";
}