<?php
/**
 * Flex @package Helix Ultimate Framework
 * @author Aplikko http://www.aplikko.com
 * @copyright Copyright (c) 2025 Aplikko
 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
*/

defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\Uri\Uri;

//Load Helix
$helix3_path = JPATH_PLUGINS . '/system/helix3/core/helix3.php';

if (file_exists($helix3_path))
{
	require_once($helix3_path);
	$helix3 = helix3::getInstance();
}
else
{
	die('Please install and activate helix plugin');
}

$app = Factory::getApplication();
$input = $app->input;
$option = str_replace('_', '-', $input->get('option', '', 'STRING'));

$body_class = $option;

?>
<!DOCTYPE html>
<html lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
    <head>
		<meta name="viewport" content="width=device-width, initial-scale=1">
        <?php
            $doc = Factory::getDocument();
            if ($favicon = $this->params->get('favicon'))
            {
                $doc->addFavicon( Uri::base(true) . '/' .  $favicon);
            }
            else
            {
                $doc->addFavicon( $this->baseurl . '/templates/'. $this->template .'/images/favicon.ico' );
            }
        ?>
        <jdoc:include type="head" />
    </head>
    <body class="<?php echo $body_class; ?>">
        <jdoc:include type="component" />
    </body>
</html>
