first commit
This commit is contained in:
116
administrator/components/com_templates/tmpl/style/edit.php
Normal file
116
administrator/components/com_templates/tmpl/style/edit.php
Normal file
@ -0,0 +1,116 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_templates
|
||||
*
|
||||
* @copyright (C) 2009 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\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Layout\LayoutHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
|
||||
$wa = $this->document->getWebAssetManager();
|
||||
$wa->useScript('keepalive')
|
||||
->useScript('form.validate');
|
||||
|
||||
$this->useCoreUI = true;
|
||||
|
||||
$user = $this->getCurrentUser();
|
||||
?>
|
||||
|
||||
<form action="<?php echo Route::_('index.php?option=com_templates&layout=edit&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="style-form" aria-label="<?php echo Text::_('COM_TEMPLATES_STYLE_FORM_EDIT'); ?>" class="form-validate">
|
||||
|
||||
<?php echo LayoutHelper::render('joomla.edit.title_alias', $this); ?>
|
||||
|
||||
<div class="main-card">
|
||||
<?php echo HTMLHelper::_('uitab.startTabSet', 'myTab', ['active' => 'details', 'recall' => true, 'breakpoint' => 768]); ?>
|
||||
|
||||
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'details', Text::_('JDETAILS')); ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-9">
|
||||
<h2>
|
||||
<?php echo Text::_($this->item->template); ?>
|
||||
</h2>
|
||||
<div class="info-labels">
|
||||
<span class="badge bg-secondary">
|
||||
<?php echo $this->item->client_id == 0 ? Text::_('JSITE') : Text::_('JADMINISTRATOR'); ?>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<p><?php echo Text::_($this->item->xml->description); ?></p>
|
||||
<?php
|
||||
$this->fieldset = 'description';
|
||||
$description = LayoutHelper::render('joomla.edit.fieldset', $this);
|
||||
?>
|
||||
<?php if ($description) : ?>
|
||||
<p class="readmore">
|
||||
<a href="#" onclick="document.querySelector('#tab-description').click();">
|
||||
<?php echo Text::_('JGLOBAL_SHOW_FULL_DESCRIPTION'); ?>
|
||||
</a>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php
|
||||
$this->fieldset = 'basic';
|
||||
$html = LayoutHelper::render('joomla.edit.fieldset', $this);
|
||||
echo $html ? '<hr>' . $html : '';
|
||||
?>
|
||||
</div>
|
||||
<div class="col-lg-3">
|
||||
<?php
|
||||
// Set main fields.
|
||||
$this->fields = [
|
||||
'home',
|
||||
'client_id',
|
||||
'template'
|
||||
];
|
||||
?>
|
||||
<?php echo LayoutHelper::render('joomla.edit.global', $this); ?>
|
||||
<?php echo $this->form->renderField('inheritable'); ?>
|
||||
<?php echo $this->form->renderField('parent'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo HTMLHelper::_('uitab.endTab'); ?>
|
||||
|
||||
<?php if ($description) : ?>
|
||||
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'description', Text::_('JGLOBAL_FIELDSET_DESCRIPTION')); ?>
|
||||
<fieldset id="fieldset-description" class="options-form">
|
||||
<legend><?php echo Text::_('JGLOBAL_FIELDSET_DESCRIPTION'); ?></legend>
|
||||
<div>
|
||||
<?php echo $description; ?>
|
||||
</div>
|
||||
</fieldset>
|
||||
<?php echo HTMLHelper::_('uitab.endTab'); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
$this->fieldsets = [];
|
||||
$this->ignore_fieldsets = ['basic', 'description'];
|
||||
echo LayoutHelper::render('joomla.edit.params', $this);
|
||||
?>
|
||||
|
||||
<?php if ($user->authorise('core.edit', 'com_menus') && $this->item->client_id == 0 && $this->canDo->get('core.edit.state')) : ?>
|
||||
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'assignment', Text::_('COM_TEMPLATES_MENUS_ASSIGNMENT')); ?>
|
||||
<fieldset id="fieldset-assignment" class="options-form">
|
||||
<legend><?php echo Text::_('COM_TEMPLATES_MENUS_ASSIGNMENT'); ?></legend>
|
||||
<div>
|
||||
<?php echo $this->loadTemplate('assignment'); ?>
|
||||
</div>
|
||||
</fieldset>
|
||||
<?php echo HTMLHelper::_('uitab.endTab'); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php echo HTMLHelper::_('uitab.endTabSet'); ?>
|
||||
|
||||
<input type="hidden" name="task" value="">
|
||||
<?php echo HTMLHelper::_('form.token'); ?>
|
||||
</div>
|
||||
</form>
|
||||
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_templates
|
||||
*
|
||||
* @copyright (C) 2010 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\Layout\LayoutHelper;
|
||||
use Joomla\Component\Menus\Administrator\Helper\MenusHelper;
|
||||
|
||||
// Initialise related data.
|
||||
$menuTypes = MenusHelper::getMenuLinks();
|
||||
$user = $this->getCurrentUser();
|
||||
|
||||
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
|
||||
$wa = $this->document->getWebAssetManager();
|
||||
$wa->useScript('com_templates.admin-template-toggle-assignment');
|
||||
|
||||
?>
|
||||
<label id="jform_menuselect-lbl" for="jform_menuselect"><?php echo Text::_('JGLOBAL_MENU_SELECTION'); ?></label>
|
||||
<div class="btn-toolbar">
|
||||
<button class="btn btn-sm btn-secondary jform-rightbtn" type="button" onclick="Joomla.toggleAll()">
|
||||
<span class="icon-square" aria-hidden="true"></span> <?php echo Text::_('JGLOBAL_SELECTION_INVERT_ALL'); ?>
|
||||
</button>
|
||||
</div>
|
||||
<div id="menu-assignment" class="menu-assignment">
|
||||
<ul class="menu-links">
|
||||
|
||||
<?php foreach ($menuTypes as &$type) : ?>
|
||||
<li>
|
||||
<div class="menu-links-block">
|
||||
<button class="btn btn-sm btn-secondary jform-rightbtn mb-2" type="button" onclick='Joomla.toggleMenutype("<?php echo $type->menutype; ?>")'>
|
||||
<span class="icon-square" aria-hidden="true"></span> <?php echo Text::_('JGLOBAL_SELECTION_INVERT'); ?>
|
||||
</button>
|
||||
<h5><?php echo $type->title ?: $type->menutype; ?></h5>
|
||||
|
||||
<?php foreach ($type->links as $link) : ?>
|
||||
<label class="checkbox small" for="link<?php echo (int) $link->value; ?>" >
|
||||
<input type="checkbox" name="jform[assigned][]" value="<?php echo (int) $link->value; ?>" id="link<?php echo (int) $link->value; ?>"<?php if ($link->template_style_id == $this->item->id) :
|
||||
?> checked="checked"<?php
|
||||
endif; ?><?php if ($link->checked_out && $link->checked_out != $user->id) :
|
||||
?> disabled="disabled"<?php
|
||||
else :
|
||||
?> class="form-check-input chk-menulink menutype-<?php echo $type->menutype; ?>"<?php
|
||||
endif; ?> />
|
||||
<?php echo LayoutHelper::render('joomla.html.treeprefix', ['level' => $link->level]) . $link->text; ?>
|
||||
</label>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</div>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
153
administrator/components/com_templates/tmpl/styles/default.php
Normal file
153
administrator/components/com_templates/tmpl/styles/default.php
Normal file
@ -0,0 +1,153 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_templates
|
||||
*
|
||||
* @copyright (C) 2009 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\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Layout\LayoutHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\CMS\Session\Session;
|
||||
|
||||
/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */
|
||||
$wa = $this->document->getWebAssetManager();
|
||||
$wa->useScript('table.columns')
|
||||
->useScript('multiselect');
|
||||
|
||||
$user = $this->getCurrentUser();
|
||||
$clientId = (int) $this->state->get('client_id', 0);
|
||||
$listOrder = $this->escape($this->state->get('list.ordering'));
|
||||
$listDirn = $this->escape($this->state->get('list.direction'));
|
||||
?>
|
||||
<form action="<?php echo Route::_('index.php?option=com_templates&view=styles'); ?>" method="post" name="adminForm" id="adminForm">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div id="j-main-container" class="j-main-container">
|
||||
<?php echo LayoutHelper::render('joomla.searchtools.default', ['view' => $this, 'options' => ['selectorFieldName' => 'client_id']]); ?>
|
||||
<?php if ($this->total > 0) : ?>
|
||||
<table class="table" id="styleList">
|
||||
<caption class="visually-hidden">
|
||||
<?php echo Text::_('COM_TEMPLATES_STYLES_TABLE_CAPTION'); ?>,
|
||||
<span id="orderedBy"><?php echo Text::_('JGLOBAL_SORTED_BY'); ?> </span>,
|
||||
<span id="filteredBy"><?php echo Text::_('JGLOBAL_FILTERED_BY'); ?></span>
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="w-1 text-center">
|
||||
<?php echo HTMLHelper::_('grid.checkall'); ?>
|
||||
</td>
|
||||
<th scope="col">
|
||||
<?php echo HTMLHelper::_('searchtools.sort', 'COM_TEMPLATES_HEADING_STYLE', 'a.title', $listDirn, $listOrder); ?>
|
||||
</th>
|
||||
<th scope="col" class="w-5 text-center">
|
||||
<?php echo Text::_('COM_TEMPLATES_TEMPLATE_PREVIEW'); ?>
|
||||
</th>
|
||||
<th scope="col" class="w-12 text-center">
|
||||
<?php echo HTMLHelper::_('searchtools.sort', 'COM_TEMPLATES_HEADING_DEFAULT', 'a.home', $listDirn, $listOrder); ?>
|
||||
</th>
|
||||
<?php if ($clientId === 0) : ?>
|
||||
<th scope="col" class="w-12 d-none d-md-table-cell">
|
||||
<?php echo Text::_('COM_TEMPLATES_HEADING_PAGES'); ?>
|
||||
</th>
|
||||
<?php endif; ?>
|
||||
<th scope="col" class="w-12 d-none d-md-table-cell">
|
||||
<?php echo HTMLHelper::_('searchtools.sort', 'COM_TEMPLATES_HEADING_TEMPLATE', 'a.template', $listDirn, $listOrder); ?>
|
||||
</th>
|
||||
<th scope="col" class="w-5 d-none d-md-table-cell">
|
||||
<?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($this->items as $i => $item) :
|
||||
$canCreate = $user->authorise('core.create', 'com_templates');
|
||||
$canEdit = $user->authorise('core.edit', 'com_templates');
|
||||
$canChange = $user->authorise('core.edit.state', 'com_templates');
|
||||
?>
|
||||
<tr class="row<?php echo $i % 2; ?>">
|
||||
<td class="w-1 text-center">
|
||||
<?php echo HTMLHelper::_('grid.id', $i, $item->id, false, 'cid', 'cb', $item->title); ?>
|
||||
</td>
|
||||
<th scope="row">
|
||||
<?php if ($canEdit) : ?>
|
||||
<a href="<?php echo Route::_('index.php?option=com_templates&task=style.edit&id=' . (int) $item->id); ?>" title="<?php echo Text::_('JACTION_EDIT'); ?> <?php echo $this->escape($item->title); ?>">
|
||||
<?php echo $this->escape($item->title); ?></a>
|
||||
<?php else : ?>
|
||||
<?php echo $this->escape($item->title); ?>
|
||||
<?php endif; ?>
|
||||
</th>
|
||||
<td class="text-center">
|
||||
<?php if ($this->preview) : ?>
|
||||
<?php $client = (int) $item->client_id === 1 ? 'administrator' : 'site'; ?>
|
||||
<!-- external link icon generated by css -->
|
||||
<a href="<?php echo Route::link($client, 'index.php?tp=1&templateStyle=' . (int) $item->id); ?>" target="_blank" class="jgrid" aria-labelledby="preview-<?php echo (int) $item->id; ?>"></a>
|
||||
<div role="tooltip" id="preview-<?php echo (int) $item->id; ?>"><?php echo Text::sprintf('COM_TEMPLATES_TEMPLATE_NEW_PREVIEW', $item->title); ?></div>
|
||||
<?php else : ?>
|
||||
<span class="icon-eye-slash" aria-labelledby="nopreview-<?php echo (int) $item->id; ?>" aria-hidden="true"></span>
|
||||
<div role="tooltip" id="nopreview-<?php echo (int) $item->id; ?>"><?php echo Text::_('COM_TEMPLATES_TEMPLATE_NO_PREVIEW'); ?></div>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<?php if ($item->home == '0' || $item->home == '1') : ?>
|
||||
<?php echo HTMLHelper::_('jgrid.isdefault', $item->home != '0', $i, 'styles.', $canChange && $item->home != '1'); ?>
|
||||
<?php elseif ($canChange) :?>
|
||||
<a href="<?php echo Route::_('index.php?option=com_templates&task=styles.unsetDefault&cid[]=' . $item->id . '&' . Session::getFormToken() . '=1'); ?>">
|
||||
<?php if ($item->image) : ?>
|
||||
<?php echo HTMLHelper::_('image', 'mod_languages/' . $item->image . '.gif', $item->language_title, ['title' => Text::sprintf('COM_TEMPLATES_GRID_UNSET_LANGUAGE', $item->language_title)], true); ?>
|
||||
<?php else : ?>
|
||||
<span class="badge bg-secondary" title="<?php echo Text::sprintf('COM_TEMPLATES_GRID_UNSET_LANGUAGE', $item->language_title); ?>"><?php echo $item->home; ?></span>
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
<?php else : ?>
|
||||
<?php if ($item->image) : ?>
|
||||
<?php echo HTMLHelper::_('image', 'mod_languages/' . $item->image . '.gif', $item->language_title, ['title' => $item->language_title], true); ?>
|
||||
<?php else : ?>
|
||||
<span class="badge bg-secondary" title="<?php echo $item->language_title; ?>"><?php echo $item->home; ?></span>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<?php if ($clientId === 0) : ?>
|
||||
<td class="small d-none d-md-table-cell">
|
||||
<?php if ($item->home == '1') : ?>
|
||||
<?php echo Text::_('COM_TEMPLATES_STYLES_PAGES_ALL'); ?>
|
||||
<?php elseif ($item->home != '0' && $item->home != '1') : ?>
|
||||
<?php echo Text::sprintf('COM_TEMPLATES_STYLES_PAGES_ALL_LANGUAGE', $this->escape($item->language_title)); ?>
|
||||
<?php elseif ($item->assigned > 0) : ?>
|
||||
<?php echo Text::plural('COM_TEMPLATES_STYLES_PAGES_SELECTED', $this->escape($item->assigned)); ?>
|
||||
<?php else : ?>
|
||||
<?php echo Text::_('COM_TEMPLATES_STYLES_PAGES_NONE'); ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
<td class="small d-none d-md-table-cell">
|
||||
<a href="<?php echo Route::_('index.php?option=com_templates&view=template&id=' . (int) $item->e_id); ?>">
|
||||
<?php echo ucfirst($this->escape($item->template)); ?>
|
||||
</a>
|
||||
</td>
|
||||
<td class="d-none d-md-table-cell">
|
||||
<?php echo (int) $item->id; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php // load the pagination. ?>
|
||||
<?php echo $this->pagination->getListFooter(); ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<input type="hidden" name="task" value="">
|
||||
<input type="hidden" name="boxchecked" value="0">
|
||||
<?php echo HTMLHelper::_('form.token'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<metadata>
|
||||
<layout title="COM_TEMPLATES_STYLE_VIEW_DEFAULT_TITLE">
|
||||
<message>
|
||||
<![CDATA[COM_TEMPLATES_STYLE_VIEW_DEFAULT_DESC]]>
|
||||
</message>
|
||||
</layout>
|
||||
</metadata>
|
||||
475
administrator/components/com_templates/tmpl/template/default.php
Normal file
475
administrator/components/com_templates/tmpl/template/default.php
Normal 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', '‎' . ($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> <?php echo $file; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (substr($file, -1) != DIRECTORY_SEPARATOR) : ?>
|
||||
<span class="icon-file icon-fw" aria-hidden="true"></span> <?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> <?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> <?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> <?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> <?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> <?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> <?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>
|
||||
@ -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>
|
||||
@ -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>
|
||||
@ -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>
|
||||
@ -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>
|
||||
@ -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>
|
||||
@ -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>
|
||||
@ -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>
|
||||
@ -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>
|
||||
@ -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>
|
||||
@ -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', '‎' . $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>
|
||||
@ -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>
|
||||
@ -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>
|
||||
@ -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>
|
||||
@ -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>
|
||||
@ -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>
|
||||
@ -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>
|
||||
@ -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>
|
||||
@ -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> <?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> <?php echo $this->escape($value->name); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
@ -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> <?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> <?php echo $this->escape($value->name); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
@ -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; ?>
|
||||
@ -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>
|
||||
@ -0,0 +1,144 @@
|
||||
<?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 Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Layout\LayoutHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */
|
||||
$wa = $this->document->getWebAssetManager();
|
||||
$wa->useScript('table.columns')
|
||||
->useScript('multiselect');
|
||||
|
||||
$user = $this->getCurrentUser();
|
||||
$listOrder = $this->escape($this->state->get('list.ordering'));
|
||||
$listDirn = $this->escape($this->state->get('list.direction'));
|
||||
?>
|
||||
|
||||
<form action="<?php echo Route::_('index.php?option=com_templates&view=templates'); ?>" method="post" name="adminForm" id="adminForm">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div id="j-main-container" class="j-main-container">
|
||||
<?php echo LayoutHelper::render('joomla.searchtools.default', ['view' => $this, 'options' => ['selectorFieldName' => 'client_id']]); ?>
|
||||
<?php if ($this->total > 0) : ?>
|
||||
<table class="table" id="templateList">
|
||||
<caption class="visually-hidden">
|
||||
<?php echo Text::_('COM_TEMPLATES_TEMPLATES_TABLE_CAPTION'); ?>,
|
||||
<span id="orderedBy"><?php echo Text::_('JGLOBAL_SORTED_BY'); ?> </span>,
|
||||
<span id="filteredBy"><?php echo Text::_('JGLOBAL_FILTERED_BY'); ?></span>
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="w-20 col1template d-none d-md-table-cell">
|
||||
<?php echo Text::_('COM_TEMPLATES_HEADING_IMAGE'); ?>
|
||||
</th>
|
||||
<th scope="col" class="w-30">
|
||||
<?php echo HTMLHelper::_('searchtools.sort', 'COM_TEMPLATES_HEADING_TEMPLATE', 'a.element', $listDirn, $listOrder); ?>
|
||||
</th>
|
||||
<th scope="col" class="w-10 d-none d-md-table-cell text-center">
|
||||
<?php echo Text::_('JVERSION'); ?>
|
||||
</th>
|
||||
<th scope="col" class="w-10 d-none d-md-table-cell text-center">
|
||||
<?php echo Text::_('JDATE'); ?>
|
||||
</th>
|
||||
<th scope="col" class="w-25 d-none d-md-table-cell text-center">
|
||||
<?php echo Text::_('JAUTHOR'); ?>
|
||||
</th>
|
||||
<?php if ($this->pluginState) : ?>
|
||||
<th scope="col" class="w-10 d-none d-md-table-cell text-center">
|
||||
<?php echo Text::_('COM_TEMPLATES_OVERRIDES'); ?>
|
||||
</th>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($this->items as $i => $item) : ?>
|
||||
<tr class="row<?php echo $i % 2; ?>">
|
||||
<td class="text-center d-none d-md-table-cell">
|
||||
<?php echo HTMLHelper::_('templates.thumb', $item); ?>
|
||||
<?php echo HTMLHelper::_('templates.thumbModal', $item); ?>
|
||||
</td>
|
||||
<th scope="row" class="template-name">
|
||||
<a href="<?php echo Route::_('index.php?option=com_templates&view=template&id=' . (int) $item->extension_id . '&file=' . $this->file); ?>">
|
||||
<?php echo Text::sprintf('COM_TEMPLATES_TEMPLATE_DETAILS', ucfirst($item->name)); ?></a>
|
||||
<div>
|
||||
<?php if ($this->preview) : ?>
|
||||
<?php $client = (int) $item->client_id === 1 ? 'administrator' : 'site'; ?>
|
||||
<a href="<?php echo Route::link($client, 'index.php?tp=1&template=' . $item->element); ?>" target="_blank" aria-labelledby="preview-<?php echo $item->extension_id; ?>">
|
||||
<?php echo Text::_('COM_TEMPLATES_TEMPLATE_PREVIEW'); ?>
|
||||
</a>
|
||||
<div role="tooltip" id="preview-<?php echo $item->extension_id; ?>"><?php echo Text::sprintf('COM_TEMPLATES_TEMPLATE_NEW_PREVIEW', $item->name); ?></div>
|
||||
<?php else : ?>
|
||||
<?php echo Text::_('COM_TEMPLATES_TEMPLATE_NO_PREVIEW'); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php if (isset($item->xmldata->inheritable) && $item->xmldata->inheritable) : ?>
|
||||
<div class="badge bg-primary">
|
||||
<span class="fas fa-link text-light" aria-hidden="true"></span>
|
||||
<?php echo Text::_('COM_TEMPLATES_TEMPLATE_IS_PARENT'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if (isset($item->xmldata->parent) && (string) $item->xmldata->parent !== '') : ?>
|
||||
<div class="badge bg-info text-light">
|
||||
<span class="fas fa-clone text-light" aria-hidden="true"></span>
|
||||
<?php echo Text::sprintf('COM_TEMPLATES_TEMPLATE_IS_CHILD_OF', (string) $item->xmldata->parent); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</th>
|
||||
<td class="small d-none d-md-table-cell text-center">
|
||||
<?php echo $this->escape($item->xmldata->get('version')); ?>
|
||||
</td>
|
||||
<td class="small d-none d-md-table-cell text-center">
|
||||
<?php echo $this->escape($item->xmldata->get('creationDate')); ?>
|
||||
</td>
|
||||
<td class="d-none d-md-table-cell text-center">
|
||||
<?php if ($author = $item->xmldata->get('author')) : ?>
|
||||
<div><?php echo $this->escape($author); ?></div>
|
||||
<?php else : ?>
|
||||
—
|
||||
<?php endif; ?>
|
||||
<?php if ($email = $item->xmldata->get('authorEmail')) : ?>
|
||||
<div><?php echo $this->escape($email); ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ($url = $item->xmldata->get('authorUrl')) : ?>
|
||||
<div><a href="<?php echo $this->escape($url); ?>"><?php echo $this->escape($url); ?></a></div>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<?php if ($this->pluginState) : ?>
|
||||
<td class="d-none d-md-table-cell text-center">
|
||||
<?php if (!empty($item->updated)) : ?>
|
||||
<a href="<?php echo Route::_('index.php?option=com_templates&view=template&id=' . (int) $item->extension_id . '#files'); ?>">
|
||||
<span class="badge bg-warning text-dark"><?php echo Text::plural('COM_TEMPLATES_N_CONFLICT', $item->updated); ?></span>
|
||||
</a>
|
||||
<?php else : ?>
|
||||
<span class="badge bg-success"><?php echo Text::_('COM_TEMPLATES_UPTODATE'); ?></span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php // load the pagination. ?>
|
||||
<?php echo $this->pagination->getListFooter(); ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<input type="hidden" name="task" value="">
|
||||
<input type="hidden" name="boxchecked" value="0">
|
||||
<?php echo HTMLHelper::_('form.token'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<metadata>
|
||||
<layout title="COM_TEMPLATES_TEMPLATES_VIEW_DEFAULT_TITLE">
|
||||
<message>
|
||||
<![CDATA[COM_TEMPLATES_TEMPLATES_VIEW_DEFAULT_DESC]]>
|
||||
</message>
|
||||
</layout>
|
||||
</metadata>
|
||||
Reference in New Issue
Block a user