\n"; printJsIncludes('../..'); printConfigurationPageHeaderBar($conf); // print error messages for ($i = 0; $i < sizeof($errorsToDisplay); $i++) call_user_func_array('StatusMessage', $errorsToDisplay[$i]); echo ("
\n"); printConfigurationPageTabs(ConfigurationPageTab::MODULE_SETTINGS); ?> getConfiguredTypes(); // get list of scopes of modules $scopes = array(); 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 $options = getConfigOptions($scopes); // get current setting $old_options = $conf->get_moduleSettings(); // display module boxes $tabindex = 1; $modules = array_keys($options); $_SESSION['conf_types'] = array(); for ($i = 0; $i < sizeof($modules); $i++) { if (sizeof($options[$modules[$i]]) < 1) continue; $module = moduleCache::getModule($modules[$i], 'none'); $iconImage = $module->getIcon(); if ($iconImage != null) { if (!(strpos($iconImage, 'http') === 0) && !(strpos($iconImage, '/') === 0)) { $iconImage = '../../graphics/' . $iconImage; } } $row = new htmlResponsiveRow(); $row->add(new htmlSubTitle(getModuleAlias($modules[$i], "none"), $iconImage, null, true), 12); $row->add($options[$modules[$i]], 12); $configTypes = parseHtml($modules[$i], $row, $old_options, false, $tabindex, 'none'); $_SESSION['conf_types'] = array_merge($configTypes, $_SESSION['conf_types']); echo "
"; } echo "\n"; echo ""; $buttonContainer = new htmlTable(); $buttonContainer->addElement(new htmlSpacer(null, '10px'), true); $saveButton = new htmlButton('saveSettings', _('Save')); $saveButton->setIconClass('saveButton'); $buttonContainer->addElement($saveButton); $cancelButton = new htmlButton('cancelSettings', _('Cancel')); $cancelButton->setIconClass('cancelButton'); $buttonContainer->addElement($cancelButton, true); $buttonContainer->addElement(new htmlSpacer(null, '10px'), true); parseHtml(null, $buttonContainer, array(), false, $tabindex, 'none'); if ((sizeof($errorsToDisplay) == 0) && isset($_POST['scrollPositionTop']) && isset($_POST['scrollPositionLeft'])) { // scroll to last position echo ''; } echo "
\n"; echo "\n"; echo "\n"; /** * Checks user input and saves the entered settings. * * @return array list of errors */ function checkInput() { if (!isset($_POST['postAvailable'])) { return array(); } $conf = &$_SESSION['conf_config']; $typeManager = new \LAM\TYPES\TypeManager($conf); $types = $typeManager->getConfiguredTypes(); // check module options // create option array to check and save $options = extractConfigOptionsFromPOST($_SESSION['conf_types']); // get list of scopes of modules $scopes = array(); 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); $conf->set_moduleSettings($options); return $errors; } ?>