當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。