Browse Source

Corrige la récupération d'un module

Clement Desmidt 2 years ago
parent
commit
56e63ed73e
1 changed files with 4 additions and 4 deletions
  1. 4
    4
      class/AccueilModules.php

+ 4
- 4
class/AccueilModules.php View File

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

Loading…
Cancel
Save