/** @var \Joomla\CMS\Document\HtmlDocument $this */
/** @var \Joomla\CMS\User\User $user */
/** @var Joomla\CMS\Application\CMSApplication $app */
$app = JFactory::getApplication();
$user = JFactory::getUser();
$config = new JConfig();
$baseUrl = "/templates/{$this->template}";
/** @var \Joomla\CMS\Document\HtmlDocument $this */
/** @var \Joomla\CMS\User\User $user */
/** @var Joomla\CMS\Application\CMSApplication $app */
// Output as HTML5 and set generator to eOrbit
$this->setHtml5(true);
$this->setGenerator('eOrbit');
// set proper base
$uri = pathinfo(sprintf('//%s/%s', filter_input(INPUT_SERVER, 'SERVER_NAME'), filter_input(INPUT_SERVER, 'PHP_SELF')));
$this->setBase($uri['dirname']);
// Getting params from template
$params = $app->getTemplate(true)->params;
// Detecting Active Variables
$option = $app->input->getCmd('option', '');
$view = $app->input->getCmd('view', '');
$layout = $app->input->getCmd('layout', '');
$task = $app->input->getCmd('task', '');
$itemid = $app->input->getCmd('Itemid', '');
$sitename = htmlspecialchars($app->get('sitename'), ENT_QUOTES, 'UTF-8');
$sitedescription = htmlspecialchars($this->params->get('sitedescription') ?? '', ENT_COMPAT, 'UTF-8');
$bodyClass =
''
//. $option
. ' view-' . $view
//. ($layout ? ' layout-' . $layout : ' no-layout')
//. ($task ? ' task-' . $task : ' no-task')
//. ($itemid ? ' itemid-' . $itemid : '')
//. ($params->get('fluidContainer') ? ' fluid' : '')
. ($this->direction === 'rtl' ? ' rtl' : '');
$fullWidthOptions = ['com_virtualfair', 'com_users'];
if ($task === 'edit' || $layout === 'form')
{
$fullWidth = 1;
}
else
{
$fullWidth = 0;
}
// Add JavaScript Frameworks
//JHtml::_('bootstrap.framework');
// Add template js
//JHtml::_('script', 'template.js', array('version' => 'auto', 'relative' => true));
// Add html5 shiv
//JHtml::_('script', 'jui/html5.js', array('version' => 'auto', 'relative' => true, 'conditional' => 'lt IE 9'));
if ($user->authorise('module.edit.frontend', 'com_modules'))
{
// Add Stylesheets
JHtml::_('stylesheet', 'template.css', array('version' => 'auto', 'relative' => true));
}
// Use of Google Font
if ($this->params->get('googleFont'))
{
$font = $this->params->get('googleFontName');
// Handle fonts with selected weights and styles, e.g. Source+Sans+Condensed:400,400i
$fontStyle = str_replace('+', ' ', strstr($font, ':', true) ?: $font);
JHtml::_('stylesheet', 'https://fonts.googleapis.com/css?family=' . $font);
$this->addStyleDeclaration("
h1, h2, h3, h4, h5, h6, .site-title {
font-family: '" . $fontStyle . "', sans-serif;
}");
}
// Template color
if ($this->params->get('templateColor'))
{
$this->addStyleDeclaration('
body.site {
border-top: 3px solid ' . $this->params->get('templateColor') . ';
background-color: ' . $this->params->get('templateBackgroundColor') . ';
}
a {
color: ' . $this->params->get('templateColor') . ';
}
.nav-list > .active > a,
.nav-list > .active > a:hover,
.dropdown-menu li > a:hover,
.dropdown-menu .active > a,
.dropdown-menu .active > a:hover,
.nav-pills > .active > a,
.nav-pills > .active > a:hover,
.btn-primary {
background: ' . $this->params->get('templateColor') . ';
}');
}
// Check for a custom CSS file
//JHtml::_('stylesheet', 'user.css', array('version' => 'auto', 'relative' => true));
// Check for a custom js file
//JHtml::_('script', 'user.js', array('version' => 'auto', 'relative' => true));
// Load optional RTL Bootstrap CSS
//JHtml::_('bootstrap.loadCss', false, $this->direction);
// Adjusting content width
// left and right aside width
$leftAsideSpan = " col-lg-4 col-xl-4 ";
$rightAsideSpan = "col-md-5 col-lg-6 col-xl-4 ";
$mainContentSpan = "col-md-19 col-lg-14 col-xl-16 ";
if($option === 'com_virtualfair')
{
//$leftAsideSpan = "col-md-4 col-lg-4 col-xl-4 ";
//$rightAsideSpan = "col-md-5 col-lg-6 col-xl-4 ";
//$mainContentSpan = "col-md-20 col-lg-20 col-xl-20 ";
}
$siteTitle = htmlspecialchars($config->sitename, ENT_COMPAT, 'UTF-8');
$siteDescription = htmlspecialchars($this->params->get('sitedescription', ''), ENT_COMPAT, 'UTF-8');
// Logo file or site title param
if ($this->params->get('logoFile'))
{
$logo = '';
}
elseif ($this->params->get('sitetitle'))
{
$logo = '' . $siteTitle . '';
}
else
{
$logo = '' . $sitename . '';
}
$app->registerEvent('onBeforeCompileHead', function() use ($user) {
// if ($user->authorise('module.edit.frontend', 'com_modules'))
// {
// return;
// }
/** @var \Joomla\CMS\Document\HtmlDocument $doc */
$doc = JFactory::getDocument();
$headData = $doc->getHeadData();
unset($headData['style']);
unset($headData['styleSheets']);
unset($headData['scripts']);
unset($headData['script']);
$doc->resetHeadData();
$doc->setHeadData($headData);
// if ($user->authorise('module.edit.frontend', 'com_modules'))
// {
// JHtml::_('stylesheet', 'frontediting.css', array('version' => 'auto', 'relative' => true));
// JHtml::_('script', 'frontediting.js', array('version' => 'auto', 'relative' => true));
// JHtml::_('stylesheet', 'template.css', array('version' => 'auto', 'relative' => true));
// }
});