From 68baecc78c6fa524afaea64473c5652c2e2df52c Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Thu, 18 Feb 2010 14:55:21 +0000 Subject: [PATCH] + add setting module. --- trunk/module/setting/model.php | 46 ++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 trunk/module/setting/model.php diff --git a/trunk/module/setting/model.php b/trunk/module/setting/model.php new file mode 100644 index 0000000000..4bebd8853e --- /dev/null +++ b/trunk/module/setting/model.php @@ -0,0 +1,46 @@ +. + * + * @copyright Copyright: 2009 Chunsheng Wang + * @author Chunsheng Wang + * @package setting + * @version $Id$ + * @link http://www.zentao.cn + */ +?> +getItem('system', 'global', 'version'); + if($version) return $version; + return '0.3 beta'; + } + + /* 获得某一个配置项的值。*/ + public function getItem($owner, $section, $key) + { + return $this->dao->select('`value`')->from(TABLE_CONFIG) + ->where('company')->eq($this->app->company->id) + ->andWhere('owner')->eq($owner) + ->andWhere('section')->eq($section) + ->andWhere('`key`')->eq($key) + ->fetch('value'); + } +}