The module config (config.module.php) of a module is now available through $this->cfg

This commit is contained in:
Abel Hoogeveen 2015-08-02 18:40:00 +02:00
parent 02b3438623
commit d27af90a8f
1 changed files with 8 additions and 0 deletions

View File

@ -102,6 +102,14 @@ class Modules extends Bus{
$CLASS->setModuleName($name);
}
if (method_exists($CLASS, 'setModuleConfig')) {
// Append the config file to the module CFG (accessable through $this->cfg)
if (file_exists($cfg->directory . "/" . "config.".strtolower($cfg->module_name).".php")) {
$data = (object) include($cfg->directory . "/" . "config.".strtolower($cfg->module_name).".php");
foreach ($data as $key => $value) {
$cfg->$key = $value;
}
}
$CLASS->setModuleConfig($cfg);
}