first commit

This commit is contained in:
2025-06-17 11:53:18 +02:00
commit 9f0f7ba12b
8804 changed files with 1369176 additions and 0 deletions

View File

@ -0,0 +1,475 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright (C) 2008 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 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;
}
");
}
?>
<div class="main-card">
<?php echo HTMLHelper::_('uitab.startTabSet', 'myTab', ['active' => 'editor', 'recall' => true, 'breakpoint' => 768]); ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'editor', Text::_('COM_TEMPLATES_TAB_EDITOR')); ?>
<div class="row mt-2">
<div class="col-md-8" id="conditional-section">
<?php if ($this->type != 'home') : ?>
<p class="lead"><?php echo Text::sprintf('COM_TEMPLATES_TEMPLATE_FILENAME', '&#x200E;' . ($input->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); ?></p>
<p class="lead path hidden"><?php echo $this->source->filename; ?></p>
<?php endif; ?>
</div>
<?php if ($this->type == 'file' && !empty($this->source->coreFile)) : ?>
<div class="col-md-4 text-end">
<div id="toggle-buttons">
<?php echo $this->form->renderField('show_core'); ?>
<?php echo $this->form->renderField('show_diff'); ?>
</div>
</div>
<?php endif; ?>
</div>
<div class="row mt-2">
<div id="treeholder" class="col-md-3 tree-holder">
<div class="mt-2 mb-2">
<ul class="directory-tree treeselect">
<li class="folder-select">
<a class="folder-url" data-id="" href="">
<span class="icon-folder icon-fw" aria-hidden="true"></span>
<?php echo ($this->template->client_id === 0 ? '/' : '/administrator/') . 'templates/' . $this->template->element; ?>
</a>
<?php echo $this->loadTemplate('tree'); ?>
</li>
</ul>
<?php if (count($this->mediaFiles)) : ?>
<ul class="directory-tree treeselect">
<li class="folder-select">
<a class="folder-url" data-id="" href="">
<span class="icon-folder icon-fw" aria-hidden="true"></span>
<?php echo '/media/templates/' . ($this->template->client_id === 0 ? 'site/' : 'administrator/') . $this->template->element; ?>
</a>
<?php echo $this->loadTemplate('tree_media'); ?>
</li>
</ul>
<?php endif; ?>
</div>
</div>
<div class="col-md-9">
<fieldset class="options-form">
<?php if ($this->type == 'home') : ?>
<legend><?php echo Text::_('COM_TEMPLATES_HOME_HEADING'); ?></legend>
<form action="<?php echo Route::_('index.php?option=com_templates&view=template&id=' . $input->getInt('id') . '&file=' . $this->file . '&isMedia=' . $input->get('isMedia', 0)); ?>" method="post" name="adminForm" id="adminForm">
<input type="hidden" name="task" value="">
<?php echo HTMLHelper::_('form.token'); ?>
<p><?php echo Text::_('COM_TEMPLATES_HOME_TEXT'); ?></p>
<p>
<a href="https://docs.joomla.org/Special:MyLanguage/J4.x:Template_Overrides" target="_blank" rel="noopener" class="btn btn-primary btn-lg">
<?php echo Text::_('COM_TEMPLATES_HOME_BUTTON'); ?>
</a>
</p>
</form>
<?php elseif ($this->type == 'file') : ?>
<div class="row">
<div class="col-md-12" id="override-pane">
<?php $overrideCheck = explode(DIRECTORY_SEPARATOR, $this->source->filename); ?>
<?php if (!empty($this->source->coreFile)) : ?>
<h2><?php echo Text::_('COM_TEMPLATES_FILE_OVERRIDE_PANE'); ?></h2>
<?php endif; ?>
<form action="<?php echo Route::_('index.php?option=com_templates&view=template&id=' . $input->getInt('id') . '&file=' . $this->file . '&isMedia=' . $input->get('isMedia', 0)); ?>" method="post" name="adminForm" id="adminForm">
<input type="hidden" name="isMedia" value="<?php echo $input->get('isMedia', 0); ?>">
<div class="editor-border">
<?php echo $this->form->getInput('source'); ?>
</div>
<input type="hidden" name="task" value="" />
<?php echo HTMLHelper::_('form.token'); ?>
<?php echo $this->form->getInput('extension_id'); ?>
<?php echo $this->form->getInput('filename'); ?>
</form>
</div>
<?php if (!empty($this->source->coreFile)) : ?>
<div class="col-md-12" id="core-pane">
<h2><?php echo Text::_('COM_TEMPLATES_FILE_CORE_PANE'); ?></h2>
<div class="editor-border">
<?php echo $this->form->getInput('core'); ?>
</div>
</div>
<?php
$difference = DiffHelper::calculateFiles(
$this->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'],
]
);
?>
<div class="col-md-12" id="diff-main">
<h2><?php echo Text::_('COM_TEMPLATES_FILE_COMPARE_PANE'); ?></h2>
<div class="diff-pane">
<div id="diff"><?php echo $difference; ?></div>
</div>
</div>
<?php endif; ?>
</div>
<?php elseif ($this->type == 'archive') : ?>
<legend><?php echo Text::_('COM_TEMPLATES_FILE_CONTENT_PREVIEW'); ?></legend>
<form action="<?php echo Route::_('index.php?option=com_templates&view=template&id=' . $input->getInt('id') . '&file=' . $this->file . '&isMedia=' . $input->get('isMedia', 0)); ?>" method="post" name="adminForm" id="adminForm">
<ul class="nav flex-column well">
<?php foreach ($this->archive as $file) : ?>
<li>
<?php if (substr($file, -1) === DIRECTORY_SEPARATOR) : ?>
<span class="icon-folder icon-fw" aria-hidden="true"></span>&nbsp;<?php echo $file; ?>
<?php endif; ?>
<?php if (substr($file, -1) != DIRECTORY_SEPARATOR) : ?>
<span class="icon-file icon-fw" aria-hidden="true"></span>&nbsp;<?php echo $file; ?>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
<input type="hidden" name="task" value="">
<?php echo HTMLHelper::_('form.token'); ?>
</form>
<?php elseif ($this->type == 'image') : ?>
<legend><?php echo $this->escape(basename($this->image['address'])); ?></legend>
<img id="image-crop" src="<?php echo $this->image['address'] . '?' . time(); ?>" style="max-width: 100%">
<form action="<?php echo Route::_('index.php?option=com_templates&view=template&id=' . $input->getInt('id') . '&file=' . $this->file . '&isMedia=' . $input->get('isMedia', 0)); ?>" method="post" name="adminForm" id="adminForm">
<fieldset class="adminform">
<input type="hidden" id="x" name="x">
<input type="hidden" id="y" name="y">
<input type="hidden" id="h" name="h">
<input type="hidden" id="w" name="w">
<input type="hidden" id="imageWidth" value="<?php echo $this->image['width']; ?>">
<input type="hidden" id="imageHeight" value="<?php echo $this->image['height']; ?>">
<input type="hidden" name="task" value="">
<?php echo HTMLHelper::_('form.token'); ?>
</fieldset>
</form>
<?php elseif ($this->type == 'font') : ?>
<div class="font-preview">
<form action="<?php echo Route::_('index.php?option=com_templates&view=template&id=' . $input->getInt('id') . '&file=' . $this->file . '&isMedia=' . $input->get('isMedia', 0)); ?>" method="post" name="adminForm" id="adminForm">
<fieldset class="adminform">
<h1>H1. Quickly gaze at Joomla! views from HTML, CSS, JavaScript and XML</h1>
<h2>H2. Quickly gaze at Joomla! views from HTML, CSS, JavaScript and XML</h2>
<h3>H3. Quickly gaze at Joomla! views from HTML, CSS, JavaScript and XML</h3>
<h4>H4. Quickly gaze at Joomla! views from HTML, CSS, JavaScript and XML</h4>
<h5>H5. Quickly gaze at Joomla! views from HTML, CSS, JavaScript and XML</h5>
<h6>H6. Quickly gaze at Joomla! views from HTML, CSS, JavaScript and XML</h6>
<p><strong>Bold. Quickly gaze at Joomla! views from HTML, CSS, JavaScript and XML</strong></p>
<p><em>Italics. Quickly gaze at Joomla! views from HTML, CSS, JavaScript and XML</em></p>
<p>Unordered List</p>
<ul>
<li>Item</li>
<li>Item</li>
<li>Item<br>
<ul>
<li>Item</li>
<li>Item</li>
<li>Item<br>
<ul>
<li>Item</li>
<li>Item</li>
<li>Item</li>
</ul>
</li>
</ul>
</li>
</ul>
<p class="lead">Ordered List</p>
<ol>
<li>Item</li>
<li>Item</li>
<li>Item<br>
<ul>
<li>Item</li>
<li>Item</li>
<li>Item<br>
<ul>
<li>Item</li>
<li>Item</li>
<li>Item</li>
</ul>
</li>
</ul>
</li>
</ol>
<input type="hidden" name="task" value="">
<?php echo HTMLHelper::_('form.token'); ?>
</fieldset>
</form>
</div>
<?php endif; ?>
</fieldset>
</div>
</div>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'overrides', Text::_('COM_TEMPLATES_TAB_OVERRIDES')); ?>
<div class="row mt-2">
<div class="col-md-3">
<fieldset class="options-form">
<legend><?php echo Text::_('COM_TEMPLATES_OVERRIDES_MODULES'); ?></legend>
<ul class="list-unstyled">
<?php $token = Session::getFormToken() . '=' . 1; ?>
<?php foreach ($this->overridesList['modules'] as $module) : ?>
<li>
<?php
$overrideLinkUrl = 'index.php?option=com_templates&view=template&task=template.overrides&folder=' . $module->path
. '&id=' . $input->getInt('id') . '&file=' . $this->file . '&isMedia=' . $input->get('isMedia', 0) . '&' . $token;
?>
<a href="<?php echo Route::_($overrideLinkUrl); ?>">
<span class="icon-copy" aria-hidden="true"></span>&nbsp;<?php echo $module->name; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</fieldset>
</div>
<div class="col-md-3">
<fieldset class="options-form">
<legend><?php echo Text::_('COM_TEMPLATES_OVERRIDES_COMPONENTS'); ?></legend>
<ul class="list-unstyled">
<?php $token = Session::getFormToken() . '=' . 1; ?>
<?php foreach ($this->overridesList['components'] as $key => $value) : ?>
<li class="component-folder">
<a href="#" class="component-folder-url">
<span class="icon-folder icon-fw" aria-hidden="true"></span>&nbsp;<?php echo $key; ?>
</a>
<ul class="list-unstyled">
<?php foreach ($value as $view) : ?>
<li>
<?php
$overrideLinkUrl = 'index.php?option=com_templates&view=template&task=template.overrides&folder=' . $view->path
. '&id=' . $input->getInt('id') . '&file=' . $this->file . '&isMedia=' . $input->get('isMedia', 0) . '&' . $token;
?>
<a class="component-file-url" href="<?php echo Route::_($overrideLinkUrl); ?>">
<span class="icon-copy" aria-hidden="true"></span>&nbsp;<?php echo $view->name; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</li>
<?php endforeach; ?>
</ul>
</fieldset>
</div>
<div class="col-md-3">
<fieldset class="options-form">
<legend><?php echo Text::_('COM_TEMPLATES_OVERRIDES_PLUGINS'); ?></legend>
<ul class="list-unstyled">
<?php $token = Session::getFormToken() . '=' . 1; ?>
<?php foreach ($this->overridesList['plugins'] as $key => $group) : ?>
<li class="plugin-folder">
<a href="#" class="plugin-folder-url">
<span class="icon-folder icon-fw" aria-hidden="true"></span>&nbsp;<?php echo $key; ?>
</a>
<ul class="list-unstyled">
<?php foreach ($group as $plugin) : ?>
<li>
<?php
$overrideLinkUrl = 'index.php?option=com_templates&view=template&task=template.overrides&folder=' . $plugin->path
. '&id=' . $input->getInt('id') . '&file=' . $this->file . '&isMedia=' . $input->get('isMedia', 0) . '&' . $token;
?>
<a class="plugin-file-url" href="<?php echo Route::_($overrideLinkUrl); ?>">
<span class="icon-copy" aria-hidden="true"></span> <?php echo $plugin->name; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</li>
<?php endforeach; ?>
</ul>
</fieldset>
</div>
<div class="col-md-3">
<fieldset class="options-form">
<legend><?php echo Text::_('COM_TEMPLATES_OVERRIDES_LAYOUTS'); ?></legend>
<ul class="list-unstyled">
<?php $token = Session::getFormToken() . '=' . 1; ?>
<?php foreach ($this->overridesList['layouts'] as $key => $value) : ?>
<li class="layout-folder">
<a href="#" class="layout-folder-url">
<span class="icon-folder icon-fw" aria-hidden="true"></span>&nbsp;<?php echo $key; ?>
</a>
<ul class="list-unstyled">
<?php foreach ($value as $layout) : ?>
<li>
<?php
$overrideLinkUrl = 'index.php?option=com_templates&view=template&task=template.overrides&folder=' . $layout->path
. '&id=' . $input->getInt('id') . '&file=' . $this->file . '&' . $token . '&isMedia=' . $input->get('isMedia', 0);
?>
<a href="<?php echo Route::_($overrideLinkUrl); ?>">
<span class="icon-copy" aria-hidden="true"></span>&nbsp;<?php echo $layout->name; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</li>
<?php endforeach; ?>
</ul>
</fieldset>
</div>
</div>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php if ($this->pluginState) : ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'files', Text::_('COM_TEMPLATES_TAB_UPDATED_FILES')); ?>
<?php echo $this->loadTemplate('updated_files'); ?>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php endif; ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'description', Text::_('COM_TEMPLATES_TAB_DESCRIPTION')); ?>
<div class="row mt-2">
<div class="col-12">
<?php echo $this->loadTemplate('description'); ?>
</div>
</div>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php echo HTMLHelper::_('uitab.endTabSet'); ?>
<?php // Collapse Modal
$taskName = isset($this->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')
];
?>
<form action="<?php echo Route::_('index.php?option=com_templates&task=template.' . $taskName . '&id=' . $input->getInt('id') . '&file=' . $this->file); ?>" method="post">
<?php echo LayoutHelper::render('libraries.html.bootstrap.modal.main', $copyModalData); ?>
<?php echo HTMLHelper::_('form.token'); ?>
</form>
<?php if ($this->type != 'home') : ?>
<?php // Rename Modal
$renameModalData = [
'selector' => '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')
];
?>
<form action="<?php echo Route::_('index.php?option=com_templates&task=template.renameFile&id=' . $input->getInt('id') . '&file=' . $this->file . '&isMedia=' . $input->get('isMedia', 0)); ?>" method="post">
<?php echo LayoutHelper::render('libraries.html.bootstrap.modal.main', $renameModalData); ?>
<?php echo HTMLHelper::_('form.token'); ?>
</form>
<?php endif; ?>
<?php if ($this->type != 'home') : ?>
<?php // Delete Modal
$deleteModalData = [
'selector' => 'deleteModal',
'params' => [
'title' => Text::_('COM_TEMPLATES_ARE_YOU_SURE'),
'footer' => $this->loadTemplate('modal_delete_footer')
],
'body' => $this->loadTemplate('modal_delete_body')
];
?>
<?php echo LayoutHelper::render('libraries.html.bootstrap.modal.main', $deleteModalData); ?>
<?php endif; ?>
<?php // File Modal
$fileModalData = [
'selector' => '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')
];
?>
<?php echo LayoutHelper::render('libraries.html.bootstrap.modal.main', $fileModalData); ?>
<?php // Folder Modal
$folderModalData = [
'selector' => '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')
];
?>
<?php echo LayoutHelper::render('libraries.html.bootstrap.modal.main', $folderModalData); ?>
<?php if ($this->type == 'image') : ?>
<?php // Resize Modal
$resizeModalData = [
'selector' => 'resizeModal',
'params' => [
'title' => Text::_('COM_TEMPLATES_RESIZE_IMAGE'),
'footer' => $this->loadTemplate('modal_resize_footer')
],
'body' => $this->loadTemplate('modal_resize_body')
];
?>
<form action="<?php echo Route::_('index.php?option=com_templates&task=template.resizeImage&id=' . $input->getInt('id') . '&file=' . $this->file . '&isMedia=' . $input->get('isMedia', 0)); ?>" method="post">
<?php echo LayoutHelper::render('libraries.html.bootstrap.modal.main', $resizeModalData); ?>
<?php echo HTMLHelper::_('form.token'); ?>
</form>
<?php endif; ?>
</div>

