1
0
mirror of https://github.com/typemill/typemill.git synced 2025-08-01 11:50:28 +02:00

Update readme and fix customcss in themes

This commit is contained in:
trendschau
2023-11-12 14:37:22 +01:00
parent 0ffb49b411
commit 39bab49d13
4 changed files with 65 additions and 39 deletions

View File

@@ -35,6 +35,9 @@ class ControllerApiSystemThemes extends Controller
return $response->withHeader('Content-Type', 'application/json')->withStatus(400);
}
# delete themecss
unset($validatedOutput['customcss']);
$themedata['themes'][$themename] = $validatedOutput;
# store updated settings here

View File

@@ -55,7 +55,8 @@ class Extension
}
$themeSettings[$themename] = $themeinputs;
$themeSettings[$themename]['customcss'] = $this->storage->getFile('cacheFolder', '', $themename . '-custom.css');
$customcss = $this->storage->getFile('cacheFolder', '', $themename . '-custom.css');
$themeSettings[$themename]['customcss'] = $customcss ? $customcss : '';
}
return $themeSettings;

View File

@@ -158,9 +158,19 @@ class Settings
public function updateThemeCss(string $name, string $css)
{
if($this->storage->writeFile('cacheFolder', '', $name . '-custom.css', $css))
if($css == '')
{
return true;
if($this->storage->deleteFile('cacheFolder', '', $name . '-custom.css', $css))
{
return true;
}
}
else
{
if($this->storage->writeFile('cacheFolder', '', $name . '-custom.css', $css))
{
return true;
}
}
return false;