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


PHP LogEventsList::isDeleted方法代码示例

本文整理汇总了PHP中LogEventsList::isDeleted方法的典型用法代码示例。如果您正苦于以下问题:PHP LogEventsList::isDeleted方法的具体用法?PHP LogEventsList::isDeleted怎么用?PHP LogEventsList::isDeleted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LogEventsList的用法示例。


在下文中一共展示了LogEventsList::isDeleted方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getHTML

 /**
  * @return string A HTML <li> element representing this revision, showing
  * change tags and everything
  */
 public function getHTML()
 {
     $date = htmlspecialchars($this->list->getLanguage()->userTimeAndDate($this->row->log_timestamp, $this->list->getUser()));
     $title = Title::makeTitle($this->row->log_namespace, $this->row->log_title);
     $formatter = LogFormatter::newFromRow($this->row);
     $formatter->setContext($this->list->getContext());
     $formatter->setAudience(LogFormatter::FOR_THIS_USER);
     // Log link for this page
     $loglink = Linker::link(SpecialPage::getTitleFor('Log'), $this->list->msg('log')->escaped(), array(), array('page' => $title->getPrefixedText()));
     $loglink = $this->list->msg('parentheses')->rawParams($loglink)->escaped();
     // User links and action text
     $action = $formatter->getActionText();
     // Comment
     $comment = $this->list->getLanguage()->getDirMark() . $formatter->getComment();
     if (LogEventsList::isDeleted($this->row, LogPage::DELETED_COMMENT)) {
         $comment = '<span class="history-deleted">' . $comment . '</span>';
     }
     $content = "{$loglink} {$date} {$action} {$comment}";
     $attribs = array();
     $tags = $this->getTags();
     if ($tags) {
         list($tagSummary, $classes) = ChangeTags::formatSummaryRow($tags, 'edittags', $this->list->getContext());
         $content .= " {$tagSummary}";
         $attribs['class'] = implode(' ', $classes);
     }
     return Xml::tags('li', $attribs, $content);
 }
开发者ID:OrBin,项目名称:mediawiki,代码行数:31,代码来源:ChangeTagsLogItem.php

示例2: getHTML

 public function getHTML()
 {
     $date = htmlspecialchars($this->list->getLanguage()->userTimeAndDate($this->row->log_timestamp, $this->list->getUser()));
     $title = Title::makeTitle($this->row->log_namespace, $this->row->log_title);
     $formatter = LogFormatter::newFromRow($this->row);
     $formatter->setContext($this->list->getContext());
     $formatter->setAudience(LogFormatter::FOR_THIS_USER);
     // Log link for this page
     $loglink = Linker::link(SpecialPage::getTitleFor('Log'), $this->list->msg('log')->escaped(), array(), array('page' => $title->getPrefixedText()));
     $loglink = $this->list->msg('parentheses')->rawParams($loglink)->escaped();
     // User links and action text
     $action = $formatter->getActionText();
     // Comment
     $comment = $this->list->getLanguage()->getDirMark() . Linker::commentBlock($this->row->log_comment);
     if (LogEventsList::isDeleted($this->row, LogPage::DELETED_COMMENT)) {
         $comment = '<span class="history-deleted">' . $comment . '</span>';
     }
     return "<li>{$loglink} {$date} {$action} {$comment}</li>";
 }
开发者ID:eliagbayani,项目名称:LiteratureEditor,代码行数:19,代码来源:RevDelLogItem.php