View File

@ -0,0 +1,29 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @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\Application\ApplicationHelper;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\Component\Templates\Administrator\Helper\TemplatesHelper;
?>
<div class="clearfix">
<div class="float-start me-3 text-center">
<?php echo HTMLHelper::_('templates.thumb', $this->template); ?>
<?php echo HTMLHelper::_('templates.thumbModal', $this->template); ?>
</div>
<h2><?php echo ucfirst($this->template->element); ?></h2>
<?php $client = ApplicationHelper::getClientInfo($this->template->client_id); ?>
<p><?php $this->template->xmldata = TemplatesHelper::parseXMLTemplateFile($client->path, $this->template->element); ?></p>
<p><?php echo Text::_($this->template->xmldata->get('description')); ?></p>
</div>

View File

@ -0,0 +1,29 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @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;
ksort($this->files, SORT_STRING);
?>
<ul class="directory-tree treeselect">
<?php foreach ($this->files as $key => $value) : ?>
<?php if (is_array($value)) : ?>
<li class="folder-select">
<a class="folder-url" data-id="<?php echo base64_encode($key); ?>" href="" data-base="template">
<span class="icon-folder icon-fw" aria-hidden="true"></span>
<?php $explodeArray = explode('/', rtrim($key, '\\'));
echo $this->escape(end($explodeArray)); ?>
</a>
<?php echo $this->folderTree($value); ?>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>

