1
0
mirror of https://github.com/flarum/core.git synced 2025-07-23 01:31:40 +02:00

Rough implementation of appearance settings

This commit is contained in:
Toby Zerner
2015-08-03 14:35:51 +09:30
parent 299bfc0e0a
commit 0657bf2d27
7 changed files with 173 additions and 8 deletions

View File

@@ -37,6 +37,14 @@ class UpdateConfigAction extends Action
$this->settings->set($k, $v);
}
$assetPath = public_path('assets');
$manifest = file_get_contents($assetPath . '/rev-manifest.json');
$revisions = json_decode($manifest, true);
foreach ($revisions as $file => $revision) {
@unlink($assetPath . '/' . substr_replace($file, '-' . $revision, strrpos($file, '.'), 0));
}
return $this->success();
}
}

View File

@@ -183,8 +183,8 @@ abstract class ClientAction extends HtmlAction
protected function getLessVariables()
{
return [
'config-primary-color' => $this->settings->get('theme_primary_color', '#000'),
'config-secondary-color' => $this->settings->get('theme_secondary_color', '#000'),
'config-primary-color' => $this->settings->get('theme_primary_color') ?: '#000',
'config-secondary-color' => $this->settings->get('theme_secondary_color') ?: '#000',
'config-dark-mode' => $this->settings->get('theme_dark_mode') ? 'true' : 'false',
'config-colored-header' => $this->settings->get('theme_colored_header') ? 'true' : 'false'
];