From 99f54fc9557c3862cdf66888bd19c38d89b66b4d Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 9 Mar 2023 10:54:41 +0800 Subject: [PATCH 1/3] * fix bug #32738. --- module/dev/view/editor.html.php | 2 +- module/editor/control.php | 2 +- module/editor/view/index.html.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module/dev/view/editor.html.php b/module/dev/view/editor.html.php index d0710305f0..16a0229441 100644 --- a/module/dev/view/editor.html.php +++ b/module/dev/view/editor.html.php @@ -15,7 +15,7 @@
dev->noteEditor; - if(common::hasPriv('editor', 'switch')) echo html::a($this->createLink('editor', 'switch', 'status=1'), $lang->dev->switchList[1], 'hiddenwin', "class='btn btn-primary'"); + if(common::hasPriv('editor', 'switch')) echo html::a($this->createLink('editor', 'switch', 'status=1'), $lang->dev->switchList[1], '', "class='btn btn-primary'"); ?>
diff --git a/module/editor/control.php b/module/editor/control.php index 5ea09122ec..5e94e2d125 100644 --- a/module/editor/control.php +++ b/module/editor/control.php @@ -200,6 +200,6 @@ class editor extends control $this->loadModel('setting')->setItem('system.common.global.editor', $status); $link = empty($status) ? $this->createLink('dev', 'editor') : $this->createLink('editor', 'index'); - return print(js::locate($link, 'parent')); + return print(js::locate($link)); } } diff --git a/module/editor/view/index.html.php b/module/editor/view/index.html.php index 52ad67d1a1..35bf66b4ef 100644 --- a/module/editor/view/index.html.php +++ b/module/editor/view/index.html.php @@ -16,7 +16,7 @@
editor->turnOff; - echo html::a($this->createLink('editor', 'switch', 'status=0'), $lang->dev->switchList['0'], 'hiddenwin', "class='btn btn-sm'"); + echo html::a($this->createLink('editor', 'switch', 'status=0'), $lang->dev->switchList['0'], '', "class='btn btn-sm'"); ?>
From 4549e19e5da4e12ef92fcfb52d3c0561aab4e70c Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 9 Mar 2023 11:30:39 +0800 Subject: [PATCH 2/3] * 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) { From 7ed3f67bb5aaa032fc5b534e55479342227d9110 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 9 Mar 2023 14:01:58 +0800 Subject: [PATCH 3/3] * fix bug for php 5.6. --- module/dev/view/editor.html.php | 2 +- module/editor/control.php | 2 +- module/editor/view/index.html.php | 4 ++-- module/mail/config.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/module/dev/view/editor.html.php b/module/dev/view/editor.html.php index 16a0229441..f905338d56 100644 --- a/module/dev/view/editor.html.php +++ b/module/dev/view/editor.html.php @@ -15,7 +15,7 @@
dev->noteEditor; - if(common::hasPriv('editor', 'switch')) echo html::a($this->createLink('editor', 'switch', 'status=1'), $lang->dev->switchList[1], '', "class='btn btn-primary'"); + if(common::hasPriv('editor', 'turnon')) echo html::a($this->createLink('editor', 'turnon', 'status=1'), $lang->dev->switchList[1], '', "class='btn btn-primary'"); ?>
diff --git a/module/editor/control.php b/module/editor/control.php index f3956a5ffd..4186dee101 100644 --- a/module/editor/control.php +++ b/module/editor/control.php @@ -197,7 +197,7 @@ class editor extends control * @access public * @return void */ - public function switch($status) + public function turnon($status) { $this->loadModel('setting')->setItem('system.common.global.editor', $status); diff --git a/module/editor/view/index.html.php b/module/editor/view/index.html.php index 35bf66b4ef..17fdfa33b9 100644 --- a/module/editor/view/index.html.php +++ b/module/editor/view/index.html.php @@ -11,12 +11,12 @@ */ ?> getModuleRoot() . 'dev/view/header.html.php';?> - + diff --git a/module/mail/config.php b/module/mail/config.php index 2fbfa040cb..16d3e0b39b 100644 --- a/module/mail/config.php +++ b/module/mail/config.php @@ -10,7 +10,7 @@ $config->mail->fromAddress = ''; // The from address. $config->mail->fromName = ''; // The from name. $config->mail->mta = 'smtp'; // The send mail type. $config->mail->smtp->debug = 0; // Debug level, 0,1,2. -$config->mail->smtp->charset = 'utf-8'; // Charset +$config->mail->smtp->charset = 'utf-8'; // Charset $config->mail->smtp->auth = true; // Need auth or not. true|false $config->mail->smtp->host = 'localhost';// The smtp server host address. $config->mail->smtp->port = '25'; // The smtp server host port.