From bb7365409a8ffffbbc0fe0b7c42c8fc7a4c0543a Mon Sep 17 00:00:00 2001 From: Christian Wolf Date: Sat, 9 Apr 2022 12:00:02 +0200 Subject: [PATCH] Fixed and cleaned PHP scripts --- slt/css/dynamic-styles.css.php | 31 +++--- slt/index.php | 179 +-------------------------------- 2 files changed, 17 insertions(+), 193 deletions(-) diff --git a/slt/css/dynamic-styles.css.php b/slt/css/dynamic-styles.css.php index 2176146..9db35bc 100644 --- a/slt/css/dynamic-styles.css.php +++ b/slt/css/dynamic-styles.css.php @@ -5,10 +5,11 @@ define('JPATH_BASE', '../../../'); require_once ( JPATH_BASE .'/includes/defines.php' ); require_once ( JPATH_BASE .'/includes/framework.php' ); -/* Create the Application */ -$mainframe = JFactory::getApplication('site'); -$mainframe->initialise(); -$params = JFactory::getApplication()->getTemplate(true)->params; +$container = \Joomla\CMS\Factory::getContainer(); +$container->alias(\Joomla\Session\SessionInterface::class, 'session.web.site'); +$mainframe = $container->get(\Joomla\CMS\Application\SiteApplication::class); +$template = $mainframe->getTemplate(true); +$params = $template->params; header("content-type: text/css"); @@ -24,8 +25,6 @@ header("Cache-Control: must-revalidate, max-age=$offset, public"); $leftImageValue = (empty($params['imgleft']) ? "none" : "url(\"" . JPATH_BASE. "/" . $params['imgleft'] . "\")") ; $rightImageValue = (empty($params['imgright']) ? "none" : "url(\"" . JPATH_BASE . "/" . $params['imgright'] . "\")") -// $leftImageValue = (empty($params['imgleft']) ? "none" : "url(\"" . $this->baseurl . "/" . $params['imgleft'] . "\")") ; -// $rightImageValue = (empty($params['imgright']) ? "none" : "url(\"" . $this->baseurl . "/" . $params['imgright'] . "\")") ?> @@ -67,7 +66,7 @@ a, a:hover, a:active, a:visited color: ; } -ul.menu { +ul.mod-menu { background-color: ; color: ; } @@ -77,8 +76,8 @@ ul.menu { color: ; } -ul.menu li.current > a, -ul.menu li.current:hover > a +ul.mod-menu li.current > a, +ul.mod-menu li.current:hover > a { background-color: ; color: ; @@ -86,27 +85,27 @@ ul.menu li.current:hover > a ul.nav > li > a:hover, ul.nav > li > a:focus, -ul.nav-child > li > a:hover, -ul.nav-child > li > a:focus +ul.mod-menu__sub > li > a:hover, +ul.mod-menu__sub > li > a:focus { background-color: ; color: ; } #topmenu, -#topmenu > ul.menu { +#topmenu > ul.mod-menu { background-color: ; color: ; } -#topmenu .nav-child > li.current +#topmenu .mod-menu__sub > li.current { background-color: ; color: ; } -#topmenu .nav-child { +#topmenu .mod-menu__sub { background-color: ; color: ; } @@ -114,8 +113,8 @@ ul.nav-child > li > a:focus #topmenu .nav > li:hover, #topmenu .nav > li:focus, #topmenu .nav > li.active, -#topmenu .nav-child > li:hover, -#topmenu .nav-child > li:focus +#topmenu .mod-menu__sub > li:hover, +#topmenu .mod-menu__sub > li:focus { background-color: ; color: ; diff --git a/slt/index.php b/slt/index.php index 14bdc7d..b346d41 100644 --- a/slt/index.php +++ b/slt/index.php @@ -15,20 +15,12 @@ JHtml::_('bootstrap.loadCss', true, $this->direction); // Add jQuery framework JHtml::_('jquery.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')); - // Add Stylesheets JHtml::_('stylesheet', 'templates/system/css/system.css', array('version' => 'auto', 'relative' => false)); -// JHtml::_('stylesheet', 'media/jui/css/icomoon.css', array('version' => 'auto', 'relative' => false)); JHtml::_('stylesheet', 'style.css', array('version' => 'auto', 'relative' => true)); -$doc->addStyleSheet($this->baseurl.'/media/jui/css/icomoon.css'); $doc->addStyleSheet($this->baseurl.'/media/system/css/joomla-fontawesome.css'); -// $doc->addStyleSheet($this->baseurl.'/templates/slt/css/dynamic-styles.css.php?Itemid=' . $app->input->getInt('Itemid')); +$doc->addStyleSheet($this->baseurl.'/templates/slt/css/dynamic-styles.css.php?Itemid=' . $app->input->getInt('Itemid')); // Add Javascript for mobile menu JHtml::_('script', 'mobile.js', array('version' => 'auto', 'relative' => true)); @@ -39,11 +31,6 @@ JHtml::_('stylesheet', 'user.css', array('version' => 'auto', 'relative' => true // Check for a custom js file JHtml::_('script', 'user.js', array('version' => 'auto', 'relative' => true)); -$params = JFactory::getApplication()->getTemplate(true)->params; - -$leftImageValue = (empty($params['imgleft']) ? "none" : "url(\"" . JPATH_BASE. "/" . $params['imgleft'] . "\")") ; -$rightImageValue = (empty($params['imgright']) ? "none" : "url(\"" . JPATH_BASE . "/" . $params['imgright'] . "\")") - ?> '; ?> @@ -52,169 +39,7 @@ $rightImageValue = (empty($params['imgright']) ? "none" : "url(\"" . JPATH_BASE - - - +