当前位置: 首页>>代码示例>>PHP>>正文


PHP Linker::userToolLinksRedContribs方法代码示例

本文整理汇总了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']);
 }
开发者ID:eliagbayani,项目名称:LiteratureEditor,代码行数:25,代码来源:LogFormatterTest.php

示例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;
 }
开发者ID:NDKilla,项目名称:mediawiki-extensions-CentralAuth,代码行数:27,代码来源:SpecialUsersWhoWillBeRenamed.php

示例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}");
 }
开发者ID:eliagbayani,项目名称:LiteratureEditor,代码行数:45,代码来源:SpecialListusers.php

示例4: userToolLinksRedContribs

 public function userToolLinksRedContribs($userId, $userText, $edits = null)
 {
     return Linker::userToolLinksRedContribs($userId, $userText, $edits);
 }
开发者ID:claudinec,项目名称:galan-wiki,代码行数:4,代码来源:DummyLinker.php

示例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;
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:12,代码来源:LogFormatter.php


注:本文中的Linker::userToolLinksRedContribs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。