responsive settings

This commit is contained in:
Roland Gruber 2017-12-02 14:53:31 +01:00
parent ee795fa42e
commit 7271354247
3 changed files with 39 additions and 53 deletions

View File

@ -3905,7 +3905,7 @@ class htmlResponsiveSelect extends htmlSelect {
*/ */
function __construct($name, $elements, $selectedElements, $label, $helpID = null, $size = 1) { function __construct($name, $elements, $selectedElements, $label, $helpID = null, $size = 1) {
parent::__construct($name, $elements, $selectedElements, $size); parent::__construct($name, $elements, $selectedElements, $size);
$this->label = htmlspecialchars($label); $this->label = $label;
if (is_string($helpID)) { if (is_string($helpID)) {
$this->helpID = $helpID; $this->helpID = $helpID;
} }
@ -4081,7 +4081,7 @@ class htmlResponsiveInputCheckbox extends htmlInputCheckbox {
// label text // label text
$labelGroup = new htmlGroup(); $labelGroup = new htmlGroup();
$labelGroup->addElement(new htmlOutputText($this->label)); $labelGroup->addElement(new htmlOutputText($this->label));
$row->add($labelGroup, 10, $tabletColumnsLabel, $tabletColumnsLabel, 'responsiveLabel'); $row->add($labelGroup, 10, $tabletColumnsLabel, $tabletColumnsLabel, 'responsiveLabel nowrap');
// input field // input field
$fieldGroup = new htmlGroup(); $fieldGroup = new htmlGroup();
$fieldGroup->addElement($this); $fieldGroup->addElement($this);

View File

@ -293,32 +293,22 @@ class freeRadius extends baseModule {
* @see htmlElement * @see htmlElement
*/ */
public function get_configOptions($scopes, $allScopes) { public function get_configOptions($scopes, $allScopes) {
$configContainer = new htmlTable(); $configContainer = new htmlResponsiveRow();
$configContainer->addElement(new htmlTableExtendedInputField(_('Profile DN'), 'freeRadius_profileDN', '', 'profileDN'), true); $configContainer->add(new htmlResponsiveInputField(_('Profile DN'), 'freeRadius_profileDN', '', 'profileDN'), 12);
$configContainer->addVerticalSpace('10px'); $configContainer->addVerticalSpacer('1rem');
$configContainerHead = new htmlTable(); $hiddenGroup = new htmlGroup();
$configContainerHead->colspan = 5; $hiddenGroup->addElement(new htmlOutputText(_('Hidden options')));
$configContainerHead->addElement(new htmlOutputText(_('Hidden options'))); $hiddenGroup->addElement(new htmlHelpLink('hiddenOptions'));
$configContainerHead->addElement(new htmlHelpLink('hiddenOptions')); $configContainer->add($hiddenGroup, 12);
$configContainerOptions = new htmlTable(); $configContainer->addVerticalSpacer('0.5rem');
$configContainerOptions->colspan = 5; $configContainer->add(new htmlResponsiveInputCheckbox('freeRadius_hideRadiusFramedIPAddress', false, _('IP address'), null, true), 12, 4);
$configContainer->addElement($configContainerHead, true); $configContainer->add(new htmlResponsiveInputCheckbox('freeRadius_hideRadiusFramedIPNetmask', false, _('Net mask'), null, true), 12, 4);
$configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('freeRadius_hideRadiusFramedIPAddress', false, _('IP address'), null, false)); $configContainer->add(new htmlResponsiveInputCheckbox('freeRadius_hideRadiusRealm', false, _('Realm'), null, true), 12, 4);
$configContainerOptions->addElement(new htmlOutputText(' ')); $configContainer->add(new htmlResponsiveInputCheckbox('freeRadius_hideRadiusGroupName', false, _('Group names'), null, true), 12, 4);
$configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('freeRadius_hideRadiusFramedIPNetmask', false, _('Net mask'), null, false)); $configContainer->add(new htmlResponsiveInputCheckbox('freeRadius_hideRadiusExpiration', false, _('Expiration date'), null, true), 12, 4);
$configContainerOptions->addElement(new htmlOutputText(' ')); $configContainer->add(new htmlResponsiveInputCheckbox('freeRadius_hideRadiusIdleTimeout', false, _('Idle timeout'), null, true), 12, 4);
$configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('freeRadius_hideRadiusRealm', false, _('Realm'), null, false)); $configContainer->add(new htmlResponsiveInputCheckbox('freeRadius_hideRadiusProfileDn', false, _('Profile'), null, true), 12, 4);
$configContainerOptions->addElement(new htmlOutputText(' ')); $configContainer->add(new htmlResponsiveInputCheckbox('freeRadius_hideDialupAccess', false, _('Enabled'), null, true), 12, 4);
$configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('freeRadius_hideRadiusGroupName', false, _('Group names'), null, false));
$configContainerOptions->addElement(new htmlOutputText(' '));
$configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('freeRadius_hideRadiusExpiration', false, _('Expiration date'), null, false));
$configContainerOptions->addNewLine();
$configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('freeRadius_hideRadiusIdleTimeout', false, _('Idle timeout'), null, false));
$configContainerOptions->addElement(new htmlOutputText(' '));
$configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('freeRadius_hideRadiusProfileDn', false, _('Profile'), null, false));
$configContainerOptions->addElement(new htmlOutputText(' '));
$configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('freeRadius_hideDialupAccess', false, _('Enabled'), null, false));
$configContainer->addElement($configContainerOptions, true);
return $configContainer; return $configContainer;
} }