View File

@ -0,0 +1,33 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
// Legacy is the default
if (!count($this->mediaFiles)) {
return;
}
ksort($this->mediaFiles, SORT_STRING);
?>
<ul class="directory-tree treeselect">
<?php foreach ($this->mediaFiles as $key => $value) : ?>
<?php if (is_array($value)) : ?>
<li class="folder-select">
<a class="folder-url" data-id="<?php echo base64_encode($key); ?>" href="" data-base="media">
<span class="icon-folder icon-fw" aria-hidden="true"></span>
<?php $explodeArray = explode('/', rtrim($key, '\\'));
echo $this->escape(end($explodeArray)); ?>
</a>
<?php echo $this->mediaFolderTree($value); ?>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>

View File

@ -0,0 +1,89 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright (C) 2021 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\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
Factory::getDocument()->getWebAssetManager()->usePreset('choicesjs');
// Generate a list of styles for the child creation modal
$options = [];
if (count($this->styles) > 0) {
foreach ($this->styles as $style) {
$options[] = HTMLHelper::_('select.option', $style->id, $style->title, 'value', 'text');
}
}
$fancySelectData = [
'autocomplete' => 'off',
'autofocus' => false,
'class' => '',
'description' => '',
'disabled' => false,
'group' => false,
'id' => 'style_ids',
'hidden' => false,
'hint' => '',
'label' => '',
'labelclass' => '',
'onchange' => '',
'onclick' => '',
'multiple' => true,
'pattern' => '',
'readonly' => false,
'repeat' => false,
'required' => false,
'size' => 4,
'spellcheck' => false,
'validate' => '',
'value' => '0',
'options' => $options,
'dataAttributes' => [],
'dataAttribute' => '',
'name' => 'style_ids[]',
];
?>
<div id="template-manager-copy" class="container-fluid">
<div class="mt-2">
<div class="col-md-12">
<div class="control-group">
<div class="control-label">
<label for="new_name">
<?php echo Text::_('COM_TEMPLATES_TEMPLATE_CHILD_NAME_LABEL'); ?>
</label>
</div>
<div class="controls">
<input class="form-control" type="text" id="new_name" name="new_name" required>
<small class="form-text">
<?php echo Text::_('COM_TEMPLATES_TEMPLATE_NEW_NAME_DESC'); ?>
</small>
</div>
</div>
<div class="control-group">
<div class="control-label">
<label for="style_ids">
<?php echo Text::_('COM_TEMPLATES_TEMPLATE_CHILD_STYLE_LABEL'); ?>
</label>
</div>
<div class="controls">
<?php echo LayoutHelper::render('joomla.form.field.list-fancy-select', $fancySelectData); ?>
<small class="form-text">
<?php echo Text::_('COM_TEMPLATES_TEMPLATE_NEW_STYLE_DESC'); ?>
</small>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,17 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright (C) 2021 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;
?>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><?php echo Text::_('COM_TEMPLATES_TEMPLATE_CLOSE'); ?></button>
<button type="submit" class="btn btn-primary"><?php echo Text::_('COM_TEMPLATES_BUTTON_TEMPLATE_CHILD'); ?></button>

