From 23c125100925fe2792409c45d09b139e320225e4 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Thu, 29 Dec 2016 19:39:34 +0100 Subject: [PATCH] new type API --- lam/templates/config/moduleSettings.php | 29 +++++++++++++++++-------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/lam/templates/config/moduleSettings.php b/lam/templates/config/moduleSettings.php index 60813a1d..0301005d 100644 --- a/lam/templates/config/moduleSettings.php +++ b/lam/templates/config/moduleSettings.php @@ -1,4 +1,9 @@ get_ActiveTypes(); +$typeManager = new \LAM\TYPES\TypeManager($conf); +$types = $typeManager->getConfiguredTypes(); // get list of scopes of modules $scopes = array(); -for ($m = 0; $m < sizeof($types); $m++) { - $mods = $conf->get_AccountModules($types[$m]); - for ($i = 0; $i < sizeof($mods); $i++) $scopes[$mods[$i]][] = $types[$m]; +foreach ($types as $type) { + $mods = $conf->get_AccountModules($type->getId()); + for ($i = 0; $i < sizeof($mods); $i++) { + $scopes[$mods[$i]][] = $type->getScope(); + } } // get module options @@ -281,7 +289,8 @@ function checkInput() { return array(); } $conf = &$_SESSION['conf_config']; - $types = $conf->get_ActiveTypes(); + $typeManager = new \LAM\TYPES\TypeManager($conf); + $types = $typeManager->getConfiguredTypes(); // check module options // create option array to check and save @@ -289,9 +298,11 @@ function checkInput() { // get list of scopes of modules $scopes = array(); - for ($m = 0; $m < sizeof($types); $m++) { - $mods = $conf->get_AccountModules($types[$m]); - for ($i = 0; $i < sizeof($mods); $i++) $scopes[$mods[$i]][] = $types[$m]; + foreach ($types as $type) { + $mods = $conf->get_AccountModules($type->getId()); + for ($i = 0; $i < sizeof($mods); $i++) { + $scopes[$mods[$i]][] = $type->getScope(); + } } // check options $errors = checkConfigOptions($scopes, $options);