本文整理汇总了PHP中Linker::userToolLinksRedContribs方法的典型用法代码示例。如果您正苦于以下问题:PHP Linker::userToolLinksRedContribs方法的具体用法?PHP Linker::userToolLinksRedContribs怎么用?PHP Linker::userToolLinksRedContribs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Linker
的用法示例。
在下文中一共展示了Linker::userToolLinksRedContribs方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testNormalLogParams
/**
* @covers LogFormatter::newFromEntry
*/
public function testNormalLogParams()
{
$entry = $this->newLogEntry('test', array());
$formatter = LogFormatter::newFromEntry($entry);
$formatter->setContext($this->context);
$formatter->setShowUserToolLinks(false);
$paramsWithoutTools = $formatter->getMessageParametersForTesting();
unset($formatter->parsedParameters);
$formatter->setShowUserToolLinks(true);
$paramsWithTools = $formatter->getMessageParametersForTesting();
$userLink = Linker::userLink($this->user->getId(), $this->user->getName());
$userTools = Linker::userToolLinksRedContribs($this->user->getId(), $this->user->getName(), $this->user->getEditCount());
$titleLink = Linker::link($this->title, null, array(), array());
// $paramsWithoutTools and $paramsWithTools should be only different
// in index 0
$this->assertEquals($paramsWithoutTools[1], $paramsWithTools[1]);
$this->assertEquals($paramsWithoutTools[2], $paramsWithTools[2]);
$this->assertEquals($userLink, $paramsWithoutTools[0]['raw']);
$this->assertEquals($userLink . $userTools, $paramsWithTools[0]['raw']);
$this->assertEquals($this->user->getName(), $paramsWithoutTools[1]);
$this->assertEquals($titleLink, $paramsWithoutTools[2]['raw']);
}
示例2: formatValue
/**
* @param string $name The database field name
* @param string $value The value retrieved from the database
* @return string HTML to place inside table cell
*/
public function formatValue($name, $value)
{
$user = $this->users[$this->mCurrentRow->utr_name];
$formatted = htmlspecialchars($value);
switch ($name) {
case 'utr_name':
$formatted = Linker::userLink($user->getId(), $user->getName()) . Linker::userToolLinksRedContribs($user->getId(), $user->getName(), $user->getEditCount());
break;
case 'user_registration':
$regDate = $user->getRegistration();
if ($regDate === null) {
$formatted = $this->msg('centralauth-uwbr-registration-nodate')->escaped();
} else {
$formatted = $this->formatDateTime($regDate);
}
break;
case 'user_editcount':
$formatted = $this->getLanguage()->formatNum($user->getEditCount());
break;
}
return $formatted;
}
示例3: formatRow
/**
* @param stdClass $row
* @return string
*/
function formatRow($row)
{
if ($row->user_id == 0) {
#Bug 16487
return '';
}
$userName = $row->user_name;
$ulinks = Linker::userLink($row->user_id, $userName);
$ulinks .= Linker::userToolLinksRedContribs($row->user_id, $userName, (int) $row->edits);
$lang = $this->getLanguage();
$groups = '';
$groups_list = self::getGroups(intval($row->user_id), $this->userGroupCache);
if (!$this->including && count($groups_list) > 0) {
$list = array();
foreach ($groups_list as $group) {
$list[] = self::buildGroupLink($group, $userName);
}
$groups = $lang->commaList($list);
}
$item = $lang->specialList($ulinks, $groups);
if ($row->ipb_deleted) {
$item = "<span class=\"deleted\">{$item}</span>";
}
$edits = '';
if (!$this->including && $this->getConfig()->get('Edititis')) {
$count = $this->msg('usereditcount')->numParams($row->edits)->escaped();
$edits = $this->msg('word-separator')->escaped() . $this->msg('brackets', $count)->escaped();
}
$created = '';
# Some rows may be null
if (!$this->including && $row->creation) {
$user = $this->getUser();
$d = $lang->userDate($row->creation, $user);
$t = $lang->userTime($row->creation, $user);
$created = $this->msg('usercreated', $d, $t, $row->user_name)->escaped();
$created = ' ' . $this->msg('parentheses')->rawParams($created)->escaped();
}
$blocked = !is_null($row->ipb_deleted) ? ' ' . $this->msg('listusers-blocked', $userName)->escaped() : '';
Hooks::run('SpecialListusersFormatRow', array(&$item, $row));
return Html::rawElement('li', array(), "{$item}{$edits}{$created}{$blocked}");
}
示例4: userToolLinksRedContribs
public function userToolLinksRedContribs($userId, $userText, $edits = null)
{
return Linker::userToolLinksRedContribs($userId, $userText, $edits);
}
示例5: makeUserLink
protected function makeUserLink(User $user)
{
if ($this->plaintext) {
$element = $user->getName();
} else {
$element = Linker::userLink($user->getId(), $user->getName());
if ($this->linkFlood) {
$element .= Linker::userToolLinksRedContribs($user->getId(), $user->getName(), $user->getEditCount());
}
}
return $element;
}