View File

@ -4,7 +4,7 @@ $Id$
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2010 - 2011 Pavel Pozdniak Copyright (C) 2010 - 2011 Pavel Pozdniak
2010 - 2015 Roland Gruber 2010 - 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
@ -460,43 +460,39 @@ class imapAccess extends baseModule {
*/ */
public function get_configOptions($scopes, $allScopes) { public function get_configOptions($scopes, $allScopes) {
// configuration settings // configuration settings
$configContainer = new htmlTable(); $configContainer = new htmlResponsiveRow();
$configServer = new htmlTableExtendedInputField(_('Server address'), 'ImapAccess_ImapServerAddress', '', 'ImapServerAddress'); $configServer = new htmlResponsiveInputField(_('Server address'), 'ImapAccess_ImapServerAddress', '', 'ImapServerAddress');
$configServer->setRequired(true); $configServer->setRequired(true);
$configContainer->addElement($configServer, true); $configContainer->add($configServer, 12);
$configContainer->addElement(new htmlTableExtendedSelect('ImapAccess_ImapServerEncriptionProtocol', array('TLS', 'SSL'), array('TLS'), _("Encryption protocol"), 'ImapServerEncryptionProtocol'), true); $configContainer->add(new htmlResponsiveSelect('ImapAccess_ImapServerEncriptionProtocol', array('TLS', 'SSL'), array('TLS'), _("Encryption protocol"), 'ImapServerEncryptionProtocol'), 12);
$configCertValidate = new htmlTableExtendedSelect('ImapAccess_ImapValidateServerCert', array(_('Yes') => 'validate-cert', _('No') => 'novalidate-cert'), array('validate-cert'), _("Validate server certificate"), 'ImapValidateServerCert'); $configCertValidate = new htmlResponsiveSelect('ImapAccess_ImapValidateServerCert', array(_('Yes') => 'validate-cert', _('No') => 'novalidate-cert'), array('validate-cert'), _("Validate server certificate"), 'ImapValidateServerCert');
$configCertValidate->setHasDescriptiveElements(true); $configCertValidate->setHasDescriptiveElements(true);
$configContainer->addElement($configCertValidate, true); $configContainer->add($configCertValidate, 12);
$configUser = new htmlTableExtendedInputField(_('IMAP admin user'), 'ImapAccess_ImapAdmin', '', 'ImapAdmin'); $configUser = new htmlResponsiveInputField(_('IMAP admin user'), 'ImapAccess_ImapAdmin', '', 'ImapAdmin');
$configUser->setRequired(true); $configUser->setRequired(true);
$configContainer->addElement($configUser, true); $configContainer->add($configUser, 12);
$pwdSelectOptions = array( $pwdSelectOptions = array(
_('LAM user password') => 'lam_user_pass', _('LAM user password') => 'lam_user_pass',
_('Ask') => 'ask_pass', _('Ask') => 'ask_pass',
_('Server profile') => 'config'); _('Server profile') => 'config');
$configPasswordType = new htmlTableExtendedSelect('ImapAccess_ImapAdminPasswordSelect', $pwdSelectOptions, array('ask_pass'), _("IMAP password input"), 'ImapAdminPasswordSelect'); $configPasswordType = new htmlResponsiveSelect('ImapAccess_ImapAdminPasswordSelect', $pwdSelectOptions, array('ask_pass'), _("IMAP password input"), 'ImapAdminPasswordSelect');
$configPasswordType->setHasDescriptiveElements(true); $configPasswordType->setHasDescriptiveElements(true);
$configPasswordType->setTableRowsToShow(array('config' => array('ImapAccess_ImapAdminPassword'))); $configPasswordType->setTableRowsToShow(array('config' => array('ImapAccess_ImapAdminPassword')));
$configPasswordType->setTableRowsToHide(array('lam_user_pass' => array('ImapAccess_ImapAdminPassword'), 'ask_pass' => array('ImapAccess_ImapAdminPassword'))); $configPasswordType->setTableRowsToHide(array('lam_user_pass' => array('ImapAccess_ImapAdminPassword'), 'ask_pass' => array('ImapAccess_ImapAdminPassword')));
$configContainer->addElement($configPasswordType, true); $configContainer->add($configPasswordType, 12);
$adminPwdInput = new htmlTableExtendedInputField(_('Admin password'), 'ImapAccess_ImapAdminPassword', null, 'ImapAdminPasswordSelect'); $adminPwdInput = new htmlResponsiveInputField(_('Admin password'), 'ImapAccess_ImapAdminPassword', null, 'ImapAdminPasswordSelect');
$adminPwdInput->setIsPassword(true); $adminPwdInput->setIsPassword(true);
$adminPwdInput->setObfuscate(true); $adminPwdInput->setObfuscate(true);
$configContainer->addElement($adminPwdInput, true); $configContainer->add($adminPwdInput, 12);
$mailDomainsInput = new htmlTableExtendedInputField(_('Mail domains'), 'ImapAccess_ImapDomain', '', 'ImapMailDomain'); $mailDomainsInput = new htmlResponsiveInputField(_('Mail domains'), 'ImapAccess_ImapDomain', '', 'ImapMailDomain');
$mailDomainsInput->setRequired(true); $mailDomainsInput->setRequired(true);
$configContainer->addElement($mailDomainsInput, true); $configContainer->add($mailDomainsInput, 12);
$configContainer->addElement(new htmlTableExtendedInputField(_('Prefix for mailboxes'), 'ImapAccess_ImapUserPrefix', '', 'ImapUserPrefix'), true); $configContainer->add(new htmlResponsiveInputField(_('Prefix for mailboxes'), 'ImapAccess_ImapUserPrefix', '', 'ImapUserPrefix'), 12);
$configContainer->addElement(new htmlTableExtendedInputTextarea('ImapAccess_initialFolders', '', 10, 3, _('Initial folders'), 'initialFolders'), true); $configContainer->add(new htmlResponsiveInputTextarea('ImapAccess_initialFolders', '', 10, 3, _('Initial folders'), 'initialFolders'), 12);
$configUserName = new htmlTableExtendedSelect('ImapAccess_UserNameAttribute', array('mail', 'uid', 'userPrincipalName'), array('mail'), _("User name attribute"), 'ImapUserNameAttr'); $configUserName = new htmlResponsiveSelect('ImapAccess_UserNameAttribute', array('mail', 'uid', 'userPrincipalName'), array('mail'), _("User name attribute"), 'ImapUserNameAttr');
$configContainer->addElement($configUserName, true); $configContainer->add($configUserName, 12);
$configPathSeparator = new htmlTableExtendedSelect('ImapAccess_pathSeparator', array('.', '/'), array('.'), _("Path separator"), 'pathSeparator'); $configPathSeparator = new htmlResponsiveSelect('ImapAccess_pathSeparator', array('.', '/'), array('.'), _("Path separator"), 'pathSeparator');
$configContainer->addElement($configPathSeparator, true); $configContainer->add($configPathSeparator, 12);
$configContainer->addElement(new htmlEqualWidth(array('ImapAccess_ImapServerAddress', 'ImapAccess_initialFolders', 'ImapAccess_UserNameAttribute',
'ImapAccess_ImapServerEncriptionProtocol', 'ImapAccess_ImapValidateServerCert', 'ImapAccess_ImapAdminPasswordSelect',
'ImapAccess_pathSeparator'
)));
return $configContainer; return $configContainer;
} }