CoreFiles by mySites.guru
preview.php80 lines, 3,202 bytes, from Joomla_6.2.1-Stable-Full_Package.zip
Raw History Compare with 6.2.0
md5
52a8991f11ba1e15e369039925dd4afc
sha1
b589cee3143999b3fc062516d63a5a667eed3244
sha256
bbc40a1ebad6583ecf8e634507a27246db8734d0066d782e39d0c43f6ae1995e
<?php

/**
 * @package     Joomla.Administrator
 * @subpackage  com_contenthistory
 *
 * @copyright   (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\CMS\Language\Text;
use Joomla\CMS\Session\Session;

/** @var \Joomla\Component\Contenthistory\Administrator\View\Preview\HtmlView $this */

Session::checkToken('get') or die(Text::_('JINVALID_TOKEN'));

?>
<div role="main">
    <h1>
        <?php echo Text::sprintf('COM_CONTENTHISTORY_PREVIEW_SUBTITLE_DATE', $this->item->save_date); ?>
    </h1>
    <?php if ($this->item->version_note) : ?>
        <h2>
            <?php echo Text::sprintf('COM_CONTENTHISTORY_PREVIEW_SUBTITLE', $this->escape($this->item->version_note)); ?>
        </h2>
    <?php endif; ?>

    <table class="table">
        <caption class="visually-hidden">
            <?php echo Text::_('COM_CONTENTHISTORY_PREVIEW_CAPTION'); ?>
        </caption>
        <thead>
            <tr>
                <th class="w-25" scope="col"><?php echo Text::_('COM_CONTENTHISTORY_PREVIEW_FIELD'); ?></th>
                <th scope="col"><?php echo Text::_('COM_CONTENTHISTORY_PREVIEW_VALUE'); ?></th>
            </tr>
        </thead>
        <tbody>
        <?php foreach ($this->item->data as $name => $value) : ?>
            <?php if (is_object($value->value)) : ?>
                <tr>
                    <td colspan="2">
                        <?php echo $this->escape($value->label); ?>
                    </td>
                </tr>
                <?php foreach ($value->value as $subName => $subValue) : ?>
                    <?php if ($subValue && isset($subValue->value)) : ?>
                        <?php $subValue->value = (\is_object($subValue->value) || \is_array($subValue->value)) ? \json_encode($subValue->value, \JSON_UNESCAPED_UNICODE) : $subValue->value; ?>
                        <tr>
                            <th scope="row"><em>&nbsp;&nbsp;<?php echo $this->escape($subValue->label); ?></em></th>
                            <td>
                                <?php if (\is_array($subValue->value)) : ?>
                                    <?php echo $this->escape(json_decode($subValue->value)); ?>
                                <?php else : ?>
                                    <?php echo $this->escape($subValue->value); ?>
                                <?php endif; ?>
                            </td>
                        </tr>
                    <?php endif; ?>

                <?php endforeach; ?>
            <?php else : ?>
                <tr>
                    <th scope="row"><?php echo $this->escape($value->label); ?></th>
                    <td>
                        <?php if (\is_array($value->value)) : ?>
                            <?php echo $this->escape(json_encode($value->value)); ?>
                        <?php else : ?>
                            <?php echo $this->escape($value->value); ?>
                        <?php endif; ?>
                    </td>
                </tr>
            <?php endif; ?>
        <?php endforeach; ?>
        </tbody>
    </table>
</div>

The same content is in 2 releases, Joomla 6.2.1 to 6.3.0-alpha1. See them all, or every version of this file.