77 |
77 |
}
|
78 |
78 |
|
79 |
79 |
$additionalCssFiles = array();
|
|
80 |
$additionalScssFiles = array();
|
80 |
81 |
$additionalScssPaths = array();
|
81 |
82 |
|
82 |
83 |
if(file_exists(DIR_FS_CATALOG . 'templates/' . $currentTemplate . '/stylesheet.css'))
|
... | ... | |
127 |
128 |
}
|
128 |
129 |
elseif(substr($file, -9) === 'main.scss')
|
129 |
130 |
{
|
|
131 |
$additionalScssFiles[] = substr($file, strlen(DIR_FS_CATALOG));
|
130 |
132 |
$additionalScssPaths[] = substr(substr($file, 0, strripos($file, '/')), strlen(DIR_FS_CATALOG));
|
131 |
133 |
}
|
132 |
134 |
}
|
133 |
135 |
}
|
|
136 |
$additionalScssFiles = array_unique($additionalScssFiles);
|
134 |
137 |
$additionalScssPaths = array_unique($additionalScssPaths);
|
135 |
138 |
|
136 |
139 |
$cacheFile = DIR_FS_CATALOG . 'cache/' . (!array_key_exists('style_edit_cache', $_GET)
|
... | ... | |
409 |
412 |
}
|
410 |
413 |
|
411 |
414 |
$server = new scss_server($basePath, 'cache', $compiler);
|
|
415 |
$server->setAdditionalScssFiles($additionalScssFiles);
|
412 |
416 |
ob_start();
|
413 |
417 |
try
|
414 |
418 |
{
|
415 |
419 |
$server->serve();
|
416 |
|
if(count($additionalScssPaths) > 0)
|
417 |
|
{
|
418 |
|
foreach($additionalScssPaths as $additionalScssPath)
|
419 |
|
{
|
420 |
|
$server = new scss_server($additionalScssPath, 'cache', $compiler);
|
421 |
|
$server->serve();
|
422 |
|
}
|
423 |
|
}
|
424 |
420 |
}
|
425 |
421 |
catch(\Exception $e)
|
426 |
422 |
{
|
... | ... | |
493 |
489 |
}
|
494 |
490 |
|
495 |
491 |
$server = new scss_server($basePath, 'cache', $compiler);
|
|
492 |
$server->setAdditionalScssFiles($additionalScssFiles);
|
496 |
493 |
|
497 |
494 |
// delete custom scss forcing to compile default css to ensure a working frontend
|
498 |
495 |
@file_put_contents(DIR_FS_CATALOG . $customDir . '_bootstrap_variables.scss', '');
|
... | ... | |
500 |
497 |
@file_put_contents(DIR_FS_CATALOG . $customDir . '_custom_styles.scss', '');
|
501 |
498 |
|
502 |
499 |
$server->serve();
|
503 |
|
if(count($additionalScssPaths) > 0)
|
504 |
|
{
|
505 |
|
foreach($additionalScssPaths as $additionalScssPath)
|
506 |
|
{
|
507 |
|
$server = new scss_server($additionalScssPath, 'cache', $compiler);
|
508 |
|
$server->serve();
|
509 |
|
}
|
510 |
|
}
|
511 |
500 |
|
512 |
501 |
$scss = ob_get_clean();
|
513 |
502 |
$scss = $errorMessage . $styleEditErrorMessage . $scss;
|