responsive settings

This commit is contained in:
Roland Gruber 2017-11-25 11:39:34 +01:00
parent 2d991a420d
commit 86a2a1c8de
5 changed files with 57 additions and 82 deletions

View File

@ -4,7 +4,7 @@ $Id$
This code is not yet part of LDAP Account Manager (http://www.ldap-account-manager.org/) This code is not yet part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2011 J de Jong 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 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 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.") "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 // upload fields
$return['upload_columns'] = array( $return['upload_columns'] = array(
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;
}
} }
?> ?>

View File

@ -3625,19 +3625,9 @@ class inetOrgPerson extends baseModule implements passwordService {
} }
/** /**
* Returns a list of configuration options. * {@inheritDoc}
* * @see baseModule::get_configOptions()
* Calling this method does not require the existence of an enclosing {@link accountContainer}.<br> */
* <br>
* 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
*/
public function get_configOptions($scopes, $allScopes) { public function get_configOptions($scopes, $allScopes) {
$return = parent::get_configOptions($scopes, $allScopes); $return = parent::get_configOptions($scopes, $allScopes);
// configuration settings // configuration settings

View File

@ -165,20 +165,6 @@ class windowsGroup extends baseModule {
"Text" => _('NIS domain name.') "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 // upload fields
$return['upload_columns'] = array( $return['upload_columns'] = array(
array( array(
@ -1104,6 +1090,26 @@ class windowsGroup extends baseModule {
return $effectiveMembers; 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;
}
} }

View File

@ -183,7 +183,7 @@ printConfigurationPageTabs(ConfigurationPageTab::GENERAL);
$row = new htmlResponsiveRow(); $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); $row->add($serverSettings, 12);
// server URL // server URL
$urlInput = new htmlResponsiveInputField(_("Server address"), 'serverurl', $conf->get_ServerURL(), '201'); $urlInput = new htmlResponsiveInputField(_("Server address"), 'serverurl', $conf->get_ServerURL(), '201');
@ -236,7 +236,7 @@ $row->add($advancedOptions, 12);
$row->addVerticalSpacer('2rem'); $row->addVerticalSpacer('2rem');
// language // 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 // read available languages
$possibleLanguages = getLanguages(); $possibleLanguages = getLanguages();
$defaultLanguage = array('en_GB.utf8'); $defaultLanguage = array('en_GB.utf8');
@ -271,7 +271,7 @@ $row->add(new htmlResponsiveSelect('timeZone', $timezones, array($conf->getTimeZ
$row->addVerticalSpacer('2rem'); $row->addVerticalSpacer('2rem');
// lamdaemon settings // 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(_("Server list"), 'scriptservers', $conf->get_scriptServers(), '218'), 12);
$row->add(new htmlResponsiveInputField(_("Path to external script"), 'scriptpath', $conf->get_scriptPath(), '210'), 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 // LAM Pro settings
if (isLAMProVersion()) { if (isLAMProVersion()) {
// password reset page // 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; $pwdResetAllowSpecific = true;
if ($conf->getPwdResetAllowSpecificPassword() == 'false') { if ($conf->getPwdResetAllowSpecificPassword() == 'false') {
@ -345,7 +345,7 @@ if (isLAMProVersion()) {
$row->addVerticalSpacer('2rem'); $row->addVerticalSpacer('2rem');
// mail settings // 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'); $pwdMailFrom = new htmlResponsiveInputField(_('From address'), 'pwdResetMail_from', $conf->getLamProMailFrom(), '550');
$row->add($pwdMailFrom, 12); $row->add($pwdMailFrom, 12);
@ -375,7 +375,7 @@ if (isLAMProVersion()) {
} }
// tool settings // 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(); $toolSettings = $conf->getToolSettings();
$row->add(new htmlOutputText(_('Hidden tools')), 12); $row->add(new htmlOutputText(_('Hidden tools')), 12);
$row->addVerticalSpacer('0.5rem'); $row->addVerticalSpacer('0.5rem');
@ -392,7 +392,8 @@ for ($i = 0; $i < sizeof($tools); $i++) {
} }
} }
$toolSettingsContent = new htmlResponsiveRow(); $toolSettingsContent = new htmlResponsiveRow();
for ($r = 0; $r < (sizeof($tools)); $r++) { $toolsSize = sizeof($tools);
for ($r = 0; $r < $toolsSize; $r++) {
$tool = $tools[$r]; $tool = $tools[$r];
$toolClass = get_class($tool); $toolClass = get_class($tool);
$toolName = substr($toolClass, strrpos($toolClass, '\\') + 1); $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')) { if (isset($toolSettings['tool_hide_' . $toolName]) && ($toolSettings['tool_hide_' . $toolName] === 'true')) {
$selected = 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->add($toolSettingsContent, 12);
$row->addVerticalSpacer('2rem'); $row->addVerticalSpacer('2rem');
// security setings // 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 // login method
$loginOptions = array( $loginOptions = array(
_('Fixed list') => LAMConfig::LOGIN_LIST, _('Fixed list') => LAMConfig::LOGIN_LIST,
@ -477,7 +481,7 @@ if (extension_loaded('curl')) {
} }
// new password // 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 = new htmlResponsiveInputField(_("New password"), 'passwd1', null, '212');
$password1->setIsPassword(true); $password1->setIsPassword(true);
$password2 = new htmlResponsiveInputField(_("Reenter password"), 'passwd2'); $password2 = new htmlResponsiveInputField(_("Reenter password"), 'passwd2');

View File

@ -4,6 +4,8 @@ use \moduleCache;
use \htmlSpacer; use \htmlSpacer;
use \htmlTable; use \htmlTable;
use \htmlButton; use \htmlButton;
use \htmlResponsiveRow;
use \htmlSubTitle;
/* /*
$Id$ $Id$
@ -104,40 +106,9 @@ if (isset($_POST['saveSettings']) || isset($_POST['editmodules'])
$allTypes = \LAM\TYPES\getTypes(); $allTypes = \LAM\TYPES\getTypes();
echo $_SESSION['header']; echo $_SESSION['header'];
printHeaderContents(_("LDAP Account Manager Configuration"), '../..');
echo "<title>" . _("LDAP Account Manager Configuration") . "</title>\n"; echo "</head><body class=\"admin\">\n";
printJsIncludes('../..');
// 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 "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/" . $cssEntry . "\">\n";
}
echo "<link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"../../graphics/favicon.ico\">\n";
echo "<link rel=\"icon\" href=\"../../graphics/logo136.png\">\n";
echo "</head><body>\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 "<script type=\"text/javascript\" src=\"../lib/" . $jsEntry . "\"></script>\n";
}
printConfigurationPageHeaderBar($conf); printConfigurationPageHeaderBar($conf);
// print error messages // print error messages
@ -179,20 +150,18 @@ $modules = array_keys($options);
$_SESSION['conf_types'] = array(); $_SESSION['conf_types'] = array();
for ($i = 0; $i < sizeof($modules); $i++) { for ($i = 0; $i < sizeof($modules); $i++) {
if (sizeof($options[$modules[$i]]) < 1) continue; if (sizeof($options[$modules[$i]]) < 1) continue;
echo "<fieldset class=\"ui-corner-all user-border user-bright\">\n";
$icon = '';
$module = moduleCache::getModule($modules[$i], 'none'); $module = moduleCache::getModule($modules[$i], 'none');
$iconImage = $module->getIcon(); $iconImage = $module->getIcon();
if ($iconImage != null) { if ($iconImage != null) {
if (!(strpos($iconImage, 'http') === 0) && !(strpos($iconImage, '/') === 0)) { if (!(strpos($iconImage, 'http') === 0) && !(strpos($iconImage, '/') === 0)) {
$iconImage = '../../graphics/' . $iconImage; $iconImage = '../../graphics/' . $iconImage;
} }
$icon = '<img align="middle" src="' . $iconImage . '" alt="' . $iconImage . '"> ';
} }
echo "<legend>$icon" . getModuleAlias($modules[$i], "none") . "</legend>\n"; $row = new htmlResponsiveRow();
$configTypes = parseHtml($modules[$i], $options[$modules[$i]], $old_options, false, $tabindex, 'none'); $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']); $_SESSION['conf_types'] = array_merge($configTypes, $_SESSION['conf_types']);
echo "</fieldset>\n";
echo "<br>"; echo "<br>";
} }