示例#1
0
 public function compareTest(EasyBlogTableRevision $source, EasyBlogTableRevision $target)
 {
     $sourceDoc = $source->getDocument();
     $targetDoc = $target->getDocument();
     $sourceData = $source->getContent();
     $targetData = $target->getContent();
     // echo $sourceDocument->getContent();
     // exit;
     echo html_diff($targetDoc->getContent(), $sourceDoc->getContent(), true);
     exit;
     echo $targetDocument->getContent();
     exit;
     echo html_diff($sourceDoc->getContent(), $targetDoc->getContent(), true);
     exit;
     echo html_diff($targetDocument->getContent(), $sourceDocument->getContent(), true);
     exit;
     echo html_diff($sourceData->intro, $targetData->intro);
     exit;
     echo html_diff($targetDocument->getContent(), $sourceDocument->getContent());
     exit;
     $sourceBlocks = $sourceDocument->getBlocks();
     $targetBlocks = $targetDocument->getBlocks();
     $diff = html_diff($sourceDocument->getContent(), $targetDocument->getContent(), true);
     echo $diff;
     exit;
     return $diff;
 }
示例#2
0
 /**
  * Retrieves the post content that is used for diff
  *
  * @since	5.0
  * @access	public
  * @param	string
  * @return
  */
 public function getDiffContent(EasyBlogTableRevision $target)
 {
     $targetContentObj = $target->getContent();
     $currentContentObj = $this->getContent();
     $targetHtml = $targetContentObj->intro . $targetContentObj->content;
     $targetHtml = JString::str_ireplace(' ', ' ', $targetHtml);
     $currentHtml = $currentContentObj->intro . $currentContentObj->content;
     $currentHtml = JString::str_ireplace(' ', ' ', $currentHtml);
     $html = EB::revisions()->compare($currentHtml, $targetHtml);
     $theme = EB::template();
     $theme->set('html', $html);
     $output = $theme->output('site/composer/revisions/compare.blocks');
     return $output;
 }