本文整理汇总了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 '';
}