* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Jfcherng\Diff\DiffHelper;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
HTMLHelper::_('behavior.multiselect', 'updateForm');
HTMLHelper::_('bootstrap.modal');
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$input = Factory::getApplication()->getInput();
// Enable assets
$wa->useScript('form.validate')
->useScript('keepalive')
->useScript('com_templates.admin-template-toggle-switch')
->useScript('com_templates.admin-templates')
->useStyle('com_templates.admin-templates');
// No access if not global SuperUser
if (!$this->getCurrentUser()->authorise('core.admin')) {
Factory::getApplication()->enqueueMessage(Text::_('JERROR_ALERTNOAUTHOR'), 'danger');
}
if ($this->type == 'image') {
$wa->usePreset('cropperjs');
}
if ($this->type == 'font') {
$wa->addInlineStyle("
@font-face {
font-family: previewFont;
src: url('" . $this->font['address'] . "')
}
.font-preview {
font-family: previewFont !important;
}
");
}
?>
'editor', 'recall' => true, 'breakpoint' => 768]); ?>
type != 'home') : ?>
get('isMedia', 0) ? '/media/templates/' . ($this->template->client_id === 0 ? 'site' : 'administrator') . '/' . $this->template->element . str_replace('//', '/', base64_decode($this->file)) : '/' . ($this->template->client_id === 0 ? '' : 'administrator/') . 'templates/' . $this->template->element . str_replace('//', '/', base64_decode($this->file))), $this->template->element); ?>
source->filename; ?>
type == 'file' && !empty($this->source->coreFile)) : ?>
form->renderField('show_core'); ?>
form->renderField('show_diff'); ?>
type == 'home') : ?>
type == 'file') : ?>
source->filename); ?>
source->coreFile)) : ?>
source->coreFile)) : ?>
form->getInput('core'); ?>
source->coreFile,
$this->source->filePath,
ComponentHelper::getParams('com_templates')->get('difference', 'SideBySide'),
[
'context' => 1,
'ignoreLineEnding' => true,
],
[
'language' => [
'old_version' => Text::_('COM_TEMPLATES_DIFF_CORE'),
'new_version' => Text::_('COM_TEMPLATES_DIFF_OVERRIDE'),
'differences' => Text::_('COM_TEMPLATES_DIFF_DIFFERENCES'),
],
'resultForIdenticals' => Text::_('COM_TEMPLATES_DIFF_IDENTICAL'),
'detailLevel' => 'word',
'spaceToHtmlTag' => true,
'wrapperClasses' => ['diff-wrapper', 'columns-order-ignore'],
]
);
?>
type == 'archive') : ?>
type == 'image') : ?>
escape(basename($this->image['address'])); ?>
type == 'font') : ?>
overridesList['modules'] as $module) : ?>
path
. '&id=' . $input->getInt('id') . '&file=' . $this->file . '&isMedia=' . $input->get('isMedia', 0) . '&' . $token;
?>
name; ?>
overridesList['components'] as $key => $value) : ?>
path
. '&id=' . $input->getInt('id') . '&file=' . $this->file . '&isMedia=' . $input->get('isMedia', 0) . '&' . $token;
?>
name; ?>
overridesList['plugins'] as $key => $group) : ?>
path
. '&id=' . $input->getInt('id') . '&file=' . $this->file . '&isMedia=' . $input->get('isMedia', 0) . '&' . $token;
?>
name; ?>
overridesList['layouts'] as $key => $value) : ?>
path
. '&id=' . $input->getInt('id') . '&file=' . $this->file . '&' . $token . '&isMedia=' . $input->get('isMedia', 0);
?>
name; ?>
pluginState) : ?>
loadTemplate('updated_files'); ?>
loadTemplate('description'); ?>
template->xmldata->inheritable) && (string) $this->template->xmldata->inheritable === '1' ? 'child' : 'copy';
$copyModalData = [
'selector' => $taskName . 'Modal',
'params' => [
'title' => Text::_('COM_TEMPLATES_TEMPLATE_' . strtoupper($taskName)),
'footer' => $this->loadTemplate('modal_' . $taskName . '_footer')
],
'body' => $this->loadTemplate('modal_' . $taskName . '_body')
];
?>
type != 'home') : ?>
'renameModal',
'params' => [
'title' => Text::sprintf('COM_TEMPLATES_RENAME_FILE', str_replace('//', '/', $this->fileName)),
'footer' => $this->loadTemplate('modal_rename_footer')
],
'body' => $this->loadTemplate('modal_rename_body')
];
?>
type != 'home') : ?>
'deleteModal',
'params' => [
'title' => Text::_('COM_TEMPLATES_ARE_YOU_SURE'),
'footer' => $this->loadTemplate('modal_delete_footer')
],
'body' => $this->loadTemplate('modal_delete_body')
];
?>
'fileModal',
'params' => [
'title' => Text::_('COM_TEMPLATES_NEW_FILE_HEADER'),
'footer' => $this->loadTemplate('modal_file_footer'),
'height' => '400px',
'width' => '800px',
'bodyHeight' => 70,
'modalWidth' => 80,
],
'body' => $this->loadTemplate('modal_file_body')
];
?>
'folderModal',
'params' => [
'title' => Text::_('COM_TEMPLATES_MANAGE_FOLDERS'),
'footer' => $this->loadTemplate('modal_folder_footer'),
'height' => '400px',
'width' => '800px',
'bodyHeight' => 70,
'modalWidth' => 80,
],
'body' => $this->loadTemplate('modal_folder_body')
];
?>
type == 'image') : ?>
'resizeModal',
'params' => [
'title' => Text::_('COM_TEMPLATES_RESIZE_IMAGE'),
'footer' => $this->loadTemplate('modal_resize_footer')
],
'body' => $this->loadTemplate('modal_resize_body')
];
?>