示例3: formatValue

 /**
  * @param string $field
  * @param string $value
  * @return string HTML
  * @throws MWException
  */
 function formatValue($field, $value)
 {
     /** @var $row object */
     $row = $this->mCurrentRow;
     $formatted = '';
     switch ($field) {
         case 'log_timestamp':
             // when timestamp is null, this is a old protection row
             if ($value === null) {
                 $formatted = Html::rawElement('span', array('class' => 'mw-protectedpages-unknown'), $this->msg('protectedpages-unknown-timestamp')->escaped());
             } else {
                 $formatted = htmlspecialchars($this->getLanguage()->userTimeAndDate($value, $this->getUser()));
             }
             break;
         case 'pr_page':
             $title = Title::makeTitleSafe($row->page_namespace, $row->page_title);
             if (!$title) {
                 $formatted = Html::element('span', array('class' => 'mw-invalidtitle'), Linker::getInvalidTitleDescription($this->getContext(), $row->page_namespace, $row->page_title));
             } else {
                 $formatted = Linker::link($title);
             }
             if (!is_null($row->page_len)) {
                 $formatted .= $this->getLanguage()->getDirMark() . ' ' . Html::rawElement('span', array('class' => 'mw-protectedpages-length'), Linker::formatRevisionSize($row->page_len));
             }
             break;
         case 'pr_expiry':
             $formatted = htmlspecialchars($this->getLanguage()->formatExpiry($value, true));
             $title = Title::makeTitleSafe($row->page_namespace, $row->page_title);
             if ($this->getUser()->isAllowed('protect') && $title) {
                 $changeProtection = Linker::linkKnown($title, $this->msg('protect_change')->escaped(), array(), array('action' => 'unprotect'));
                 $formatted .= ' ' . Html::rawElement('span', array('class' => 'mw-protectedpages-actions'), $this->msg('parentheses')->rawParams($changeProtection)->escaped());
             }
             break;
         case 'log_user':
             // when timestamp is null, this is a old protection row
             if ($row->log_timestamp === null) {
                 $formatted = Html::rawElement('span', array('class' => 'mw-protectedpages-unknown'), $this->msg('protectedpages-unknown-performer')->escaped());
             } else {
                 $username = UserCache::singleton()->getProp($value, 'name');
                 if (LogEventsList::userCanBitfield($row->log_deleted, LogPage::DELETED_USER, $this->getUser())) {
                     if ($username === false) {
                         $formatted = htmlspecialchars($value);
                     } else {
                         $formatted = Linker::userLink($value, $username) . Linker::userToolLinks($value, $username);
                     }
                 } else {
                     $formatted = $this->msg('rev-deleted-user')->escaped();
                 }
                 if (LogEventsList::isDeleted($row, LogPage::DELETED_USER)) {
                     $formatted = '<span class="history-deleted">' . $formatted . '</span>';
                 }
             }
             break;
         case 'pr_params':
             $params = array();
             // Messages: restriction-level-sysop, restriction-level-autoconfirmed
             $params[] = $this->msg('restriction-level-' . $row->pr_level)->escaped();
             if ($row->pr_cascade) {
                 $params[] = $this->msg('protect-summary-cascade')->escaped();
             }
             $formatted = $this->getLanguage()->commaList($params);
             break;
         case 'log_comment':
             // when timestamp is null, this is an old protection row
             if ($row->log_timestamp === null) {
                 $formatted = Html::rawElement('span', array('class' => 'mw-protectedpages-unknown'), $this->msg('protectedpages-unknown-reason')->escaped());
             } else {
                 if (LogEventsList::userCanBitfield($row->log_deleted, LogPage::DELETED_COMMENT, $this->getUser())) {
                     $formatted = Linker::formatComment($value !== null ? $value : '');
                 } else {
                     $formatted = $this->msg('rev-deleted-comment')->escaped();
                 }
                 if (LogEventsList::isDeleted($row, LogPage::DELETED_COMMENT)) {
                     $formatted = '<span class="history-deleted">' . $formatted . '</span>';
                 }
             }
             break;
         default:
             throw new MWException("Unknown field '{$field}'");
     }
     return $formatted;
 }
开发者ID:huatuoorg,项目名称:mediawiki,代码行数:88,代码来源:SpecialProtectedpages.php

示例4: extractRowInfo

 private function extractRowInfo($row)
 {
     $vals = array();
     if ($this->fld_ids) {
         $vals['logid'] = intval($row->log_id);
         $vals['pageid'] = intval($row->page_id);
     }
     if ($this->fld_title || $this->fld_parsedcomment) {
         $title = Title::makeTitle($row->log_namespace, $row->log_title);
     }
     if ($this->fld_title) {
         if (LogEventsList::isDeleted($row, LogPage::DELETED_ACTION)) {
             $vals['actionhidden'] = '';
         } else {
             ApiQueryBase::addTitleInfo($vals, $title);
         }
     }
     if ($this->fld_type || $this->fld_action) {
         $vals['type'] = $row->log_type;
         $vals['action'] = $row->log_action;
     }
     if ($this->fld_details && $row->log_params !== '') {
         if (LogEventsList::isDeleted($row, LogPage::DELETED_ACTION)) {
             $vals['actionhidden'] = '';
         } else {
             self::addLogParams($this->getResult(), $vals, $row->log_params, $row->log_type, $row->log_action, $row->log_timestamp);
         }
     }
     if ($this->fld_user || $this->fld_userid) {
         if (LogEventsList::isDeleted($row, LogPage::DELETED_USER)) {
             $vals['userhidden'] = '';
         } else {
             if ($this->fld_user) {
                 $vals['user'] = $row->user_name;
             }
             if ($this->fld_userid) {
                 $vals['userid'] = $row->user_id;
             }
             if (!$row->log_user) {
                 $vals['anon'] = '';
             }
         }
     }
     if ($this->fld_timestamp) {
         $vals['timestamp'] = wfTimestamp(TS_ISO_8601, $row->log_timestamp);
     }
     if (($this->fld_comment || $this->fld_parsedcomment) && isset($row->log_comment)) {
         if (LogEventsList::isDeleted($row, LogPage::DELETED_COMMENT)) {
             $vals['commenthidden'] = '';
         } else {
             if ($this->fld_comment) {
                 $vals['comment'] = $row->log_comment;
             }
             if ($this->fld_parsedcomment) {
                 global $wgUser;
                 $vals['parsedcomment'] = $wgUser->getSkin()->formatComment($row->log_comment, $title);
             }
         }
     }
     if ($this->fld_tags) {
         if ($row->ts_tags) {
             $tags = explode(',', $row->ts_tags);
             $this->getResult()->setIndexedTagName($tags, 'tag');
             $vals['tags'] = $tags;
         } else {
             $vals['tags'] = array();
         }
     }
     return $vals;
 }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:70,代码来源:ApiQueryLogEvents.php