View File

@ -0,0 +1,34 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright (C) 2016 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;
?>
<div id="template-manager-copy" class="container-fluid">
<div class="mt-2">
<div class="col-md-12">
<div class="control-group">
<div class="control-label">
<label for="new_name">
<?php echo Text::_('COM_TEMPLATES_TEMPLATE_NEW_NAME_LABEL'); ?>
</label>
</div>
<div class="controls">
<input class="form-control" type="text" id="new_name" name="new_name" required>
<small class="form-text">
<?php echo Text::_('COM_TEMPLATES_TEMPLATE_NEW_NAME_DESC'); ?>
</small>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,17 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright (C) 2016 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;
?>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><?php echo Text::_('COM_TEMPLATES_TEMPLATE_CLOSE'); ?></button>
<button type="submit" class="btn btn-primary"><?php echo Text::_('COM_TEMPLATES_TEMPLATE_COPY'); ?></button>

View File

@ -0,0 +1,22 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright (C) 2016 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;
?>
<div id="template-manager-delete" class="container-fluid">
<div class="mt-2">
<div class="col-md-12">
<p><?php echo Text::sprintf('COM_TEMPLATES_MODAL_FILE_DELETE', str_replace('//', '/', $this->fileName)); ?></p>
</div>
</div>
</div>

