\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->getId(); } } // 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 (empty($options[$modules[$i]])) { 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); if (is_array($options[$modules[$i]])) { foreach ($options[$modules[$i]] as $option) { $row->add($option, 12); } } else { $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->getId(); } } // check options $errors = checkConfigOptions($scopes, $options); $conf->set_moduleSettings($options); return $errors; } ?>