From bf09d39eb210dd10a9f43ffba3129532b1a0d4ef Mon Sep 17 00:00:00 2001 From: ChuJilu Date: Fri, 10 Oct 2014 09:35:33 +0800 Subject: [PATCH] * Add the config of view prefix. --- config/config.php | 3 +++ framework/control.class.php | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config/config.php b/config/config.php index 6ec147ee15..06b581c18b 100644 --- a/config/config.php +++ b/config/config.php @@ -66,6 +66,9 @@ $config->file = new stdclass(); $config->file->dangers = 'php,php3,php4,phtml,php5,jsp,py,rb,asp,asa,cer,cdx,aspl'; // Dangerous files. $config->file->maxSize = 1024 * 1024; // Max size. +/* View type settings. */ +$config->viewPrefix['mhtml'] = 'm'; + /* Master database settings. */ $config->db = new stdclass(); $config->db->persistant = false; // Pconnect or not. diff --git a/framework/control.class.php b/framework/control.class.php index 4a90ff2b4a..4d18d4c99c 100755 --- a/framework/control.class.php +++ b/framework/control.class.php @@ -269,7 +269,7 @@ class control public function setViewPrefix() { $this->viewPrefix = ''; - if($this->viewType == 'mhtml') $this->viewPrefix = 'm.'; + if(isset($this->config->viewPrefix[$this->viewType])) $this->viewPrefix = $this->config->viewPrefix[$this->viewType] . '.'; } //-------------------- View related methods --------------------// @@ -292,7 +292,7 @@ class control /* Set infix for view file in mobile or pc. */ $viewType = $this->viewType; - if($this->viewType == 'mhtml') $viewType = 'html'; + if(isset($this->config->viewPrefix[$this->viewType])) $viewType = 'html'; /* The main view file, extension view file and hook file. */ $mainViewFile = $modulePath . 'view' . $this->pathFix . $this->viewPrefix . $methodName . '.' . $viewType . '.php';