Skip to content

Commit

Permalink
Support JCE Editor Style List
Browse files Browse the repository at this point in the history
  • Loading branch information
sonvnn committed Oct 12, 2022
1 parent cf27587 commit eee261c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
6 changes: 5 additions & 1 deletion framework/library/astroid/Document.php
Expand Up @@ -13,6 +13,7 @@

require_once __DIR__ . "/../scssphp/scss.inc.php";

use Joomla\CMS\Filesystem\File;
use ScssPhp\ScssPhp\Compiler;
use MatthiasMullie\Minify;

Expand Down Expand Up @@ -1133,9 +1134,12 @@ public function astroidCSS()
// rendering scss
Framework::getReporter('Logs')->add('Rendering Scss');
// clearing previous versions
Helper::clearCache($template->template, ['compiled']);
Helper::clearCache($template->template, ['compiled', 'template']);
// adding compiled scss in css file
$this->renderScss($cssFile);
if ($template->isDefault()) {
File::copy($cssFile, ASTROID_MEDIA_TEMPLATE_PATH . '/css/template.css');
}
} else {
// logging compiled scss
Framework::getReporter('Logs')->add('Getting SCSS Compiled CSS <code>' . str_replace(JPATH_SITE . '/', '', $cssFile) . '</code> from cache.');
Expand Down
16 changes: 16 additions & 0 deletions framework/library/astroid/Template.php
Expand Up @@ -173,6 +173,22 @@ public function getThemeVariables()
return $variables;
}

public function isDefault($id = 0)
{
if (!$id) {
$id = $this->id;
}
$db = \JFactory::getDbo();
$query = "SELECT `home` FROM `#__template_styles` WHERE `id`='$id'";
$db->setQuery($query);
$result = $db->loadResult();
if ($result == 1) {
return true;
} else {
return false;
}
}

protected function _variableOverrides($variables)
{
$sass_overrides = $this->params->get('sass_overrides');
Expand Down

0 comments on commit eee261c

Please sign in to comment.