Corrige la récupération d'un module

This commit is contained in:
Clement Desmidt 2016-11-21 23:03:59 +01:00
parent 835fbf8a46
commit 56e63ed73e

View File

@ -61,10 +61,10 @@ class AccueilModules
*/ */
public static function getModule($module) public static function getModule($module)
{ {
if ($config = simplexml_load_file('../' . self::CONFIG_FILE)) { if ($config = simplexml_load_file(__DIR__.'/../'.self::CONFIG_FILE)) {
$config_xml = $config->item; foreach ($config->item as $item) {
foreach ($config_xml as $item) { $item_id = (string) $item['id'];
if ($item["id"] == $module) { if ($item_id == $module) {
$params = array(); $params = array();
foreach ($item as $confParam) { foreach ($item as $confParam) {
$params[$confParam->getName()] = "$confParam"; $params[$confParam->getName()] = "$confParam";