|
@@ -86,6 +86,52 @@ class Config extends Backend
|
|
|
$this->view->assign('groupList', ConfigModel::getGroupList());
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
+ public function newindex()
|
|
|
+ {
|
|
|
+ $siteList = [];
|
|
|
+ $groupList = ConfigModel::newgetGroupList();
|
|
|
+ foreach ($groupList as $k => $v) {
|
|
|
+ $siteList[$k]['name'] = $k;
|
|
|
+ $siteList[$k]['title'] = $v;
|
|
|
+ $siteList[$k]['list'] = [];
|
|
|
+ }
|
|
|
+
|
|
|
+ foreach ($this->model->all() as $k => $v) {
|
|
|
+ if (!isset($siteList[$v['group']])) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ $value = $v->toArray();
|
|
|
+ $value['title'] = __($value['title']);
|
|
|
+ if (in_array($value['type'], ['select', 'selects', 'checkbox', 'radio'])) {
|
|
|
+ $value['value'] = explode(',', $value['value']);
|
|
|
+ }
|
|
|
+ $value['content'] = json_decode($value['content'], true);
|
|
|
+ if (in_array($value['name'], ['categorytype', 'configgroup', 'attachmentcategory'])) {
|
|
|
+ $dictValue = (array)json_decode($value['value'], true);
|
|
|
+ foreach ($dictValue as $index => &$item) {
|
|
|
+ $item = __($item);
|
|
|
+ }
|
|
|
+ unset($item);
|
|
|
+ $value['value'] = json_encode($dictValue, JSON_UNESCAPED_UNICODE);
|
|
|
+ }
|
|
|
+ $value['tip'] = htmlspecialchars($value['tip']);
|
|
|
+ if ($value['name'] == 'cdnurl') {
|
|
|
+ //cdnurl不支持在线修改
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ $siteList[$v['group']]['list'][] = $value;
|
|
|
+ }
|
|
|
+ $index = 0;
|
|
|
+ foreach ($siteList as $k => &$v) {
|
|
|
+ $v['active'] = !$index ? true : false;
|
|
|
+ $index++;
|
|
|
+ }
|
|
|
+ $this->view->assign('siteList', $siteList);
|
|
|
+ $this->view->assign('typeList', ConfigModel::getTypeList());
|
|
|
+ $this->view->assign('ruleList', ConfigModel::getRegexList());
|
|
|
+ $this->view->assign('groupList', ConfigModel::getGroupList());
|
|
|
+ return $this->view->fetch();
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 添加
|