mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 09:39:10 +08:00
update: theme config
This commit is contained in:
parent
99311e12a5
commit
0490e38239
@ -62,7 +62,8 @@ class ThemeController extends Controller
|
|||||||
if (!$payload['config'] || !is_array($payload['config'])) abort(500, '参数有误');
|
if (!$payload['config'] || !is_array($payload['config'])) abort(500, '参数有误');
|
||||||
$themeConfigFile = public_path("theme/{$payload['name']}/config.php");
|
$themeConfigFile = public_path("theme/{$payload['name']}/config.php");
|
||||||
if (!File::exists($themeConfigFile)) abort(500, '主题不存在');
|
if (!File::exists($themeConfigFile)) abort(500, '主题不存在');
|
||||||
$themeConfig = include($themeConfigFile);
|
$themeConfig = json_decode(File::get($themeConfigFile), true);
|
||||||
|
if (!isset($themeConfig['configs']) || !is_array($themeConfig)) abort(500, '主题配置文件有误');
|
||||||
$validateFields = array_column($themeConfig['configs'], 'field_name');
|
$validateFields = array_column($themeConfig['configs'], 'field_name');
|
||||||
$config = [];
|
$config = [];
|
||||||
foreach ($validateFields as $validateField) {
|
foreach ($validateFields as $validateField) {
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
"field_type": "select",
|
"field_type": "select",
|
||||||
"select_options": {
|
"select_options": {
|
||||||
"light": "亮",
|
"light": "亮",
|
||||||
"dark": "暗",
|
"dark": "暗"
|
||||||
},
|
},
|
||||||
"default_value": "light"
|
"default_value": "light"
|
||||||
}, {
|
}, {
|
||||||
|
Loading…
Reference in New Issue
Block a user