diff --git a/lam/lib/modules/authorizedServiceObject.inc b/lam/lib/modules/authorizedServiceObject.inc index 3dd8e52a..baddfb72 100644 --- a/lam/lib/modules/authorizedServiceObject.inc +++ b/lam/lib/modules/authorizedServiceObject.inc @@ -4,7 +4,7 @@ $Id$ This code is not yet part of LDAP Account Manager (http://www.ldap-account-manager.org/) Copyright (C) 2011 J de Jong - 2012 - 2015 Roland Gruber + 2012 - 2017 Roland Gruber This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -94,10 +94,6 @@ class authorizedServiceObject extends baseModule { "Text" => _("These services will show up as hint if you enter a new service.") ) ); - // config options - $configContainer = new htmlTable(); - $configContainer->addElement(new htmlTableExtendedInputTextarea('authorizedServiceObject_services', "sshd\r\nimap", 30, 5, _('Predefined services'), 'predefinedServices')); - $return['config_options']['all'] = $configContainer; // upload fields $return['upload_columns'] = array( array( @@ -252,6 +248,16 @@ class authorizedServiceObject extends baseModule { } } + /** + * {@inheritDoc} + * @see baseModule::get_configOptions() + */ + public function get_configOptions($scopes, $allScopes) { + $configContainer = new htmlResponsiveRow(); + $configContainer->add(new htmlResponsiveInputTextarea('authorizedServiceObject_services', "sshd\r\nimap", 30, 5, _('Predefined services'), 'predefinedServices'), 12); + return $configContainer; + } + } ?> diff --git a/lam/lib/modules/inetOrgPerson.inc b/lam/lib/modules/inetOrgPerson.inc index 5370ac20..e85bae05 100644 --- a/lam/lib/modules/inetOrgPerson.inc +++ b/lam/lib/modules/inetOrgPerson.inc @@ -3625,19 +3625,9 @@ class inetOrgPerson extends baseModule implements passwordService { } /** - * Returns a list of configuration options. - * - * Calling this method does not require the existence of an enclosing {@link accountContainer}.
- *
- * The field names are used as keywords to load and save settings. - * We recommend to use the module name as prefix for them (e.g. posixAccount_homeDirectory) to avoid naming conflicts. - * - * @param array $scopes account types (user, group, host) - * @param array $allScopes list of all active account modules and their scopes (module => array(scopes)) - * @return mixed htmlElement or array of htmlElement - * - * @see htmlElement - */ + * {@inheritDoc} + * @see baseModule::get_configOptions() + */ public function get_configOptions($scopes, $allScopes) { $return = parent::get_configOptions($scopes, $allScopes); // configuration settings diff --git a/lam/lib/modules/windowsGroup.inc b/lam/lib/modules/windowsGroup.inc index 91bd8a8b..dc9e84f8 100644 --- a/lam/lib/modules/windowsGroup.inc +++ b/lam/lib/modules/windowsGroup.inc @@ -165,20 +165,6 @@ class windowsGroup extends baseModule { "Text" => _('NIS domain name.') ), ); - // configuration settings - $configContainer = new htmlTable(); - $configContainerHead = new htmlTable(); - $configContainerHead->addElement(new htmlOutputText(_('Hidden options'))); - $configContainerHead->addElement(new htmlHelpLink('hiddenOptions')); - $configContainerOptions = new htmlTable(); - $configContainer->addElement($configContainerHead, true); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('windowsGroup_hidemail', false, _('Email address'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('windowsGroup_hidemanagedBy', false, _('Managed by'), null, false)); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('windowsGroup_hidemsSFU30Name', true, _('NIS name'), null, false)); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('windowsGroup_hidemsSFU30NisDomain', true, _('NIS domain'), null, false)); - $configContainer->addElement($configContainerOptions, true); - $return['config_options']['all'] = $configContainer; // upload fields $return['upload_columns'] = array( array( @@ -1104,6 +1090,26 @@ class windowsGroup extends baseModule { return $effectiveMembers; } + /** + * {@inheritDoc} + * @see baseModule::get_configOptions() + */ + public function get_configOptions($scopes, $allScopes) { + $configContainer = new htmlResponsiveRow(); + $configContainerHead = new htmlGroup(); + $configContainerHead->addElement(new htmlOutputText(_('Hidden options'))); + $configContainerHead->addElement(new htmlHelpLink('hiddenOptions')); + $configContainer->add($configContainerHead, 12); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsGroup_hidemail', false, _('Email address'), null, false), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsGroup_hidemanagedBy', false, _('Managed by'), null, false), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsGroup_hidemsSFU30Name', true, _('NIS name'), null, false), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsGroup_hidemsSFU30NisDomain', true, _('NIS domain'), null, false), 12, 4); + for ($i = 0; $i < 2; $i++) { + $configContainer->add(new htmlOutputText(''), 0, 4); + } + return $configContainer; + } + } diff --git a/lam/templates/config/confmain.php b/lam/templates/config/confmain.php index f1490a5b..375a68a2 100644 --- a/lam/templates/config/confmain.php +++ b/lam/templates/config/confmain.php @@ -183,7 +183,7 @@ printConfigurationPageTabs(ConfigurationPageTab::GENERAL); $row = new htmlResponsiveRow(); -$serverSettings = new htmlSubTitle(_("Server settings"), '../../graphics/schemaBrowser.png'); +$serverSettings = new htmlSubTitle(_("Server settings"), '../../graphics/profiles.png', null, true); $row->add($serverSettings, 12); // server URL $urlInput = new htmlResponsiveInputField(_("Server address"), 'serverurl', $conf->get_ServerURL(), '201'); @@ -236,7 +236,7 @@ $row->add($advancedOptions, 12); $row->addVerticalSpacer('2rem'); // language -$row->add(new htmlSubTitle(_("Language settings"), '../../graphics/languageSmall.png'), 12); +$row->add(new htmlSubTitle(_("Language settings"), '../../graphics/language.png', null, true), 12); // read available languages $possibleLanguages = getLanguages(); $defaultLanguage = array('en_GB.utf8'); @@ -271,7 +271,7 @@ $row->add(new htmlResponsiveSelect('timeZone', $timezones, array($conf->getTimeZ $row->addVerticalSpacer('2rem'); // lamdaemon settings -$row->add(new htmlSubTitle(_("Lamdaemon settings"), '../../graphics/lamdaemonSmall.png'), 12); +$row->add(new htmlSubTitle(_("Lamdaemon settings"), '../../graphics/lamdaemon.png', null, true), 12); $row->add(new htmlResponsiveInputField(_("Server list"), 'scriptservers', $conf->get_scriptServers(), '218'), 12); $row->add(new htmlResponsiveInputField(_("Path to external script"), 'scriptpath', $conf->get_scriptPath(), '210'), 12); @@ -313,7 +313,7 @@ $row->addVerticalSpacer('2rem'); // LAM Pro settings if (isLAMProVersion()) { // password reset page - $row->add(new htmlSubTitle(_("Password reset page settings"), '../../graphics/key.png'), 12); + $row->add(new htmlSubTitle(_("Password reset page settings"), '../../graphics/keyBig.png', null, true), 12); $pwdResetAllowSpecific = true; if ($conf->getPwdResetAllowSpecificPassword() == 'false') { @@ -345,7 +345,7 @@ if (isLAMProVersion()) { $row->addVerticalSpacer('2rem'); // mail settings - $row->add(new htmlSubTitle(_("Password mail settings"), '../../graphics/mail.png'), 12); + $row->add(new htmlSubTitle(_("Password mail settings"), '../../graphics/mailBig.png', null, true), 12); $pwdMailFrom = new htmlResponsiveInputField(_('From address'), 'pwdResetMail_from', $conf->getLamProMailFrom(), '550'); $row->add($pwdMailFrom, 12); @@ -375,7 +375,7 @@ if (isLAMProVersion()) { } // tool settings -$row->add(new htmlSubTitle(_("Tool settings"), '../../graphics/tools.png'), 12); +$row->add(new htmlSubTitle(_("Tool settings"), '../../graphics/bigTools.png',null, true), 12); $toolSettings = $conf->getToolSettings(); $row->add(new htmlOutputText(_('Hidden tools')), 12); $row->addVerticalSpacer('0.5rem'); @@ -392,7 +392,8 @@ for ($i = 0; $i < sizeof($tools); $i++) { } } $toolSettingsContent = new htmlResponsiveRow(); -for ($r = 0; $r < (sizeof($tools)); $r++) { +$toolsSize = sizeof($tools); +for ($r = 0; $r < $toolsSize; $r++) { $tool = $tools[$r]; $toolClass = get_class($tool); $toolName = substr($toolClass, strrpos($toolClass, '\\') + 1); @@ -400,14 +401,17 @@ for ($r = 0; $r < (sizeof($tools)); $r++) { if (isset($toolSettings['tool_hide_' . $toolName]) && ($toolSettings['tool_hide_' . $toolName] === 'true')) { $selected = true; } - $toolSettingsContent->add(new htmlResponsiveInputCheckbox('tool_hide_' . $toolName, $selected, $tool->getName(), null, false), 12); + $toolSettingsContent->add(new htmlResponsiveInputCheckbox('tool_hide_' . $toolName, $selected, $tool->getName(), null, false), 12, 4); +} +for ($i = $toolsSize % 3; $i < 3; $i++) { + $toolSettingsContent->add(new htmlOutputText(''), 0, 4); } $row->add($toolSettingsContent, 12); $row->addVerticalSpacer('2rem'); // security setings -$row->add(new htmlSubTitle(_("Security settings"), '../../graphics/lock.png'), 12); +$row->add(new htmlSubTitle(_("Security settings"), '../../graphics/security.png', null, true), 12); // login method $loginOptions = array( _('Fixed list') => LAMConfig::LOGIN_LIST, @@ -477,7 +481,7 @@ if (extension_loaded('curl')) { } // new password -$row->add(new htmlSubTitle(_("Profile password")), 12); +$row->add(new htmlSubTitle(_("Profile password"), '../../graphics/keyBig.png', null, true), 12); $password1 = new htmlResponsiveInputField(_("New password"), 'passwd1', null, '212'); $password1->setIsPassword(true); $password2 = new htmlResponsiveInputField(_("Reenter password"), 'passwd2'); diff --git a/lam/templates/config/moduleSettings.php b/lam/templates/config/moduleSettings.php index ad9eaa1f..c119c926 100644 --- a/lam/templates/config/moduleSettings.php +++ b/lam/templates/config/moduleSettings.php @@ -4,6 +4,8 @@ use \moduleCache; use \htmlSpacer; use \htmlTable; use \htmlButton; +use \htmlResponsiveRow; +use \htmlSubTitle; /* $Id$ @@ -104,40 +106,9 @@ if (isset($_POST['saveSettings']) || isset($_POST['editmodules']) $allTypes = \LAM\TYPES\getTypes(); echo $_SESSION['header']; - -echo "" . _("LDAP Account Manager Configuration") . "\n"; - -// include all CSS files -$cssDirName = dirname(__FILE__) . '/../../style'; -$cssDir = dir($cssDirName); -$cssFiles = array(); -$cssEntry = $cssDir->read(); -while ($cssEntry !== false) { - if (substr($cssEntry, strlen($cssEntry) - 4, 4) == '.css') { - $cssFiles[] = $cssEntry; - } - $cssEntry = $cssDir->read(); -} -sort($cssFiles); -foreach ($cssFiles as $cssEntry) { - echo "\n"; -} - -echo "\n"; -echo "\n"; -echo "\n"; -// include all JavaScript files -$jsDirName = dirname(__FILE__) . '/../lib'; -$jsDir = dir($jsDirName); -$jsFiles = array(); -while ($jsEntry = $jsDir->read()) { - if (substr($jsEntry, strlen($jsEntry) - 3, 3) != '.js') continue; - $jsFiles[] = $jsEntry; -} -sort($jsFiles); -foreach ($jsFiles as $jsEntry) { - echo "\n"; -} +printHeaderContents(_("LDAP Account Manager Configuration"), '../..'); +echo "\n"; +printJsIncludes('../..'); printConfigurationPageHeaderBar($conf); // print error messages @@ -179,20 +150,18 @@ $modules = array_keys($options); $_SESSION['conf_types'] = array(); for ($i = 0; $i < sizeof($modules); $i++) { if (sizeof($options[$modules[$i]]) < 1) continue; - echo "
\n"; - $icon = ''; $module = moduleCache::getModule($modules[$i], 'none'); $iconImage = $module->getIcon(); if ($iconImage != null) { if (!(strpos($iconImage, 'http') === 0) && !(strpos($iconImage, '/') === 0)) { $iconImage = '../../graphics/' . $iconImage; } - $icon = '' . $iconImage . ' '; } - echo "$icon" . getModuleAlias($modules[$i], "none") . "\n"; - $configTypes = parseHtml($modules[$i], $options[$modules[$i]], $old_options, false, $tabindex, 'none'); + $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 "
\n"; echo "
"; }