示例5: logLine

 /**
  * @param Array $row row
  * @returns string
  */
 private function logLine($row)
 {
     global $wgLang;
     $date = $wgLang->timeanddate($row->log_timestamp);
     $paramArray = LogPage::extractParams($row->log_params);
     $title = Title::makeTitle($row->log_namespace, $row->log_title);
     $logtitle = SpecialPage::getTitleFor('Log');
     $loglink = $this->skin->makeKnownLinkObj($logtitle, wfMsgHtml('log'), wfArrayToCGI(array('page' => $title->getPrefixedUrl())));
     // Action text
     if (!LogEventsList::userCan($row, LogPage::DELETED_ACTION)) {
         $action = '<span class="history-deleted">' . wfMsgHtml('rev-deleted-event') . '</span>';
     } else {
         $action = LogPage::actionText($row->log_type, $row->log_action, $title, $this->skin, $paramArray, true, true);
         if ($row->log_deleted & LogPage::DELETED_ACTION) {
             $action = '<span class="history-deleted">' . $action . '</span>';
         }
     }
     // User links
     $userLink = $this->skin->userLink($row->log_user, User::WhoIs($row->log_user));
     if (LogEventsList::isDeleted($row, LogPage::DELETED_USER)) {
         $userLink = '<span class="history-deleted">' . $userLink . '</span>';
     }
     // Comment
     $comment = $wgLang->getDirMark() . $this->skin->commentBlock($row->log_comment);
     if (LogEventsList::isDeleted($row, LogPage::DELETED_COMMENT)) {
         $comment = '<span class="history-deleted">' . $comment . '</span>';
     }
     return "<li>({$loglink}) {$date} {$userLink} {$action} {$comment}</li>";
 }
开发者ID:ruizrube,项目名称:spdef,代码行数:33,代码来源:SpecialRevisiondelete.php

示例6: extractRowInfo

 private function extractRowInfo($row)
 {
     $logEntry = DatabaseLogEntry::newFromRow($row);
     $vals = array(ApiResult::META_TYPE => 'assoc');
     $anyHidden = false;
     $user = $this->getUser();
     if ($this->fld_ids) {
         $vals['logid'] = intval($row->log_id);
     }
     if ($this->fld_title || $this->fld_parsedcomment) {
         $title = Title::makeTitle($row->log_namespace, $row->log_title);
     }
     if ($this->fld_title || $this->fld_ids || $this->fld_details && $row->log_params !== '') {
         if (LogEventsList::isDeleted($row, LogPage::DELETED_ACTION)) {
             $vals['actionhidden'] = true;
             $anyHidden = true;
         }
         if (LogEventsList::userCan($row, LogPage::DELETED_ACTION, $user)) {
             if ($this->fld_title) {
                 ApiQueryBase::addTitleInfo($vals, $title);
             }
             if ($this->fld_ids) {
                 $vals['pageid'] = intval($row->page_id);
                 $vals['logpage'] = intval($row->log_page);
             }
             if ($this->fld_details) {
                 $vals['params'] = LogFormatter::newFromEntry($logEntry)->formatParametersForApi();
             }
         }
     }
     if ($this->fld_type) {
         $vals['type'] = $row->log_type;
         $vals['action'] = $row->log_action;
     }
     if ($this->fld_user || $this->fld_userid) {
         if (LogEventsList::isDeleted($row, LogPage::DELETED_USER)) {
             $vals['userhidden'] = true;
             $anyHidden = true;
         }
         if (LogEventsList::userCan($row, LogPage::DELETED_USER, $user)) {
             if ($this->fld_user) {
                 $vals['user'] = $row->user_name === null ? $row->log_user_text : $row->user_name;
             }
             if ($this->fld_userid) {
                 $vals['userid'] = intval($row->log_user);
             }
             if (!$row->log_user) {
                 $vals['anon'] = true;
             }
         }
     }
     if ($this->fld_timestamp) {
         $vals['timestamp'] = wfTimestamp(TS_ISO_8601, $row->log_timestamp);
     }
     if (($this->fld_comment || $this->fld_parsedcomment) && isset($row->log_comment)) {
         if (LogEventsList::isDeleted($row, LogPage::DELETED_COMMENT)) {
             $vals['commenthidden'] = true;
             $anyHidden = true;
         }
         if (LogEventsList::userCan($row, LogPage::DELETED_COMMENT, $user)) {
             if ($this->fld_comment) {
                 $vals['comment'] = $row->log_comment;
             }
             if ($this->fld_parsedcomment) {
                 $vals['parsedcomment'] = Linker::formatComment($row->log_comment, $title);
             }
         }
     }
     if ($this->fld_tags) {
         if ($row->ts_tags) {
             $tags = explode(',', $row->ts_tags);
             ApiResult::setIndexedTagName($tags, 'tag');
             $vals['tags'] = $tags;
         } else {
             $vals['tags'] = array();
         }
     }
     if ($anyHidden && LogEventsList::isDeleted($row, LogPage::DELETED_RESTRICTED)) {
         $vals['suppressed'] = true;
     }
     return $vals;
 }