View File

@ -0,0 +1,27 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright (C) 2016 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\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
$input = Factory::getApplication()->getInput();
?>
<form method="post" action="">
<input type="hidden" name="option" value="com_templates">
<input type="hidden" name="task" value="template.delete">
<input type="hidden" name="id" value="<?php echo $input->getInt('id'); ?>">
<input type="hidden" name="file" value="<?php echo $this->file; ?>">
<?php echo HTMLHelper::_('form.token'); ?>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><?php echo Text::_('COM_TEMPLATES_TEMPLATE_CLOSE'); ?></button>
<button type="submit" class="btn btn-danger"><?php echo Text::_('COM_TEMPLATES_BUTTON_DELETE'); ?></button>
</form>

View File

@ -0,0 +1,105 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright (C) 2016 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\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Utility\Utility;
$input = Factory::getApplication()->getInput();
?>
<div id="#template-manager-file" class="container-fluid">
<div class="mt-2 p-2">
<div class="row">
<div class="col-md-4">
<div class="tree-holder">
<ul class="directory-tree treeselect root">
<li class="folder-select">
<a class="folder-url" data-id="" href="" data-base="template">
<span class="icon-folder icon-fw" aria-hidden="true"></span>
<?php echo ($this->template->client_id === 0 ? '/' : '/administrator/') . 'templates/' . $this->template->element; ?>
</a>
<?php echo $this->loadTemplate('folders'); ?>
</li>
</ul>
<?php if (count($this->mediaFiles)) : ?>
<ul class="directory-tree treeselect">
<li class="folder-select">
<a class="folder-url" data-id="" href="" data-base="media">
<span class="icon-folder icon-fw" aria-hidden="true"></span>
<?php echo '/media/templates/' . ($this->template->client_id === 0 ? 'site/' : 'administrator/') . $this->template->element; ?>
</a>
<?php echo $this->loadTemplate('media_folders'); ?>
</li>
</ul>
<?php endif; ?>
</div>
</div>
<div class="col-md-8">
<form method="post" action="<?php echo Route::_('index.php?option=com_templates&task=template.createFile&id=' . $input->getInt('id') . '&file=' . $this->file); ?>" class="mb-4">
<div class="form-group">
<label for="file_name"><?php echo Text::_('COM_TEMPLATES_FILE_NAME'); ?></label>
<input type="text" name="name" id="file_name" class="form-control" required>
</div>
<div class="form-group">
<label for="type"><?php echo Text::_('COM_TEMPLATES_NEW_FILE_TYPE'); ?></label>
<select class="form-select" data-chosen="true" name="type" id="type" required>
<option value="">- <?php echo Text::_('COM_TEMPLATES_NEW_FILE_SELECT'); ?> -</option>
<option value="css">.css</option>
<option value="php">.php</option>
<option value="js">.js</option>
<option value="xml">.xml</option>
<option value="ini">.ini</option>
<option value="less">.less</option>
<option value="sass">.sass</option>
<option value="scss">.scss</option>
<option value="txt">.txt</option>
</select>
</div>
<input type="hidden" class="address" name="address">
<input type="hidden" name="isMedia" value="0">
<?php echo HTMLHelper::_('form.token'); ?>
<button type="submit" class="btn btn-primary"><?php echo Text::_('COM_TEMPLATES_BUTTON_CREATE'); ?></button>
</form>
<hr class="mb-4">
<form method="post" action="<?php echo Route::_('index.php?option=com_templates&task=template.uploadFile&id=' . $input->getInt('id') . '&file=' . $this->file); ?>" enctype="multipart/form-data" class="mb-4">
<input type="hidden" class="address" name="address">
<input type="hidden" name="isMedia" value="0">
<div class="input-group">
<input type="file" name="files" aria-labelledby="upload" class="form-control" required>
<?php echo HTMLHelper::_('form.token'); ?>
<button type="submit" class="btn btn-primary" id="upload"><?php echo Text::_('COM_TEMPLATES_BUTTON_UPLOAD'); ?></button>
</div>
<?php $cMax = $this->state->get('params')->get('upload_limit'); ?>
<?php $maxSize = HTMLHelper::_('number.bytes', Utility::getMaxUploadSize($cMax . 'MB')); ?>
<span class="mt-2"><?php echo Text::sprintf('JGLOBAL_MAXIMUM_UPLOAD_SIZE_LIMIT', '&#x200E;' . $maxSize); ?></span>
</form>
<?php if ($this->type != 'home') : ?>
<hr class="mb-4">
<form method="post" action="<?php echo Route::_('index.php?option=com_templates&task=template.copyFile&id=' . $input->getInt('id') . '&file=' . $this->file); ?>" enctype="multipart/form-data" class="mb-4">
<div class="form-group">
<input type="hidden" class="address" name="address">
<input type="hidden" name="isMedia" value="0">
<label for="new_name">
<?php echo Text::_('COM_TEMPLATES_FILE_NEW_NAME_LABEL') ?>
</label>
<input class="form-control" type="text" id="new_name" name="new_name" required>
<?php echo HTMLHelper::_('form.token'); ?>
</div>
<button type="submit" class="btn btn-primary"><?php echo Text::_('COM_TEMPLATES_BUTTON_COPY_FILE'); ?></button>
</form>
<?php endif; ?>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,16 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright (C) 2016 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;
?>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><?php echo Text::_('COM_TEMPLATES_TEMPLATE_CLOSE'); ?></button>

