small fix

This commit is contained in:
Vincent Augagneur committed 2012-11-26 15:33:34 +01:00
1 parent 6080795f9e
commit ec4e6634d4
1 file changed
+11 -9
+11 -9
View File
@@ -511,7 +511,7 @@ abstract class ModuleCore
return false; return false;
} }
/** /**
* This function enable module $name. If an $name is an array, * This function enable module $name. If an $name is an array,
* this will enable all of them * this will enable all of them
@@ -525,10 +525,12 @@ abstract class ModuleCore
// If $name is not an array, we set it as an array // If $name is not an array, we set it as an array
if (!is_array($name)) if (!is_array($name))
$name = array($name); $name = array($name);
$res = true;
// Enable each module // Enable each module
foreach ($name as $k => $v) foreach ($name as $n)
Module::getInstanceByName($name)->enable(); if (Validate::isModuleName($n))
$res &= Module::getInstanceByName($n)->enable();
return $res;
} }
/** /**
@@ -574,12 +576,12 @@ abstract class ModuleCore
// If $name is not an array, we set it as an array // If $name is not an array, we set it as an array
if (!is_array($name)) if (!is_array($name))
$name = array($name); $name = array($name);
$res = true;
// Disable each module // Disable each module
foreach ($name as $k => $v) foreach ($name as $n)
Module::getInstanceByName($name)->disable(); if (Validate::isModuleName($n))
$res &= Module::getInstanceByName($n)->disable();
return true; return $res;
} }
/** /**