* fix the error of setItems().

This commit is contained in:
wangchunsheng
2013-01-11 03:11:44 +00:00
parent e702209015
commit 1e3adbf41a
+7 -3
View File
@@ -57,6 +57,7 @@ class settingModel extends model
if($level == 2) list($owner, $module, $key) = explode('.', $path);
if($level == 3) list($owner, $module, $section, $key) = explode('.', $path);
$item = new stdclass();
$item->company = $company === 'current' ? $this->app->company->id : $company;
$item->owner = $owner;
$item->module = $module;
@@ -77,7 +78,7 @@ class settingModel extends model
* @param string $path like system.mail
* @param array|object $items the items array or object, can be mixed by one level or two levels.
* @access public
* @return void
* @return bool
*/
public function setItems($path, $items, $company = 'current')
{
@@ -88,14 +89,17 @@ class settingModel extends model
$section = $key;
foreach($item as $subKey => $subItem)
{
$this->setItem($path . '.' . $section, $subKey, $subItem);
$this->setItem($path . '.' . $section . '.' . $subKey, $subItem);
}
}
else
{
$this->setItem($path, $key, $value);
$this->setItem($path . '.' . $key, $item);
}
}
if(!dao::isError()) return true;
return false;
}
/**