aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Template/CSSResourceLocator.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Template/CSSResourceLocator.php')
-rw-r--r--lib/private/Template/CSSResourceLocator.php19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/private/Template/CSSResourceLocator.php b/lib/private/Template/CSSResourceLocator.php
index 6af4e319e36..3a474a1ecfd 100644
--- a/lib/private/Template/CSSResourceLocator.php
+++ b/lib/private/Template/CSSResourceLocator.php
@@ -49,20 +49,22 @@ class CSSResourceLocator extends ResourceLocator {
* @param string $style
*/
public function doFind($style) {
+ $app = substr($style, 0, strpos($style, '/'));
if (strpos($style, '3rdparty') === 0
&& $this->appendIfExist($this->thirdpartyroot, $style.'.css')
- || $this->cacheAndAppendScssIfExist($this->serverroot, $style.'.scss')
+ || $this->cacheAndAppendScssIfExist($this->serverroot, $style.'.scss', $app)
|| $this->cacheAndAppendScssIfExist($this->serverroot, 'core/'.$style.'.scss')
|| $this->appendIfExist($this->serverroot, $style.'.css')
|| $this->appendIfExist($this->serverroot, 'core/'.$style.'.css')
) {
return;
}
- $app = substr($style, 0, strpos($style, '/'));
$style = substr($style, strpos($style, '/')+1);
$app_path = \OC_App::getAppPath($app);
$app_url = \OC_App::getAppWebPath($app);
- $this->append($app_path, $style.'.css', $app_url);
+ if(!$this->cacheAndAppendScssIfExist($app_path, $style.'.scss', $app)) {
+ $this->append($app_path, $style.'.css', $app_url);
+ }
}
/**
@@ -80,21 +82,20 @@ class CSSResourceLocator extends ResourceLocator {
*
* @param string $root path to check
* @param string $file the filename
- * @param string|null $webRoot base for path, default map $root to $webRoot
* @return bool True if the resource was found and cached, false otherwise
*/
- protected function cacheAndAppendScssIfExist($root, $file, $webRoot = null) {
+ protected function cacheAndAppendScssIfExist($root, $file, $app = 'core') {
if (is_file($root.'/'.$file)) {
if($this->scssCacher !== null) {
- if($this->scssCacher->process($root, $file)) {
- $this->append($root, $this->scssCacher->getCachedSCSS('core', $file), $webRoot, false);
+ if($this->scssCacher->process($root, $file, $app)) {
+ $this->append($root, $this->scssCacher->getCachedSCSS($app, $file), false);
return true;
} else {
- $this->logger->error('Failed to compile and/or save '.$root.'/'.$file, ['app' => 'core']);
+ $this->logger->warning('Failed to compile and/or save '.$root.'/'.$file, ['app' => 'core']);
return false;
}
} else {
- $this->logger->error('Scss is disabled for '.$root.'/'.$file.', ignoring', ['app' => 'core']);
+ $this->logger->debug('Scss is disabled for '.$root.'/'.$file.', ignoring', ['app' => 'core']);
return true;
}
}