diff --git a/framework/control.class.php b/framework/control.class.php index 603b4a4264..4a90ff2b4a 100755 --- a/framework/control.class.php +++ b/framework/control.class.php @@ -237,7 +237,7 @@ class control } $modelClass = class_exists('ext' . $moduleName. 'model') ? 'ext' . $moduleName . 'model' : $moduleName . 'model'; - if(!class_exists($modelClass)) $this->app->error(" The model $modelClass not found", __FILE__, __LINE__, $exit = true); + if(!class_exists($modelClass)) $this->app->triggerError(" The model $modelClass not found", __FILE__, __LINE__, $exit = true); $this->$moduleName = new $modelClass(); $this->dao = $this->$moduleName->dao; @@ -300,7 +300,7 @@ class control $extHookFiles = glob($viewExtPath . $this->viewPrefix . $methodName . "*.{$viewType}.hook.php"); $viewFile = file_exists($extViewFile) ? $extViewFile : $mainViewFile; - if(!is_file($viewFile)) $this->app->error("the view file $viewFile not found", __FILE__, __LINE__, $exit = true); + if(!is_file($viewFile)) $this->app->triggerError("the view file $viewFile not found", __FILE__, __LINE__, $exit = true); if(!empty($extHookFiles)) return array('viewFile' => $viewFile, 'hookFiles' => $extHookFiles); return $viewFile; } @@ -542,14 +542,14 @@ class control $file2Included = file_exists($actionExtFile) ? $actionExtFile : $moduleControlFile; /* Load the control file. */ - if(!is_file($file2Included)) $this->app->error("The control file $file2Included not found", __FILE__, __LINE__, $exit = true); + if(!is_file($file2Included)) $this->app->triggerError("The control file $file2Included not found", __FILE__, __LINE__, $exit = true); $currentPWD = getcwd(); chdir(dirname($file2Included)); if($moduleName != $this->moduleName) helper::import($file2Included); /* Set the name of the class to be called. */ $className = class_exists("my$moduleName") ? "my$moduleName" : $moduleName; - if(!class_exists($className)) $this->app->error(" The class $className not found", __FILE__, __LINE__, $exit = true); + if(!class_exists($className)) $this->app->triggerError(" The class $className not found", __FILE__, __LINE__, $exit = true); /* Parse the params, create the $module control object. */ if(!is_array($params)) parse_str($params, $params); diff --git a/framework/model.class.php b/framework/model.class.php index fc0e4bd171..3a0cdef7b2 100755 --- a/framework/model.class.php +++ b/framework/model.class.php @@ -179,7 +179,7 @@ class model if(!helper::import($modelFile)) return false; $modelClass = class_exists('ext' . $moduleName. 'model') ? 'ext' . $moduleName . 'model' : $moduleName . 'model'; - if(!class_exists($modelClass)) $this->app->error(" The model $modelClass not found", __FILE__, __LINE__, $exit = true); + if(!class_exists($modelClass)) $this->app->triggerError(" The model $modelClass not found", __FILE__, __LINE__, $exit = true); $this->$moduleName = new $modelClass(); return $this->$moduleName; diff --git a/module/common/model.php b/module/common/model.php index e66967bd4b..cdc4ff39c9 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -55,7 +55,7 @@ class commonModel extends model else { $company = $this->loadModel('company')->getFirst(); - if(!$company) $this->app->error(sprintf($this->lang->error->companyNotFound, $httpHost), __FILE__, __LINE__, $exit = true); + if(!$company) $this->app->triggerError(sprintf($this->lang->error->companyNotFound, $httpHost), __FILE__, __LINE__, $exit = true); $this->session->set('company', $company); $this->app->company = $company; } diff --git a/module/file/control.php b/module/file/control.php index fa86a08ef0..a21994df07 100644 --- a/module/file/control.php +++ b/module/file/control.php @@ -88,7 +88,7 @@ class file extends control if($mode == 'open') { if(file_exists($file->realPath))$this->locate($file->webPath); - $this->app->error("The file you visit $fileID not found.", __FILE__, __LINE__, true); + $this->app->triggerError("The file you visit $fileID not found.", __FILE__, __LINE__, true); } else { @@ -101,7 +101,7 @@ class file extends control } else { - $this->app->error("The file you visit $fileID not found.", __FILE__, __LINE__, true); + $this->app->triggerError("The file you visit $fileID not found.", __FILE__, __LINE__, true); } } } @@ -293,16 +293,16 @@ class file extends control } /** - * Ajax replace editor image + * Paste image in kindeditor at firefox and chrome. * * @access public * @return void */ - public function ajaxEditorImage() + public function ajaxPasteImage() { if($_POST) { - $data = $this->file->replaceEditorImage($this->post->editor); + $data = $this->file->pasteImage($this->post->editor); echo str_replace('\"', '"', $data); } } diff --git a/module/mail/model.php b/module/mail/model.php index 294c146a49..09b15584d8 100644 --- a/module/mail/model.php +++ b/module/mail/model.php @@ -165,7 +165,7 @@ class mailModel extends model $this->mta = self::$instance; $this->mta->CharSet = $this->config->charset; $funcName = "set{$this->config->mail->mta}"; - if(!method_exists($this, $funcName)) $this->app->error("The MTA {$this->config->mail->mta} not supported now.", __FILE__, __LINE__, $exit = true); + if(!method_exists($this, $funcName)) $this->app->triggerError("The MTA {$this->config->mail->mta} not supported now.", __FILE__, __LINE__, $exit = true); $this->$funcName(); }