View File

@ -0,0 +1,61 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright (C) 2016 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\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
$input = Factory::getApplication()->getInput();
?>
<div id="#template-manager-folder" class="container-fluid">
<div class="mt-2 p-2">
<div class="row">
<div class="col-md-4">
<div class="tree-holder">
<ul class="directory-tree treeselect root">
<li class="folder-select">
<a class="folder-url" data-id="" href="" data-base="template">
<span class="icon-folder icon-fw" aria-hidden="true"></span>
<?php echo ($this->template->client_id === 0 ? '/' : '/administrator/') . 'templates/' . $this->template->element; ?>
</a>
<?php echo $this->loadTemplate('folders'); ?>
</li>
</ul>
<?php if (count($this->mediaFiles)) : ?>
<ul class="directory-tree treeselect">
<li class="folder-select">
<a class="folder-url" data-id="" href="" data-base="media">
<span class="icon-folder icon-fw" aria-hidden="true"></span>
<?php echo '/media/templates/' . ($this->template->client_id === 0 ? 'site/' : 'administrator/') . $this->template->element; ?>
</a>
<?php echo $this->loadTemplate('media_folders'); ?>
</li>
</ul>
<?php endif; ?>
</div>
</div>
<div class="col-md-8">
<form method="post" action="<?php echo Route::_('index.php?option=com_templates&task=template.createFolder&id=' . $input->getInt('id') . '&file=' . $this->file); ?>">
<div class="form-group">
<label for="folder_name"><?php echo Text::_('COM_TEMPLATES_FOLDER_NAME'); ?></label>
<input type="text" name="name" id="folder_name" class="form-control" required>
<input type="hidden" class="address" name="address">
<input type="hidden" name="isMedia" value="0">
<?php echo HTMLHelper::_('form.token'); ?>
</div>
<button type="submit" class="btn btn-primary"><?php echo Text::_('COM_TEMPLATES_BUTTON_CREATE'); ?></button>
</form>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,28 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright (C) 2016 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\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
$input = Factory::getApplication()->getInput();
?>
<form id="deleteFolder" method="post" action="<?php echo Route::_('index.php?option=com_templates&task=template.deleteFolder&id=' . $input->getInt('id') . '&file=' . $this->file); ?>">
<fieldset>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><?php echo Text::_('COM_TEMPLATES_TEMPLATE_CLOSE'); ?></button>
<input type="hidden" class="address" name="address">
<input type="hidden" name="isMedia" value="0">
<?php echo HTMLHelper::_('form.token'); ?>
<button type="submit" class="btn btn-danger"><?php echo Text::_('COM_TEMPLATES_BUTTON_DELETE'); ?></button>
</fieldset>
</form>

