From 43d6dd8b1a4655f1aa5b642c0b3302166e39065e Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Mon, 29 Oct 2012 20:46:43 +0000 Subject: solved issue indicated by Michał Masłowski MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Application/Controllers/BaseController.php | 25 ++++++++++++---------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'h-source/Application') diff --git a/h-source/Application/Controllers/BaseController.php b/h-source/Application/Controllers/BaseController.php index 4b1246f..2355569 100644 --- a/h-source/Application/Controllers/BaseController.php +++ b/h-source/Application/Controllers/BaseController.php @@ -128,26 +128,29 @@ class BaseController extends Controller } //get the configuration xml - $xmlRes = $this->m['ParamsModel']->select('boxes_xml')->where(array('id_par'=>1))->toList('boxes_xml')->send(); - if (count($xmlRes)>0) + if (Website::$useXmlConfigFile) { - $configXml = htmlspecialchars_decode($xmlRes[0],ENT_QUOTES); - - if (Website::$useXmlConfigFile) + $xmlConfigFile = rtrim(Website::$xmlConfigFileFolder,'/') . '/config.xml'; + + if (@simplexml_load_file($xmlConfigFile)) { - $xmlConfigFile = rtrim(Website::$xmlConfigFileFolder,'/') . '/config.xml'; - if (@simplexml_load_file($xmlConfigFile)) - { - $this->_configXml = simplexml_load_file($xmlConfigFile); - } + $this->_configXml = simplexml_load_file($xmlConfigFile); } - else + } + else + { + $xmlRes = $this->m['ParamsModel']->select('boxes_xml')->where(array('id_par'=>1))->toList('boxes_xml')->send(); + + if (count($xmlRes)>0) { + $configXml = htmlspecialchars_decode($xmlRes[0],ENT_QUOTES); + if (@simplexml_load_string($configXml)) { $this->_configXml = simplexml_load_string($configXml); } } + } //elements of the top menu from the config.xml file -- cgit v1.2.3