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


PHP DifferenceEngine::intermediateEditsMsg方法代码示例

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


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

示例1: getTopDiffToggle

 /**
  * Get collapsible diff-to-stable html to add to the review notice as needed
  * @param FlaggedRevision $srev, stable version
  * @param bool $quality, revision is quality
  * @return string, the html line (either "" or "<diff toggle><diff div>")
  */
 protected function getTopDiffToggle(FlaggedRevision $srev, $quality)
 {
     $reqUser = $this->getUser();
     $this->load();
     if (!$reqUser->getBoolOption('flaggedrevsviewdiffs')) {
         return false;
         // nothing to do here
     }
     # Diff should only show for the draft
     $oldid = $this->getOldIDFromRequest();
     $latest = $this->article->getLatest();
     if ($oldid && $oldid != $latest) {
         return false;
         // not viewing the draft
     }
     $revsSince = $this->article->getPendingRevCount();
     if (!$revsSince) {
         return false;
         // no pending changes
     }
     $title = $this->article->getTitle();
     // convenience
     # Review status of left diff revision...
     $leftNote = $quality ? 'revreview-hist-quality' : 'revreview-hist-basic';
     $lClass = FlaggedRevsXML::getQualityColor((int) $quality);
     $leftNote = "<span class='{$lClass}'>[" . wfMsgHtml($leftNote) . "]</span>";
     # Review status of right diff revision...
     $rClass = FlaggedRevsXML::getQualityColor(false);
     $rightNote = "<span class='{$rClass}'>[" . wfMsgHtml('revreview-hist-pending') . "]</span>";
     # Get the actual body of the diff...
     $diffEngine = new DifferenceEngine($title, $srev->getRevId(), $latest);
     $diffBody = $diffEngine->getDiffBody();
     if (strlen($diffBody) > 0) {
         $nEdits = $revsSince - 1;
         // full diff-to-stable, no need for query
         if ($nEdits) {
             $limit = 100;
             $nUsers = $title->countAuthorsBetween($srev->getRevId(), $latest, $limit);
             $multiNotice = DifferenceEngine::intermediateEditsMsg($nEdits, $nUsers, $limit);
         } else {
             $multiNotice = '';
         }
         $diffEngine->showDiffStyle();
         // add CSS
         $this->isDiffFromStable = true;
         // alter default review form tags
         return FlaggedRevsXML::diffToggle() . "<div id='mw-fr-stablediff'>\n" . self::getFormattedDiff($diffBody, $multiNotice, $leftNote, $rightNote) . "</div>\n";
     }
     return '';
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:56,代码来源:FlaggablePageView.php


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