- md5
- 54cb94828a79353b86b20fed14ba499f
- sha1
- f436c7f5a4dd2a431b592221cb76f2255ca6dc34
- sha256
- 7915d2c7856baaadbeed71e8ef33fae82d892f144ba770ea02d4eca0e63780e3
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
<?php
/**
* @package Joomla.Administrator
* @subpackage com_contenthistory
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Session\Session;
Session::checkToken('get') or die(Text::_('JINVALID_TOKEN'));
$version2 = $this->items[0];
$version1 = $this->items[1];
$object1 = $version1->data;
$object2 = $version2->data;
HTMLHelper::_('script', 'vendor/diff/diff.min.js', array('version' => 'auto', 'relative' => true));
HTMLHelper::_('script', 'com_contenthistory/admin-compare-compare.min.js', array('version' => 'auto', 'relative' => true));
?>
<fieldset>
<h2 class="mb-3"><?php echo Text::sprintf('COM_CONTENTHISTORY_COMPARE_TITLE'); ?></h2>
<table id="diff" class="table table-sm">
<thead>
<tr>
<th style="width:25%"><?php echo Text::_('COM_CONTENTHISTORY_PREVIEW_FIELD'); ?></th>
<th><?php echo Text::_('COM_CONTENTHISTORY_COMPARE_OLD'); ?></th>
<th><?php echo Text::_('COM_CONTENTHISTORY_COMPARE_NEW'); ?></th>
<th><?php echo Text::_('COM_CONTENTHISTORY_COMPARE_DIFF'); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($object1 as $name => $value) : ?>
<?php if ($value->value != $object2->$name->value) : ?>
<tr>
<?php if (is_object($value->value)) : ?>
<td>
<strong><?php echo $value->label; ?></strong>
</td>
<td> </td>
<td> </td>
<td> </td>
<?php foreach ($value->value as $subName => $subValue) : ?>
<?php $newSubValue = $object2->$name->value->$subName->value ?? ''; ?>
<?php if ($subValue->value || $newSubValue) : ?>
<?php if ($subValue->value != $newSubValue) : ?>
<tr>
<td><em> <?php echo $subValue->label; ?></em></td>
<td class="original"><?php echo htmlspecialchars($subValue->value, ENT_COMPAT, 'UTF-8'); ?></td>
<td class="changed" ><?php echo htmlspecialchars($newSubValue, ENT_COMPAT, 'UTF-8'); ?></td>
<td class="diff"> </td>
</tr>
<?php endif; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php else : ?>
<td>
<strong><?php echo $value->label; ?></strong>
</td>
<td class="original"><?php echo htmlspecialchars($value->value); ?></td>
<?php $object2->$name->value = is_object($object2->$name->value) ? json_encode($object2->$name->value) : $object2->$name->value; ?>
<td class="changed"><?php echo htmlspecialchars($object2->$name->value, ENT_COMPAT, 'UTF-8'); ?></td>
<td class="diff"> </td>
<?php endif; ?>
</tr>
<?php endif; ?>
<?php endforeach; ?>
</tbody>
</table>
</fieldset>
The same content is in 4 releases, Joomla 4.0.0-alpha7 to 4.0.0-alpha10. See them all, or every version of this file.