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:
@@ -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
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user