diff options
author | Antonio Gallo <tonicucoz@gmail.com> | 2012-09-12 05:57:28 +0000 |
---|---|---|
committer | Antonio Gallo <tonicucoz@gmail.com> | 2012-09-12 05:57:28 +0000 |
commit | 024de701df1e4ee5f7cc4b5139a490bd9477aae9 (patch) | |
tree | d58c0e2c00f9d42b65a8cb22cb7e27732f6e69ac /h-source/Application | |
parent | 93f681d5bd99d28acdb1e4c6eb3e5bbc4a6842bf (diff) |
the XML to configure the template can now be written inside the config.xml file
Diffstat (limited to 'h-source/Application')
-rw-r--r-- | h-source/Application/Controllers/BaseController.php | 16 | ||||
-rw-r--r-- | h-source/Application/Include/params.php | 7 |
2 files changed, 21 insertions, 2 deletions
diff --git a/h-source/Application/Controllers/BaseController.php b/h-source/Application/Controllers/BaseController.php index 9287cee..4a3bb65 100644 --- a/h-source/Application/Controllers/BaseController.php +++ b/h-source/Application/Controllers/BaseController.php @@ -131,9 +131,21 @@ class BaseController extends Controller if (count($xmlRes)>0) { $configXml = htmlspecialchars_decode($xmlRes[0],ENT_QUOTES); - if (@simplexml_load_string($configXml)) + + if (Website::$useXmlConfigFile) + { + $xmlConfigFile = rtrim(Website::$xmlConfigFileFolder,'/') . '/config.xml'; + if (@simplexml_load_file($xmlConfigFile)) + { + $this->_configXml = simplexml_load_file($xmlConfigFile); + } + } + else { - $this->_configXml = simplexml_load_string($configXml); + if (@simplexml_load_string($configXml)) + { + $this->_configXml = simplexml_load_string($configXml); + } } } diff --git a/h-source/Application/Include/params.php b/h-source/Application/Include/params.php index f09d647..3f905db 100644 --- a/h-source/Application/Include/params.php +++ b/h-source/Application/Include/params.php @@ -39,6 +39,13 @@ class Website static public $statusnetGroupText = ""; static public $useSMTP = true; + + //use a xml file the modules of the website? + static public $useXmlConfigFile = true; + + //folder of the xml configuration file + //the constant ROOT contains the path to the root folder of your installaton of h-source + static public $xmlConfigFileFolder = ROOT; } class Account |