Skip to content

Commit

Permalink
2.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
conseilgouz committed Feb 2, 2025
1 parent ed519bc commit 80d2f90
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Binary file modified packages/plg_system_cgstyle_j4.zip
Binary file not shown.
10 changes: 8 additions & 2 deletions packages/plg_system_cgstyle_j4/src/Extension/Cgstyle.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php
/**
* @package CG template switcher Module
* @version 2.1.0
* @subpackage system.cg_style
*
* @copyright Copyright (C) 2025 Conseilgouz. All rights reserved.
* @copyright Copyright (C) 2023 Conseilgouz. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
*/
Expand All @@ -17,6 +18,8 @@
use Joomla\Database\DatabaseAwareTrait;
use Joomla\Event\SubscriberInterface;
use YOOtheme\Theme\Joomla\ThemeLoader;
use YOOtheme\Event;
use YOOtheme\Config;

use function YOOtheme\app;

Expand Down Expand Up @@ -52,10 +55,13 @@ public function afterRoute()
$version = substr($j->getShortVersion(), 0, 1);
if ($version >= "4") { // Joomla 4 and higher

$app->setTemplate($style);
$ret = $app->setTemplate($style);

if (strpos($style->template, 'yootheme') === 0) {
$config = app(Config::class);
app()->call([ThemeLoader::class, 'initTheme']);
$config->set('theme.id', $style->id);
Event::emit('theme.head');
}
if (strpos($style->template, 'astroid') === 0) {
\Astroid\Framework::getTemplate($style->id);
Expand Down

0 comments on commit 80d2f90

Please sign in to comment.