View File

@ -0,0 +1,35 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright (C) 2016 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\Filesystem\File;
use Joomla\CMS\Language\Text;
?>
<div id="template-manager-rename" class="container-fluid">
<div class="mt-2">
<div class="col-md-12">
<div class="control-group">
<div class="control-label">
<label for="new_name">
<?php echo Text::_('COM_TEMPLATES_NEW_FILE_NAME')?>
</label>
</div>
<div class="controls">
<div class="input-group">
<input class="form-control" type="text" name="new_name" id="new_name" required>
<span class="input-group-text">.<?php echo File::getExt($this->fileName); ?></span>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,17 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright (C) 2016 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;
?>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><?php echo Text::_('COM_TEMPLATES_TEMPLATE_CLOSE'); ?></button>
<button type="submit" class="btn btn-primary"><?php echo Text::_('COM_TEMPLATES_BUTTON_RENAME'); ?></button>

View File

@ -0,0 +1,41 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright (C) 2016 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;
?>
<div id="template-manager-resize" class="container-fluid">
<div class="mt-2">
<div class="col-md-12">
<div class="control-group">
<div class="control-label">
<label for="height">
<?php echo Text::_('COM_TEMPLATES_IMAGE_HEIGHT')?>
</label>
</div>
<div class="controls">
<input class="form-control" type="number" name="height" id="height" placeholder="<?php echo $this->image['height']; ?> px" required>
</div>
</div>
<div class="control-group">
<div class="control-label">
<label for="width">
<?php echo Text::_('COM_TEMPLATES_IMAGE_WIDTH')?>
</label>
</div>
<div class="controls">
<input class="form-control" type="number" name="width" id="width" placeholder="<?php echo $this->image['width']; ?> px" required>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,17 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright (C) 2016 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;
?>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><?php echo Text::_('COM_TEMPLATES_TEMPLATE_CLOSE'); ?></button>
<button type="submit" class="btn btn-primary"><?php echo Text::_('COM_TEMPLATES_BUTTON_RESIZE'); ?></button>

View File

@ -0,0 +1,61 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @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\Router\Route;
ksort($this->files, SORT_NATURAL);
?>
<ul class="directory-tree treeselect">
<?php foreach ($this->files as $key => $value) : ?>
<?php if (is_array($value)) : ?>
<?php
$keyArray = explode('/', rtrim($key, '\\'));
$fileArray = explode('/', $this->fileName);
$count = 0;
$keyArrayCount = count($keyArray);
if (count($fileArray) >= $keyArrayCount) {
for ($i = 0; $i < $keyArrayCount; $i++) {
if ($keyArray[$i] === $fileArray[$i]) {
$count++;
}
}
if ($count === $keyArrayCount) {
$class = 'folder show';
} else {
$class = 'folder';
}
} else {
$class = 'folder';
}
?>
<li class="<?php echo $class; ?>">
<a class="folder-url" href="">
<span class="icon-folder icon-fw" aria-hidden="true"></span>&nbsp;<?php $explodeArray = explode('/', $key);
echo $this->escape(end($explodeArray)); ?>
</a>
<?php echo $this->directoryTree($value); ?>
</li>
<?php endif; ?>
<?php if (is_object($value)) : ?>
<li>
<a class="file" href='<?php echo Route::_('index.php?option=com_templates&view=template&id=' . $this->id . '&file=' . $value->id . '&isMedia=0'); ?>'>
<span class="icon-file-alt" aria-hidden="true"></span>&nbsp;<?php echo $this->escape($value->name); ?>
</a>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>

View File

@ -0,0 +1,66 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright (C) 2021 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\Router\Route;
// Legacy is the default
if (!count($this->mediaFiles)) {
return;
}
ksort($this->mediaFiles, SORT_STRING);
?>
<ul class="directory-tree treeselect">
<?php foreach ($this->mediaFiles as $key => $value) : ?>
<?php if (is_array($value)) : ?>
<?php
$keyArray = explode('/', rtrim($key, '\\'));
$fileArray = explode('/', $this->fileName);
$count = 0;
$keyArrayCount = count($keyArray);
if (count($fileArray) >= $keyArrayCount) {
for ($i = 0; $i < $keyArrayCount; $i++) {
if ($keyArray[$i] === $fileArray[$i]) {
$count++;
}
}
if ($count === $keyArrayCount) {
$class = 'folder show';
} else {
$class = 'folder';
}
} else {
$class = 'folder';
}
?>
<li class="<?php echo $class; ?>">
<a class="folder-url" href="">
<span class="icon-folder icon-fw" aria-hidden="true"></span>&nbsp;<?php $explodeArray = explode('/', $key);
echo $this->escape(end($explodeArray)); ?>
</a>
<?php echo $this->mediaTree($value); ?>
</li>
<?php endif; ?>
<?php if (is_object($value)) : ?>
<li>
<a class="file" href="<?php echo Route::_('index.php?option=com_templates&view=template&id=' . $this->id . '&file=' . $value->id . '&isMedia=1'); ?>">
<span class="icon-file-alt" aria-hidden="true"></span>&nbsp;<?php echo $this->escape($value->name); ?>
</a>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>

