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


PHP Revision::isDeleted方法代码示例

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


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

示例1: showDeletedRevisionHeader

 /**
  * If the revision requested for view is deleted, check permissions.
  * Send either an error message or a warning header to $wgOut.
  *
  * @return boolean true if the view is allowed, false if not.
  */
 public function showDeletedRevisionHeader()
 {
     global $wgOut, $wgRequest;
     if (!$this->mRevision->isDeleted(Revision::DELETED_TEXT)) {
         // Not deleted
         return true;
     }
     // If the user is not allowed to see it...
     if (!$this->mRevision->userCan(Revision::DELETED_TEXT)) {
         $wgOut->wrapWikiMsg("<div class='mw-warning plainlinks'>\n\$1\n</div>\n", 'rev-deleted-text-permission');
         return false;
         // If the user needs to confirm that they want to see it...
     } elseif ($wgRequest->getInt('unhide') != 1) {
         # Give explanation and add a link to view the revision...
         $oldid = intval($this->getOldID());
         $link = $this->getTitle()->getFullUrl("oldid={$oldid}&unhide=1");
         $msg = $this->mRevision->isDeleted(Revision::DELETED_RESTRICTED) ? 'rev-suppressed-text-unhide' : 'rev-deleted-text-unhide';
         $wgOut->wrapWikiMsg("<div class='mw-warning plainlinks'>\n\$1\n</div>\n", array($msg, $link));
         return false;
         // We are allowed to see...
     } else {
         $msg = $this->mRevision->isDeleted(Revision::DELETED_RESTRICTED) ? 'rev-suppressed-text-view' : 'rev-deleted-text-view';
         $wgOut->wrapWikiMsg("<div class='mw-warning plainlinks'>\n\$1\n</div>\n", $msg);
         return true;
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:32,代码来源:Article.php

示例2: extractRevisionInfo

 /**
  * Extract information from the Revision
  *
  * @param Revision $revision
  * @param object $row Should have a field 'ts_tags' if $this->fld_tags is set
  * @return array
  */
 protected function extractRevisionInfo(Revision $revision, $row)
 {
     $title = $revision->getTitle();
     $user = $this->getUser();
     $vals = array();
     $anyHidden = false;
     if ($this->fld_ids) {
         $vals['revid'] = intval($revision->getId());
         if (!is_null($revision->getParentId())) {
             $vals['parentid'] = intval($revision->getParentId());
         }
     }
     if ($this->fld_flags) {
         $vals['minor'] = $revision->isMinor();
     }
     if ($this->fld_user || $this->fld_userid) {
         if ($revision->isDeleted(Revision::DELETED_USER)) {
             $vals['userhidden'] = true;
             $anyHidden = true;
         }
         if ($revision->userCan(Revision::DELETED_USER, $user)) {
             if ($this->fld_user) {
                 $vals['user'] = $revision->getUserText(Revision::RAW);
             }
             $userid = $revision->getUser(Revision::RAW);
             if (!$userid) {
                 $vals['anon'] = true;
             }
             if ($this->fld_userid) {
                 $vals['userid'] = $userid;
             }
         }
     }
     if ($this->fld_timestamp) {
         $vals['timestamp'] = wfTimestamp(TS_ISO_8601, $revision->getTimestamp());
     }
     if ($this->fld_size) {
         if (!is_null($revision->getSize())) {
             $vals['size'] = intval($revision->getSize());
         } else {
             $vals['size'] = 0;
         }
     }
     if ($this->fld_sha1) {
         if ($revision->isDeleted(Revision::DELETED_TEXT)) {
             $vals['sha1hidden'] = true;
             $anyHidden = true;
         }
         if ($revision->userCan(Revision::DELETED_TEXT, $user)) {
             if ($revision->getSha1() != '') {
                 $vals['sha1'] = wfBaseConvert($revision->getSha1(), 36, 16, 40);
             } else {
                 $vals['sha1'] = '';
             }
         }
     }
     if ($this->fld_contentmodel) {
         $vals['contentmodel'] = $revision->getContentModel();
     }
     if ($this->fld_comment || $this->fld_parsedcomment) {
         if ($revision->isDeleted(Revision::DELETED_COMMENT)) {
             $vals['commenthidden'] = true;
             $anyHidden = true;
         }
         if ($revision->userCan(Revision::DELETED_COMMENT, $user)) {
             $comment = $revision->getComment(Revision::RAW);
             if ($this->fld_comment) {
                 $vals['comment'] = $comment;
             }
             if ($this->fld_parsedcomment) {
                 $vals['parsedcomment'] = Linker::formatComment($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();
         }
     }
     $content = null;
     global $wgParser;
     if ($this->fetchContent) {
         $content = $revision->getContent(Revision::FOR_THIS_USER, $this->getUser());
         // Expand templates after getting section content because
         // template-added sections don't count and Parser::preprocess()
         // will have less input
         if ($content && $this->section !== false) {
             $content = $content->getSection($this->section, false);
             if (!$content) {
//.........这里部分代码省略.........
开发者ID:eliagbayani,项目名称:LiteratureEditor,代码行数:101,代码来源:ApiQueryRevisionsBase.php

示例3: formatRevisionRow

 function formatRevisionRow($row)
 {
     global $wgUser, $wgLang;
     $rev = new Revision($row);
     $stxt = '';
     $last = $this->message['last'];
     $ts = wfTimestamp(TS_MW, $row->rev_timestamp);
     $checkBox = Xml::radio("mergepoint", $ts, false);
     $pageLink = $this->sk->makeKnownLinkObj($rev->getTitle(), htmlspecialchars($wgLang->timeanddate($ts)), 'oldid=' . $rev->getId());
     if ($rev->isDeleted(Revision::DELETED_TEXT)) {
         $pageLink = '<span class="history-deleted">' . $pageLink . '</span>';
     }
     # Last link
     if (!$rev->userCan(Revision::DELETED_TEXT)) {
         $last = $this->message['last'];
     } else {
         if (isset($this->prevId[$row->rev_id])) {
             $last = $this->sk->makeKnownLinkObj($rev->getTitle(), $this->message['last'], "diff=" . $row->rev_id . "&oldid=" . $this->prevId[$row->rev_id]);
         }
     }
     $userLink = $this->sk->revUserTools($rev);
     if (!is_null($size = $row->rev_len)) {
         $stxt = $this->sk->formatRevisionSize($size);
     }
     $comment = $this->sk->revComment($rev);
     return "<li>{$checkBox} ({$last}) {$pageLink} . . {$userLink} {$stxt} {$comment}</li>";
 }
开发者ID:amjadtbssm,项目名称:website,代码行数:27,代码来源:SpecialMergeHistory.php

示例4: getRevDeleteLink

 /**
  * Get a revision-deletion link, or disabled link, or nothing, depending
  * on user permissions & the settings on the revision.
  *
  * Will use forward-compatible revision ID in the Special:RevDelete link
  * if possible, otherwise the timestamp-based ID which may break after
  * undeletion.
  *
  * @param User $user
  * @param Revision $rev
  * @param Revision $title
  * @return string HTML fragment
  */
 public static function getRevDeleteLink(User $user, Revision $rev, Title $title)
 {
     $canHide = $user->isAllowed('deleterevision');
     if (!$canHide && !($rev->getVisibility() && $user->isAllowed('deletedhistory'))) {
         return '';
     }
     if (!$rev->userCan(Revision::DELETED_RESTRICTED, $user)) {
         return Linker::revDeleteLinkDisabled($canHide);
         // revision was hidden from sysops
     } else {
         if ($rev->getId()) {
             // RevDelete links using revision ID are stable across
             // page deletion and undeletion; use when possible.
             $query = array('type' => 'revision', 'target' => $title->getPrefixedDBkey(), 'ids' => $rev->getId());
         } else {
             // Older deleted entries didn't save a revision ID.
             // We have to refer to these by timestamp, ick!
             $query = array('type' => 'archive', 'target' => $title->getPrefixedDBkey(), 'ids' => $rev->getTimestamp());
         }
         return Linker::revDeleteLink($query, $rev->isDeleted(Revision::DELETED_RESTRICTED), $canHide);
     }
 }
开发者ID:h4ck3rm1k3,项目名称:mediawiki,代码行数:35,代码来源:Linker.php

示例5: historyLine

 /**
  * @param Revision $rev
  * @returns string
  */
 private function historyLine($rev)
 {
     global $wgLang, $wgUser;
     $date = $wgLang->timeanddate($rev->getTimestamp());
     $difflink = $del = '';
     // Live revisions
     if ($this->deleteKey == 'oldid') {
         $tokenParams = '&unhide=1&token=' . urlencode($wgUser->editToken($rev->getId()));
         $revlink = $this->skin->makeLinkObj($this->page, $date, 'oldid=' . $rev->getId() . $tokenParams);
         $difflink = '(' . $this->skin->makeKnownLinkObj($this->page, wfMsgHtml('diff'), 'diff=' . $rev->getId() . '&oldid=prev' . $tokenParams) . ')';
         // Archived revisions
     } else {
         $undelete = SpecialPage::getTitleFor('Undelete');
         $target = $this->page->getPrefixedText();
         $revlink = $this->skin->makeLinkObj($undelete, $date, "target={$target}&timestamp=" . $rev->getTimestamp());
         $difflink = '(' . $this->skin->makeKnownLinkObj($undelete, wfMsgHtml('diff'), "target={$target}&diff=prev&timestamp=" . $rev->getTimestamp()) . ')';
     }
     // Check permissions; items may be "suppressed"
     if ($rev->isDeleted(Revision::DELETED_TEXT)) {
         $revlink = '<span class="history-deleted">' . $revlink . '</span>';
         $del = ' <tt>' . wfMsgHtml('deletedrev') . '</tt>';
         if (!$rev->userCan(Revision::DELETED_TEXT)) {
             $revlink = '<span class="history-deleted">' . $date . '</span>';
             $difflink = '(' . wfMsgHtml('diff') . ')';
         }
     }
     $userlink = $this->skin->revUserLink($rev);
     $comment = $this->skin->revComment($rev);
     return "<li>{$difflink} {$revlink} {$userlink} {$comment}{$del}</li>";
 }
开发者ID:ruizrube,项目名称:spdef,代码行数:34,代码来源:SpecialRevisiondelete.php

示例6: curLink

 /**
  * Create a diff-to-current link for this revision for this page
  * @param Revision $rev
  * @param Bool $latest, this is the latest revision of the page?
  * @returns string
  */
 function curLink($rev, $latest)
 {
     $cur = $this->message['cur'];
     if ($latest || $rev->isDeleted(Revision::DELETED_TEXT)) {
         return $cur;
     } else {
         return $this->mSkin->makeKnownLinkObj($this->mTitle, $cur, 'diff=' . $this->mTitle->getLatestRevID() . "&oldid=" . $rev->getId());
     }
 }
开发者ID:Jobava,项目名称:diacritice-meta-repo,代码行数:15,代码来源:PageHistory.php

示例7: revComment

 /**
  * Wrap and format the given revision's comment block, if the current
  * user is allowed to view it.
  *
  * @param $rev Revision object
  * @param $local Boolean: whether section links should refer to local page
  * @param $isPublic Boolean: show only if all users can see it
  * @return String: HTML fragment
  */
 static function revComment(Revision $rev, $local = false, $isPublic = false)
 {
     if ($rev->getRawComment() == "") {
         return "";
     }
     if ($rev->isDeleted(Revision::DELETED_COMMENT) && $isPublic) {
         $block = " <span class=\"comment\">" . wfMsgHtml('rev-deleted-comment') . "</span>";
     } elseif ($rev->userCan(Revision::DELETED_COMMENT)) {
         $block = self::commentBlock($rev->getComment(Revision::FOR_THIS_USER), $rev->getTitle(), $local);
     } else {
         $block = " <span class=\"comment\">" . wfMsgHtml('rev-deleted-comment') . "</span>";
     }
     if ($rev->isDeleted(Revision::DELETED_COMMENT)) {
         return " <span class=\"history-deleted\">{$block}</span>";
     }
     return $block;
 }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:26,代码来源:Linker.php

示例8: getPageLink

 /**
  * Fetch revision text link if it's available to all users
  *
  * @param Revision $rev
  * @param Title $titleObj
  * @param string $ts Timestamp
  * @return string
  */
 function getPageLink($rev, $titleObj, $ts)
 {
     $user = $this->getUser();
     $time = $this->getLanguage()->userTimeAndDate($ts, $user);
     if (!$rev->userCan(Revision::DELETED_TEXT, $user)) {
         return '<span class="history-deleted">' . $time . '</span>';
     }
     $link = Linker::linkKnown($titleObj, htmlspecialchars($time), array(), array('target' => $this->mTargetObj->getPrefixedText(), 'timestamp' => $ts));
     if ($rev->isDeleted(Revision::DELETED_TEXT)) {
         $link = '<span class="history-deleted">' . $link . '</span>';
     }
     return $link;
 }
开发者ID:raymondzhangl,项目名称:mediawiki,代码行数:21,代码来源:SpecialUndelete.php

示例9: revDeleteLink

 /**
  * Get a revision-deletion link, or disabled link, or nothing, depending
  * on user permissions & the settings on the revision.
  *
  * Will use forward-compatible revision ID in the Special:RevDelete link
  * if possible, otherwise the timestamp-based ID which may break after
  * undeletion.
  *
  * @param Revision $rev
  * @return string HTML fragment
  */
 function revDeleteLink($rev)
 {
     $canHide = $this->getUser()->isAllowed('deleterevision');
     if ($canHide || $rev->getVisibility() && $this->getUser()->isAllowed('deletedhistory')) {
         if (!$rev->userCan(Revision::DELETED_RESTRICTED)) {
             $revdlink = Linker::revDeleteLinkDisabled($canHide);
             // revision was hidden from sysops
         } else {
             if ($rev->getId()) {
                 // RevDelete links using revision ID are stable across
                 // page deletion and undeletion; use when possible.
                 $query = array('type' => 'revision', 'target' => $this->mTargetObj->getPrefixedDBkey(), 'ids' => $rev->getId());
             } else {
                 // Older deleted entries didn't save a revision ID.
                 // We have to refer to these by timestamp, ick!
                 $query = array('type' => 'archive', 'target' => $this->mTargetObj->getPrefixedDBkey(), 'ids' => $rev->getTimestamp());
             }
             return Linker::revDeleteLink($query, $rev->isDeleted(File::DELETED_RESTRICTED), $canHide);
         }
     } else {
         return '';
     }
 }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:34,代码来源:SpecialUndelete.php

示例10: revComment

 /**
  * Wrap and format the given revision's comment block, if the current
  * user is allowed to view it.
  *
  * @param Revision $rev
  * @param bool $local Whether section links should refer to local page
  * @return string HTML
  */
 function revComment(Revision $rev, $local = false)
 {
     if ($rev->userCan(Revision::DELETED_COMMENT)) {
         $block = $this->commentBlock($rev->getRawComment(), $rev->getTitle(), $local);
     } else {
         $block = " <span class=\"comment\">" . wfMsgHtml('rev-deleted-comment') . "</span>";
     }
     if ($rev->isDeleted(Revision::DELETED_COMMENT)) {
         return " <span class=\"history-deleted\">{$block}</span>";
     }
     return $block;
 }
开发者ID:ErdemA,项目名称:wikihow,代码行数:20,代码来源:Linker.php

示例11: getRevisionHeader

 /**
  * Get a header for a specified revision.
  *
  * @param $rev Revision
  * @param $complete String: 'complete' to get the header wrapped depending
  *        the visibility of the revision and a link to edit the page.
  * @return String HTML fragment
  */
 private function getRevisionHeader(Revision $rev, $complete = '')
 {
     $lang = $this->getLanguage();
     $user = $this->getUser();
     $revtimestamp = $rev->getTimestamp();
     $timestamp = $lang->userTimeAndDate($revtimestamp, $user);
     $dateofrev = $lang->userDate($revtimestamp, $user);
     $timeofrev = $lang->userTime($revtimestamp, $user);
     $header = $this->msg($rev->isCurrent() ? 'currentrev-asof' : 'revisionasof', $timestamp, $dateofrev, $timeofrev)->escaped();
     if ($complete !== 'complete') {
         return $header;
     }
     $title = $rev->getTitle();
     $header = Linker::linkKnown($title, $header, array(), array('oldid' => $rev->getID()));
     if ($rev->userCan(Revision::DELETED_TEXT, $user)) {
         $editQuery = array('action' => 'edit');
         if (!$rev->isCurrent()) {
             $editQuery['oldid'] = $rev->getID();
         }
         $msg = $this->msg($title->userCan('edit', $user) ? 'editold' : 'viewsourceold')->escaped();
         /* Wikia Change begin */
         $header .= ' <span class="mw-rev-head-action">(' . Linker::linkKnown($title, $msg, array(), $editQuery) . ')</span>';
         /* Wikia Change end */
         if ($rev->isDeleted(Revision::DELETED_TEXT)) {
             $header = Html::rawElement('span', array('class' => 'history-deleted'), $header);
         }
     } else {
         $header = Html::rawElement('span', array('class' => 'history-deleted'), $header);
     }
     return $header;
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:39,代码来源:DifferenceEngine.php

示例12: extractRowInfo

 private function extractRowInfo($row)
 {
     $revision = new Revision($row);
     $title = $revision->getTitle();
     $vals = array();
     if ($this->fld_ids) {
         $vals['revid'] = intval($revision->getId());
         // $vals['oldid'] = intval( $row->rev_text_id ); // todo: should this be exposed?
         if (!is_null($revision->getParentId())) {
             $vals['parentid'] = intval($revision->getParentId());
         }
     }
     if ($this->fld_flags && $revision->isMinor()) {
         $vals['minor'] = '';
     }
     if ($this->fld_user || $this->fld_userid) {
         if ($revision->isDeleted(Revision::DELETED_USER)) {
             $vals['userhidden'] = '';
         } else {
             if ($this->fld_user) {
                 $vals['user'] = $revision->getUserText();
             }
             $userid = $revision->getUser();
             if (!$userid) {
                 $vals['anon'] = '';
             }
             if ($this->fld_userid) {
                 $vals['userid'] = $userid;
             }
         }
     }
     if ($this->fld_timestamp) {
         $vals['timestamp'] = wfTimestamp(TS_ISO_8601, $revision->getTimestamp());
     }
     if ($this->fld_size) {
         if (!is_null($revision->getSize())) {
             $vals['size'] = intval($revision->getSize());
         } else {
             $vals['size'] = 0;
         }
     }
     if ($this->fld_sha1) {
         if ($revision->getSha1() != '') {
             $vals['sha1'] = wfBaseConvert($revision->getSha1(), 36, 16, 40);
         } else {
             $vals['sha1'] = '';
         }
     }
     if ($this->fld_contentmodel) {
         $vals['contentmodel'] = $revision->getContentModel();
     }
     if ($this->fld_comment || $this->fld_parsedcomment) {
         if ($revision->isDeleted(Revision::DELETED_COMMENT)) {
             $vals['commenthidden'] = '';
         } else {
             $comment = $revision->getComment();
             if ($this->fld_comment) {
                 $vals['comment'] = $comment;
             }
             if ($this->fld_parsedcomment) {
                 $vals['parsedcomment'] = Linker::formatComment($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();
         }
     }
     if (!is_null($this->token)) {
         $tokenFunctions = $this->getTokenFunctions();
         foreach ($this->token as $t) {
             $val = call_user_func($tokenFunctions[$t], $title->getArticleID(), $title, $revision);
             if ($val === false) {
                 $this->setWarning("Action '{$t}' is not allowed for the current user");
             } else {
                 $vals[$t . 'token'] = $val;
             }
         }
     }
     $content = null;
     global $wgParser;
     if ($this->fld_content || !is_null($this->difftotext)) {
         $content = $revision->getContent();
         // Expand templates after getting section content because
         // template-added sections don't count and Parser::preprocess()
         // will have less input
         if ($this->section !== false) {
             $content = $content->getSection($this->section, false);
             if (!$content) {
                 $this->dieUsage("There is no section {$this->section} in r" . $revision->getId(), 'nosuchsection');
             }
         }
     }
     if ($this->fld_content && !$revision->isDeleted(Revision::DELETED_TEXT)) {
         $text = null;
//.........这里部分代码省略.........
开发者ID:nischayn22,项目名称:mediawiki-core,代码行数:101,代码来源:ApiQueryRevisions.php

示例13: formatRevisionRow

 function formatRevisionRow($row)
 {
     $rev = new Revision($row);
     $stxt = '';
     $last = $this->message['last'];
     $ts = wfTimestamp(TS_MW, $row->rev_timestamp);
     $checkBox = Xml::radio('mergepoint', $ts, false);
     $pageLink = Linker::linkKnown($rev->getTitle(), htmlspecialchars($this->getLanguage()->timeanddate($ts)), array(), array('oldid' => $rev->getId()));
     if ($rev->isDeleted(Revision::DELETED_TEXT)) {
         $pageLink = '<span class="history-deleted">' . $pageLink . '</span>';
     }
     # Last link
     if (!$rev->userCan(Revision::DELETED_TEXT, $this->getUser())) {
         $last = $this->message['last'];
     } elseif (isset($this->prevId[$row->rev_id])) {
         $last = Linker::linkKnown($rev->getTitle(), $this->message['last'], array(), array('diff' => $row->rev_id, 'oldid' => $this->prevId[$row->rev_id]));
     }
     $userLink = Linker::revUserTools($rev);
     $size = $row->rev_len;
     if (!is_null($size)) {
         $stxt = Linker::formatRevisionSize($size);
     }
     $comment = Linker::revComment($rev);
     return "<li>{$checkBox} ({$last}) {$pageLink} . . {$userLink} {$stxt} {$comment}</li>";
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:25,代码来源:SpecialMergeHistory.php

示例14: getHtml

 /**
  * Get the "are you sure you want to reject these changes?" form
  * @return array (html string, error string or true)
  */
 public function getHtml()
 {
     global $wgLang, $wgContLang;
     $status = $this->form->checkTarget();
     if ($status !== true) {
         return array('', $status);
         // not a reviewable existing page
     }
     $oldRev = $this->oldRev;
     // convenience
     $newRev = $this->newRev;
     // convenience
     # Do not mess with archived/deleted revisions
     if (!$oldRev || $newRev->isDeleted(Revision::DELETED_TEXT)) {
         return array('', 'review_bad_oldid');
     } elseif (!$newRev || $newRev->isDeleted(Revision::DELETED_TEXT)) {
         return array('', 'review_bad_oldid');
     }
     $form = '<div class="plainlinks">';
     $dbr = wfGetDB(DB_SLAVE);
     $res = $dbr->select('revision', Revision::selectFields(), array('rev_page' => $oldRev->getPage(), 'rev_timestamp > ' . $dbr->addQuotes($dbr->timestamp($oldRev->getTimestamp())), 'rev_timestamp <= ' . $dbr->addQuotes($dbr->timestamp($newRev->getTimestamp()))), __METHOD__, array('ORDER BY' => 'rev_timestamp ASC', 'LIMIT' => 251));
     if (!$dbr->numRows($res)) {
         return array('', 'review_bad_oldid');
     } elseif ($dbr->numRows($res) > 250) {
         return array('', 'review_reject_excessive');
     }
     $contribs = SpecialPage::getTitleFor('Contributions')->getPrefixedText();
     $lastTextId = 0;
     $rejectIds = $rejectAuthors = array();
     foreach ($res as $row) {
         $rev = new Revision($row);
         if ($rev->getTextId() != $lastTextId) {
             // skip null edits
             $rejectIds[] = $rev->getId();
             $rejectAuthors[] = $rev->isDeleted(Revision::DELETED_USER) ? wfMsg('rev-deleted-user') : "[[{$contribs}/{$rev->getUserText()}|{$rev->getUserText()}]]";
         }
         $lastTextId = $rev->getTextId();
     }
     $rejectAuthors = array_values(array_unique($rejectAuthors));
     if (!$rejectIds) {
         // all null edits? (this shouldn't happen)
         return array('', 'review_reject_nulledits');
     }
     // List of revisions being undone...
     $form .= wfMsgExt('revreview-reject-text-list', 'parseinline', $wgLang->formatNum(count($rejectIds)), $oldRev->getTitle()->getPrefixedText());
     $form .= '<ul>';
     $list = new RevisionList(RequestContext::getMain(), $oldRev->getTitle());
     $list->filterByIds($rejectIds);
     for ($list->reset(); $list->current(); $list->next()) {
         $item = $list->current();
         if ($item->canView()) {
             $form .= $item->getHTML();
         }
     }
     $form .= '</ul>';
     if ($newRev->isCurrent()) {
         // Revision this will revert to (when reverting the top X revs)...
         $form .= wfMsgExt('revreview-reject-text-revto', 'parseinline', $oldRev->getTitle()->getPrefixedDBKey(), $oldRev->getId(), $wgLang->timeanddate($oldRev->getTimestamp(), true));
     }
     $comment = $this->form->getComment();
     // convenience
     // Determine the default edit summary...
     $oldRevAuthor = $oldRev->isDeleted(Revision::DELETED_USER) ? wfMsg('rev-deleted-user') : $oldRev->getUserText();
     // NOTE: *-cur msg wording not safe for (unlikely) edit auto-merge
     $msg = $newRev->isCurrent() ? 'revreview-reject-summary-cur' : 'revreview-reject-summary-old';
     $defaultSummary = wfMsgExt($msg, array('parsemag', 'content'), $wgContLang->formatNum(count($rejectIds)), $wgContLang->listToText($rejectAuthors), $oldRev->getId(), $oldRevAuthor);
     // If the message is too big, then fallback to the shorter one
     $colonSeparator = wfMsgForContent('colon-separator');
     $maxLen = 255 - count($colonSeparator) - count($comment);
     if (strlen($defaultSummary) > $maxLen) {
         $msg = $newRev->isCurrent() ? 'revreview-reject-summary-cur-short' : 'revreview-reject-summary-old-short';
         $defaultSummary = wfMsgExt($msg, array('parsemag', 'content'), $wgContLang->formatNum(count($rejectIds)), $oldRev->getId(), $oldRevAuthor);
     }
     // Append any review comment...
     if ($comment != '') {
         if ($defaultSummary != '') {
             $defaultSummary .= $colonSeparator;
         }
         $defaultSummary .= $comment;
     }
     $form .= '</div>';
     $skin = $this->form->getUser()->getSkin();
     $reviewTitle = SpecialPage::getTitleFor('RevisionReview');
     $form .= Xml::openElement('form', array('method' => 'POST', 'action' => $reviewTitle->getFullUrl()));
     $form .= Html::hidden('action', 'reject');
     $form .= Html::hidden('wpReject', 1);
     $form .= Html::hidden('wpRejectConfirm', 1);
     $form .= Html::hidden('oldid', $this->form->getOldId());
     $form .= Html::hidden('refid', $this->form->getRefId());
     $form .= Html::hidden('target', $oldRev->getTitle()->getPrefixedDBKey());
     $form .= Html::hidden('wpEditToken', $this->form->getUser()->editToken());
     $form .= Html::hidden('changetime', $newRev->getTimestamp());
     $form .= Xml::inputLabel(wfMsg('revreview-reject-summary'), 'wpReason', 'wpReason', 120, $defaultSummary, array('maxlength' => 200)) . "<br />";
     $form .= Html::input('wpSubmit', wfMsg('revreview-reject-confirm'), 'submit');
     $form .= ' ';
     $form .= $skin->link($this->form->getPage(), wfMsg('revreview-reject-cancel'), array('onClick' => 'history.back(); return history.length <= 1;'), array('oldid' => $this->form->getRefId(), 'diff' => $this->form->getOldId()));
//.........这里部分代码省略.........
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:101,代码来源:RejectConfirmationFormUI.php

示例15: historyLine

 /**
  * @param Revision $rev
  * @returns string
  */
 private function historyLine($rev)
 {
     global $wgLang;
     $date = $wgLang->timeanddate($rev->getTimestamp());
     $difflink = $del = '';
     // Live revisions
     if ($this->deleteKey == 'oldid') {
         $revlink = $this->skin->makeLinkObj($this->page, $date, 'oldid=' . $rev->getId());
         $difflink = '(' . $this->skin->makeKnownLinkObj($this->page, wfMsgHtml('diff'), 'diff=' . $rev->getId() . '&oldid=prev') . ')';
         // Archived revisions
     } else {
         $undelete = SpecialPage::getTitleFor('Undelete');
         $target = $this->page->getPrefixedText();
         $revlink = $this->skin->makeLinkObj($undelete, $date, "target={$target}&timestamp=" . $rev->getTimestamp());
         $difflink = '(' . $this->skin->makeKnownLinkObj($undelete, wfMsgHtml('diff'), "target={$target}&diff=prev&timestamp=" . $rev->getTimestamp()) . ')';
     }
     if ($rev->isDeleted(Revision::DELETED_TEXT)) {
         $revlink = '<span class="history-deleted">' . $revlink . '</span>';
         $del = ' <tt>' . wfMsgHtml('deletedrev') . '</tt>';
         if (!$rev->userCan(Revision::DELETED_TEXT)) {
             $revlink = '<span class="history-deleted">' . $date . '</span>';
             $difflink = '(' . wfMsgHtml('diff') . ')';
         }
     }
     return "<li> {$difflink} {$revlink} " . $this->skin->revUserLink($rev) . " " . $this->skin->revComment($rev) . "{$del}</li>";
 }
开发者ID:amjadtbssm,项目名称:website,代码行数:30,代码来源:SpecialRevisiondelete.php


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