From c8abdf03b2b6ceb51eb12fad3cad7a21b741fbb4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 8 Mar 2026 17:54:05 +0000 Subject: [PATCH] Simplify component.php to show only logo and footer with light theme Co-authored-by: jmiller-moko <230051081+jmiller-moko@users.noreply.github.com> --- src/component.php | 136 +--------------------------------------------- 1 file changed, 3 insertions(+), 133 deletions(-) diff --git a/src/component.php b/src/component.php index f3d21fd..efb20be 100644 --- a/src/component.php +++ b/src/component.php @@ -32,18 +32,11 @@ $input = $app->getInput(); $document = $app->getDocument(); $wa = $document->getWebAssetManager(); -// Template params -$params_LightColorName = (string) $this->params->get('colorLightName', 'standard'); // standard|custom - -$params_DarkColorName = (string) $this->params->get('colorDarkName', 'standard'); // standard|custom - +// Template params - Component uses minimal configuration $params_googletagmanager = $this->params->get('googletagmanager', false); $params_googletagmanagerid = $this->params->get('googletagmanagerid', null); $params_googleanalytics = $this->params->get('googleanalytics', false); $params_googleanalyticsid = $this->params->get('googleanalyticsid', null); -$params_custom_head_start = $this->params->get('custom_head_start', null); -$params_custom_head_end = $this->params->get('custom_head_end', null); -$params_developmentmode = $this->params->get('developmentmode', false); // Detecting Active Variables $option = $input->getCmd('option', ''); @@ -71,117 +64,12 @@ $templatePath = 'media/templates/site/mokocassiopeia'; // Core template CSS $wa->useStyle('template.base'); // css/template.css -// Load theme palette stylesheets based on configuration +// Component always uses light theme only (no theme switching) $wa->useStyle('template.light.standard'); // css/theme/light.standard.css -$wa->useStyle('template.dark.standard'); // css/theme/dark.standard.css - -// Load custom palettes only if selected in template configuration AND files exist -if ($params_LightColorName === 'custom' && file_exists(JPATH_ROOT . '/media/templates/site/mokocassiopeia/css/theme/light.custom.css')) -{ - $wa->useStyle('template.light.custom'); -} -if ($params_DarkColorName === 'custom' && file_exists(JPATH_ROOT . '/media/templates/site/mokocassiopeia/css/theme/dark.custom.css')) -{ - $wa->useStyle('template.dark.custom'); -} - -// Scripts -$wa->useScript('template.js'); // Load Osaka font for site title $wa->useStyle('template.font.osaka'); -/** - * VirtueMart detection: - * - Component must exist and be enabled - */ -$isVirtueMartActive = ComponentHelper::isEnabled('com_virtuemart', true); - -if ($isVirtueMartActive) { - /** - * Load a VirtueMart-specific stylesheet defined in your template manifest. - * This assumes you defined an asset named "template.virtuemart". - */ - $wa->useStyle('vendor.vm'); -} - -// Font scheme (external or local) + CSS custom properties -$params_FontScheme = $this->params->get('useFontScheme', false); -$fontStyles = ''; - -if ($params_FontScheme) { - if (stripos($params_FontScheme, 'https://') === 0) { - $this->getPreloadManager()->preload($params_FontScheme, ['as' => 'style', 'crossorigin' => 'anonymous']); - $wa->registerAndUseStyle('fontscheme.current', $params_FontScheme, [], [ - 'media' => 'print', - 'rel' => 'lazy-stylesheet', - 'onload' => 'this.media=\'all\'', - 'crossorigin' => 'anonymous' - ]); - - if (preg_match_all('/family=([^?:]*):/i', $params_FontScheme, $matches) > 0) { - $fontStyles = '--font-family-body: "' . str_replace('+', ' ', $matches[1][0]) . '", sans-serif;' . "\n"; - $fontStyles .= '--font-family-headings: "' . str_replace('+', ' ', isset($matches[1][1]) ? $matches[1][1] : $matches[1][0]) . '", sans-serif;' . "\n"; - $fontStyles .= '--font-weight-normal: 400;' . "\n"; - $fontStyles .= '--font-weight-headings: 700;'; - } - } else { - $wa->registerAndUseStyle('fontscheme.current', $params_FontScheme, ['version' => 'auto'], [ - 'media' => 'print', - 'rel' => 'lazy-stylesheet', - 'onload' => 'this.media=\'all\'' - ]); - $this->getPreloadManager()->preload( - $wa->getAsset('style', 'fontscheme.current')->getUri() . '?' . $this->getMediaVersion(), - ['as' => 'style'] - ); - } -} - -// Meta -$this->setMetaData('viewport', 'width=device-width, initial-scale=1'); - -if ($this->params->get('faKitCode')) { - $faKit = "https://kit.fontawesome.com/" . $this->params->get('faKitCode') . ".js"; - HTMLHelper::_('script', $faKit, ['crossorigin' => 'anonymous']); -} else { - try { - if($params_developmentmode){ - $wa->useStyle('vendor.fa7free.all'); - $wa->useStyle('vendor.fa7free.brands'); - $wa->useStyle('vendor.fa7free.fontawesome'); - $wa->useStyle('vendor.fa7free.regular'); - $wa->useStyle('vendor.fa7free.solid'); - } else { - $wa->useStyle('vendor.fa7free.all.min'); - $wa->useStyle('vendor.fa7free.brands.min'); - $wa->useStyle('vendor.fa7free.fontawesome.min'); - $wa->useStyle('vendor.fa7free.regular.min'); - $wa->useStyle('vendor.fa7free.solid.min'); - } - } catch (\Throwable $e) { - if($params_developmentmode){ - $wa->registerAndUseStyle('vendor.fa7free.all.dynamic', $templatePath . '/vendor/fa7free/css/all.css'); - $wa->registerAndUseStyle('vendor.fa7free.brands.dynamic', $templatePath . '/vendor/fa7free/css/brands.css'); - $wa->registerAndUseStyle('vendor.fa7free.fontawesome.dynamic', $templatePath . '/vendor/fa7free/css/fontawesome.css'); - $wa->registerAndUseStyle('vendor.fa7free.regular.dynamic', $templatePath . '/vendor/fa7free/css/regular.css'); - $wa->registerAndUseStyle('vendor.fa7free.solid.dynamic', $templatePath . '/vendor/fa7free/css/solid.css'); - } else { - $wa->registerAndUseStyle('vendor.fa7free.all.min.dynamic', $templatePath . '/vendor/fa7free/css/all.min.css'); - $wa->registerAndUseStyle('vendor.fa7free.brands.min.dynamic', $templatePath . '/vendor/fa7free/css/brands.min.css'); - $wa->registerAndUseStyle('vendor.fa7free.fontawesome.min.dynamic', $templatePath . '/vendor/fa7free/css/fontawesome.min.css'); - $wa->registerAndUseStyle('vendor.fa7free.regular.min.dynamic', $templatePath . '/vendor/fa7free/css/regular.min.css'); - $wa->registerAndUseStyle('vendor.fa7free.solid.min.dynamic', $templatePath . '/vendor/fa7free/css/solid.min.css'); - } - - } -} -$params_leftIcon = htmlspecialchars($this->params->get('drawerLeftIcon', 'fa-solid fa-chevron-left'), ENT_COMPAT, 'UTF-8'); -$params_rightIcon = htmlspecialchars($this->params->get('drawerRightIcon', 'fa-solid fa-chevron-right'), ENT_COMPAT, 'UTF-8'); - -// Theme params -$params_theme_enabled = $this->params->get('theme_enabled', 1); - // Brand: logo from params OR siteTitle // ------------------------------------- $brandHtml = ''; @@ -204,32 +92,14 @@ if ($logoFile !== '') { . ''; } -// Load user assets last (after all other styles and scripts) -$wa->useStyle('template.user'); // css/user.css -$wa->useScript('user.js'); // js/user.js ?> - +