* @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;
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()->input;
// Enable assets
$wa->useScript('form.validate')
->useScript('keepalive')
->useScript('diff')
->useScript('com_templates.admin-template-compare')
->useScript('com_templates.admin-template-toggle-switch');
// No access if not global SuperUser
if (!Factory::getUser()->authorise('core.admin')) {
Factory::getApplication()->enqueueMessage(Text::_('JERROR_ALERTNOAUTHOR'), 'danger');
}
if ($this->type == 'image') {
$wa->usePreset('cropperjs');
}
$wa->useStyle('com_templates.admin-templates')
->useScript('com_templates.admin-templates');
if ($this->type == 'font') {
$wa->addInlineStyle("
@font-face {
font-family: previewFont;
src: url('" . $this->font['address'] . "')
}
.font-preview {
font-family: previewFont !important;
}
");
}
?>