View File

@ -0,0 +1,102 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright (C) 2018 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\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
HTMLHelper::_('bootstrap.dropdown', '.dropdown-toggle');
/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('table.columns');
$input = Factory::getApplication()->getInput();
?>
<?php if (count($this->updatedList) === 0) : ?>
<div class="alert alert-success">
<span class="icon-check-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('NOTICE'); ?></span>
<?php echo Text::_('COM_TEMPLATES_OVERRIDE_UPTODATE'); ?>
</div>
<?php else : ?>
<div class="alert alert-info">
<span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
<?php echo Text::_('COM_TEMPLATES_OVERRIDE_NOT_UPTODATE'); ?>
</div>
<form action="<?php echo Route::_('index.php?option=com_templates&view=template&id=' . $input->getInt('id') . '&file=' . $this->file); ?>" method="post" name="updateForm" id="updateForm">
<div class="row mt-2">
<div class="col-md-12">
<table class="table">
<caption class="visually-hidden">
<?php echo Text::_('COM_TEMPLATES_OVERRIDE_UPDATED_FILES_CAPTION'); ?>
</caption>
<thead>
<tr>
<td class="w-5 text-center">
<?php echo HTMLHelper::_('grid.checkall'); ?>
</td>
<th scope="col" class="w-7">
<?php echo Text::_('COM_TEMPLATES_OVERRIDE_CHECKED'); ?>
</th>
<th scope="col" class="w-30">
<?php echo Text::_('COM_TEMPLATES_OVERRIDE_TEMPLATE_FILE'); ?>
</th>
<th scope="col">
<?php echo Text::_('COM_TEMPLATES_OVERRIDE_CREATED_DATE'); ?>
</th>
<th scope="col">
<?php echo Text::_('COM_TEMPLATES_OVERRIDE_MODIFIED_DATE'); ?>
</th>
<th scope="col">
<?php echo Text::_('COM_TEMPLATES_OVERRIDE_SOURCE'); ?>
</th>
</tr>
</thead>
<tbody>
<?php foreach ($this->updatedList as $i => $value) : ?>
<tr class="row<?php echo $i % 2; ?>">
<td class="text-center">
<?php echo HTMLHelper::_('grid.id', $i, $value->hash_id, false, 'cid', 'cb', '', 'updateForm'); ?>
</td>
<td>
<?php echo HTMLHelper::_('jgrid.published', $value->state, $i, 'template.', 1, 'cb', null, null, 'updateForm'); ?>
</td>
<td>
<a href="<?php echo Route::_('index.php?option=com_templates&view=template&id=' . (int) $value->extension_id . '&file=' . $value->hash_id); ?>" title="<?php echo Text::_('JACTION_EDIT'); ?>"><?php echo base64_decode($value->hash_id); ?></a>
</td>
<td>
<?php $created_date = $value->created_date; ?>
<?php echo $created_date > 0 ? HTMLHelper::_('date', $created_date, Text::_('DATE_FORMAT_FILTER_DATETIME')) : '-'; ?>
</td>
<td>
<?php if (is_null($value->modified_date)) : ?>
<span class="badge bg-warning text-dark"><?php echo Text::_('COM_TEMPLATES_OVERRIDE_CORE_REMOVED'); ?></span>
<?php else : ?>
<?php echo HTMLHelper::_('date', $value->modified_date, Text::_('DATE_FORMAT_FILTER_DATETIME')); ?>
<?php endif; ?>
</td>
<td>
<span class="badge bg-info"><?php echo $value->action; ?></span>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<input type="hidden" name="task" value="">
<input type="hidden" name="boxchecked" value="0">
<?php echo HTMLHelper::_('form.token'); ?>
</div>
</div>
</form>
<?php endif; ?>

View File

@ -0,0 +1,32 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright (C) 2015 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\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
$input = Factory::getApplication()->getInput();
?>
<form action="<?php echo Route::_('index.php?option=com_templates&view=template&id=' . $input->getInt('id') . '&file=' . $this->file); ?>" method="post" name="adminForm" id="adminForm">
<?php echo HTMLHelper::_('uitab.startTabSet', 'myTab', ['active' => 'description', 'recall' => true, 'breakpoint' => 768]); ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'description', Text::_('COM_TEMPLATES_TAB_DESCRIPTION')); ?>
<div class="card">
<div class="card-body">
<?php echo $this->loadTemplate('description'); ?>
</div>
</div>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php echo HTMLHelper::_('uitab.endTabSet'); ?>
<input type="hidden" name="task" value="">
<?php echo HTMLHelper::_('form.token'); ?>
</form>