开发者ID:Acidburn0zzz,项目名称:mediawiki,代码行数:82,代码来源:ApiQueryLogEvents.php

示例7: extractRowInfo

 private function extractRowInfo($row)
 {
     $vals = array();
     if ($this->fld_ids) {
         $vals['logid'] = intval($row->log_id);
         $vals['pageid'] = intval($row->page_id);
     }
     if ($this->fld_title) {
         if (LogEventsList::isDeleted($row, LogPage::DELETED_ACTION)) {
             $vals['actionhidden'] = '';
         } else {
             $title = Title::makeTitle($row->log_namespace, $row->log_title);
             ApiQueryBase::addTitleInfo($vals, $title);
         }
     }
     if ($this->fld_type) {
         $vals['type'] = $row->log_type;
         $vals['action'] = $row->log_action;
     }
     if ($this->fld_details && $row->log_params !== '') {
         if (LogEventsList::isDeleted($row, LogPage::DELETED_ACTION)) {
             $vals['actionhidden'] = '';
         } else {
             self::addLogParams($this->getResult(), $vals, $row->log_params, $row->log_type, $row->log_timestamp);
         }
     }
     if ($this->fld_user) {
         if (LogEventsList::isDeleted($row, LogPage::DELETED_USER)) {
             $vals['userhidden'] = '';
         } else {
             $vals['user'] = $row->user_name;
             if (!$row->log_user) {
                 $vals['anon'] = '';
             }
         }
     }
     if ($this->fld_timestamp) {
         $vals['timestamp'] = wfTimestamp(TS_ISO_8601, $row->log_timestamp);
     }
     if ($this->fld_comment && isset($row->log_comment)) {
         if (LogEventsList::isDeleted($row, LogPage::DELETED_COMMENT)) {
             $vals['commenthidden'] = '';
         } else {
             $vals['comment'] = $row->log_comment;
         }
     }
     return $vals;
 }
开发者ID:ruizrube,项目名称:spdef,代码行数:48,代码来源:ApiQueryLogEvents.php

示例8: getHTML

 public function getHTML()
 {
     $date = htmlspecialchars($this->list->getLang()->timeanddate($this->row->log_timestamp));
     $paramArray = LogPage::extractParams($this->row->log_params);
     $title = Title::makeTitle($this->row->log_namespace, $this->row->log_title);
     // Log link for this page
     $loglink = Linker::link(SpecialPage::getTitleFor('Log'), wfMsgHtml('log'), array(), array('page' => $title->getPrefixedText()));
     // Action text
     if (!$this->canView()) {
         $action = '<span class="history-deleted">' . wfMsgHtml('rev-deleted-event') . '</span>';
     } else {
         $skin = $this->list->getUser()->getSkin();
         $action = LogPage::actionText($this->row->log_type, $this->row->log_action, $title, $skin, $paramArray, true, true);
         if ($this->row->log_deleted & LogPage::DELETED_ACTION) {
             $action = '<span class="history-deleted">' . $action . '</span>';
         }
     }
     // User links
     $userLink = Linker::userLink($this->row->log_user, User::WhoIs($this->row->log_user));
     if (LogEventsList::isDeleted($this->row, LogPage::DELETED_USER)) {
         $userLink = '<span class="history-deleted">' . $userLink . '</span>';
     }
     // Comment
     $comment = $this->list->getLang()->getDirMark() . Linker::commentBlock($this->row->log_comment);
     if (LogEventsList::isDeleted($this->row, LogPage::DELETED_COMMENT)) {
         $comment = '<span class="history-deleted">' . $comment . '</span>';
     }
     return "<li>({$loglink}) {$date} {$userLink} {$action} {$comment}</li>";
 }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:29,代码来源:RevisionDelete.php


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