From 18d366bda0201d22382795bda20d90d7d234ddd7 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Wed, 22 Jan 2014 14:36:37 +0200 Subject: [PATCH] fix config --- application/Espo/Controllers/Settings.php | 2 +- application/Espo/Core/Utils/Config.php | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/application/Espo/Controllers/Settings.php b/application/Espo/Controllers/Settings.php index 9a90c659ff..2ccc746872 100644 --- a/application/Espo/Controllers/Settings.php +++ b/application/Espo/Controllers/Settings.php @@ -9,7 +9,7 @@ class Settings extends \Espo\Core\Controllers\Base public function actionRead($params, $data) { - return $this->getConfig()->getJsonData($this->getUser()->isAdmin()); + return $this->getConfig()->getData($this->getUser()->isAdmin()); } public function actionPatch($params, $data) diff --git a/application/Espo/Core/Utils/Config.php b/application/Espo/Core/Utils/Config.php index 944538c23a..d49ef7613e 100644 --- a/application/Espo/Core/Utils/Config.php +++ b/application/Espo/Core/Utils/Config.php @@ -141,7 +141,7 @@ class Config * @param $isAdmin * @return object */ - public function getJsonData($isAdmin=false, $encode=true) + public function getData($isAdmin=false, $encode=true) { $configObj = $this->getConfig(); @@ -156,7 +156,6 @@ class Config return $restrictedConfig; } - //return Json::encode( Util::objectToArray($restrictedConfig) ); return Util::objectToArray($restrictedConfig); } @@ -168,9 +167,8 @@ class Config * @return bool */ //HERE - public function setJsonData($data, $isAdmin=false) + public function setData($data, $isAdmin=false) { - //$decoded= Json::decode($json, true); $restrictItems= $this->getRestrictItems($isAdmin); @@ -196,7 +194,6 @@ class Config } if (empty($this->adminItems)) { - //$this->adminItems= array_merge( (array) $this->getConfig()->systemItems, (array) $this->getConfig()->adminItems ); $this->adminItems= Util::merge( (array) $this->getConfig()->systemItems, (array) $this->getConfig()->adminItems ); } @@ -221,4 +218,4 @@ class Config } } -?> \ No newline at end of file +?>