From 4549e19e5da4e12ef92fcfb52d3c0561aab4e70c Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 9 Mar 2023 11:30:39 +0800 Subject: [PATCH] * adjust for editor. --- module/editor/control.php | 2 ++ module/editor/css/extend.css | 1 + module/editor/model.php | 13 ++++++++++--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/module/editor/control.php b/module/editor/control.php index 5e94e2d125..f3956a5ffd 100644 --- a/module/editor/control.php +++ b/module/editor/control.php @@ -50,6 +50,8 @@ class editor extends control */ public function extend($moduleDir = '') { + if(!isset($this->lang->{$moduleDir}->common)) $this->app->loadLang($moduleDir); + $moduleFiles = $this->editor->getModuleFiles($moduleDir); $this->view->module = $moduleDir; $this->view->tree = $this->editor->printTree($moduleFiles); diff --git a/module/editor/css/extend.css b/module/editor/css/extend.css index e019a90efa..a9ad22f8ae 100644 --- a/module/editor/css/extend.css +++ b/module/editor/css/extend.css @@ -3,3 +3,4 @@ body{padding-bottom:0px;background-color:#fff;} .collapsable > ul {display: block!important} .tree li:before {margin-right: 4px;} .tree li>a{display:inline;} +.main-content{padding: 0px; padding-top: 20px;} diff --git a/module/editor/model.php b/module/editor/model.php index df5ef584e4..4598e6838f 100644 --- a/module/editor/model.php +++ b/module/editor/model.php @@ -25,6 +25,7 @@ class editorModel extends model foreach($this->config->editor->sort as $name) { $moduleFullFile = $modulePath . $name; + if(!file_exists($moduleFullFile)) continue; if($name == 'control.php' or $name == 'model.php') { $allModules[$modulePath][$moduleFullFile] = $this->analysis($moduleFullFile); @@ -204,9 +205,15 @@ class editorModel extends model { $tree = ''; $fileName = basename($filePath); - $file = "$fileName"; - if(isset($this->lang->editor->modules[$fileName])) $file = "" . $this->lang->editor->modules[$fileName] . ''; - if(isset($this->lang->editor->translate[$fileName])) $file = "" . $this->lang->editor->translate[$fileName] . ''; + if(isset($this->lang->editor->translate[$fileName])) + { + $file = "" . $this->lang->editor->translate[$fileName] . ''; + } + else + { + $moduleName = zget($this->lang->editor->modules, $fileName, isset($this->lang->{$fileName}->common) ? $this->lang->{$fileName}->common : $fileName); + $file = "{$moduleName}"; + } if(strpos($filePath, DS . 'ext' . DS) !== false) {