diff --git a/copyright b/copyright new file mode 100644 index 00000000..5831db0a --- /dev/null +++ b/copyright @@ -0,0 +1 @@ +Please see lam/copyright. \ No newline at end of file diff --git a/lam/lib/html.inc b/lam/lib/html.inc index 7ccbe71f..32b2e96f 100644 --- a/lam/lib/html.inc +++ b/lam/lib/html.inc @@ -2716,6 +2716,8 @@ class htmlSubTitle extends htmlElement { private $image = null; /** optional ID for this element (e.g. to use for JavaScript) */ private $id = null; + /** show large icon */ + private $largeIcon = false; /** * Constructor. @@ -2723,13 +2725,15 @@ class htmlSubTitle extends htmlElement { * @param String $label label * @param String $image optional image * @param String $id optional ID for this element (e.g. to use for JavaScript) + * @param bool $largeIcon show large (32x32px) icon instead of small one (16x16px) */ - function __construct($label, $image = null, $id = null) { + function __construct($label, $image = null, $id = null, $largeIcon = false) { $this->label = htmlspecialchars($label); $this->image = htmlspecialchars($image); $this->id = htmlspecialchars($id); // the title should not end at a table cell $this->colspan = 100; + $this->largeIcon = $largeIcon; } /** @@ -2751,7 +2755,8 @@ class htmlSubTitle extends htmlElement { echo "
\n"; echo "

\n"; if ($this->image != null) { - echo '' . $this->label . ' '; + $size = $this->largeIcon ? 32 : 16; + echo '' . $this->label . ' '; } echo $this->label; echo "

\n"; @@ -3724,6 +3729,8 @@ class htmlResponsiveInputField extends htmlInputField { private $label; /** help ID */ private $helpID; + /** help module name */ + private $helpModule = null; /** render HTML of parent class */ private $renderParentHtml = false; @@ -3733,13 +3740,21 @@ class htmlResponsiveInputField extends htmlInputField { * @param String $label descriptive label * @param String $fieldName unique field name * @param String $fieldValue value of input field (optional) - * @param String $helpID help ID (optional) + * @param String|array $helpID help ID or array of help ID + module name (optional) + * @param bool $required field is required */ - function __construct($label, $fieldName, $fieldValue = null, $helpID = null) { + function __construct($label, $fieldName, $fieldValue = null, $helpID = null, $required = false) { parent::__construct($fieldName, $fieldValue); $this->label = $label; - $this->helpID = $helpID; + if (is_string($helpID)) { + $this->helpID = $helpID; + } + elseif (is_array($helpID)) { + $this->helpID = $helpID[0]; + $this->helpModule = $helpID[1]; + } $this->fieldSize = null; + $this->required = $required; } /** @@ -3762,7 +3777,7 @@ class htmlResponsiveInputField extends htmlInputField { $labelGroup->addElement(new htmlImage($graphicsPath . '/required.png', 16, 16, _('required'), _('required'))); } if (!empty($this->helpID)) { - $helpLinkLabel = new htmlHelpLink($this->helpID); + $helpLinkLabel = new htmlHelpLink($this->helpID, $this->helpModule); $helpLinkLabel->setCSSClasses(array('hide-on-tablet', 'margin-left5')); $labelGroup->addElement($helpLinkLabel); } @@ -3771,7 +3786,7 @@ class htmlResponsiveInputField extends htmlInputField { $fieldGroup = new htmlGroup(); $fieldGroup->addElement($this); if (!empty($this->helpID)) { - $helpLinkField = new htmlHelpLink($this->helpID); + $helpLinkField = new htmlHelpLink($this->helpID, $this->helpModule); $helpLinkField->setCSSClasses(array('hide-on-mobile')); $fieldGroup->addElement($helpLinkField); } @@ -3873,6 +3888,8 @@ class htmlResponsiveSelect extends htmlSelect { private $label; /** help ID */ private $helpID; + /** help module name */ + private $helpModule = null; /** render HTML of parent class */ private $renderParentHtml = false; @@ -3883,13 +3900,19 @@ class htmlResponsiveSelect extends htmlSelect { * @param array $elements list of elememts * @param array $selectedElements list of selected elements * @param String $label descriptive label - * @param String $helpID help ID (optional, default none) + * @param String|array $helpID help ID or array of help ID + module name (optional) * @param int $size size (optional, default = 1) */ function __construct($name, $elements, $selectedElements, $label, $helpID = null, $size = 1) { parent::__construct($name, $elements, $selectedElements, $size); - $this->label = htmlspecialchars($label); - $this->helpID = $helpID; + $this->label = $label; + if (is_string($helpID)) { + $this->helpID = $helpID; + } + elseif (is_array($helpID)) { + $this->helpID = $helpID[0]; + $this->helpModule = $helpID[1]; + } } /** @@ -3907,7 +3930,7 @@ class htmlResponsiveSelect extends htmlSelect { $labelGroup = new htmlGroup(); $labelGroup->addElement(new htmlOutputText($this->label)); if (!empty($this->helpID)) { - $helpLinkLabel = new htmlHelpLink($this->helpID); + $helpLinkLabel = new htmlHelpLink($this->helpID, $this->helpModule); $helpLinkLabel->setCSSClasses(array('hide-on-tablet', 'margin-left5')); $labelGroup->addElement($helpLinkLabel); } @@ -3916,7 +3939,7 @@ class htmlResponsiveSelect extends htmlSelect { $fieldGroup = new htmlGroup(); $fieldGroup->addElement($this); if (!empty($this->helpID)) { - $helpLink = new htmlHelpLink($this->helpID); + $helpLink = new htmlHelpLink($this->helpID, $this->helpModule); $helpLink->setCSSClasses(array('hide-on-mobile')); $fieldGroup->addElement($helpLink); } @@ -4009,8 +4032,12 @@ class htmlResponsiveInputCheckbox extends htmlInputCheckbox { private $label; /** help ID */ private $helpID; + /** help module name */ + private $helpModule = null; /** render HTML of parent class */ private $renderParentHtml = false; + /** long label */ + private $longLabel = false; /** * Constructor. @@ -4018,12 +4045,20 @@ class htmlResponsiveInputCheckbox extends htmlInputCheckbox { * @param String $name unique name * @param boolean $checked checked * @param String $label descriptive label - * @param String $helpID help ID + * @param String|array $helpID help ID or array of help ID + module name (optional) + * @param bool $longLabel more space for label (default: false) */ - function __construct($name, $checked, $label, $helpID = null) { + function __construct($name, $checked, $label, $helpID = null, $longLabel = false) { parent::__construct($name, $checked); - $this->label = htmlspecialchars($label); - $this->helpID = $helpID; + $this->label = $label; + if (is_string($helpID)) { + $this->helpID = $helpID; + } + elseif (is_array($helpID)) { + $this->helpID = $helpID[0]; + $this->helpModule = $helpID[1]; + } + $this->longLabel = $longLabel; } /** @@ -4037,19 +4072,25 @@ class htmlResponsiveInputCheckbox extends htmlInputCheckbox { // HTML of parent class is rendered on second call (done by htmlResponsiveRow) $this->renderParentHtml = true; $row = new htmlResponsiveRow(); + $tabletColumnsLabel = 6; + $tabletColumnsBox = 6; + if ($this->longLabel) { + $tabletColumnsLabel = 10; + $tabletColumnsBox = 2; + } // label text $labelGroup = new htmlGroup(); $labelGroup->addElement(new htmlOutputText($this->label)); - $row->add($labelGroup, 6, 6, 6, 'responsiveLabel'); + $row->add($labelGroup, 10, $tabletColumnsLabel, $tabletColumnsLabel, 'responsiveLabel nowrap'); // input field $fieldGroup = new htmlGroup(); $fieldGroup->addElement($this); if (!empty($this->helpID)) { - $helpLink = new htmlHelpLink($this->helpID); + $helpLink = new htmlHelpLink($this->helpID, $this->helpModule); $helpLink->setCSSClasses(array('margin-left5 align-unset-img')); $fieldGroup->addElement($helpLink); } - $row->add($fieldGroup, 6, 6, 6, 'responsiveField nowrap'); + $row->add($fieldGroup, 2, $tabletColumnsBox, $tabletColumnsBox, 'responsiveField nowrap'); return $row->generateHTML($module, $input, $values, $restricted, $tabindex, $scope); } diff --git a/lam/lib/modules/asteriskAccount.inc b/lam/lib/modules/asteriskAccount.inc index 3191e139..09a9e052 100644 --- a/lam/lib/modules/asteriskAccount.inc +++ b/lam/lib/modules/asteriskAccount.inc @@ -4,7 +4,7 @@ $Id$ This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam) Copyright (C) 2009 - 2012 Pavel Pozdnyak - 2009 - 2015 Roland Gruber + 2009 - 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 @@ -1222,79 +1222,44 @@ class asteriskAccount extends baseModule implements passwordService { * @see htmlElement */ public function get_configOptions($scopes, $allScopes) { - $return = parent::get_configOptions($scopes, $allScopes); - // config options - $configContainer = new htmlTable(); - $configRealmTable = new htmlTable(); - $configRealmTable->addElement(new htmlTableExtendedInputField(_('Asterisk realm'), 'asteriskAccount_AsteriskRealm', null, 'AsteriskRealm')); - $configContainer->addElement($configRealmTable, true); - $configContainer->addElement(new htmlSpacer(null, '10px'), true); - $configHiddenHead = new htmlTable(); + $configContainer = new htmlResponsiveRow(); + $configContainer->add(new htmlResponsiveInputField(_('Asterisk realm'), 'asteriskAccount_AsteriskRealm', null, 'AsteriskRealm'), 12); + $configContainer->addVerticalSpacer('1rem'); + $configHiddenHead = new htmlGroup(); $configHiddenHead->addElement(new htmlOutputText(_('Hidden options'))); $configHiddenHead->addElement(new htmlHelpLink('hiddenOptions')); - $configContainerOptions = new htmlTable(); - $configContainer->addElement($configHiddenHead, true); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountUserAgent', false, _('User agent'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountAMAFlags', false, _('AMA flags'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountCallGroup', false, _('Call groups'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountDTMFMode', false, _('DTFM flags'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountFromUser', false, _('From user'), null, false)); - $configContainerOptions->addNewLine(); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountFromDomain', false, _('From domain'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountFullContact', false, _('Full contact'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountInsecure', false, _('Insecure'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountMailbox', false, _('Mailbox'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountNAT', false, _('NAT'), null, false)); - $configContainerOptions->addNewLine(); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountDeny', false, _('Deny'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountPermit', false, _('Permit'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountPickupGroup', false, _('Pickup group'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountPort', false, _('Port'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountQualify', false, _('Qualify'), null, false)); - $configContainerOptions->addNewLine(); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountRestrictCID', false, _('Restrict caller ID'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountRTPTimeout', false, _('RTP timeout'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountRTPHoldTimeout', false, _('RTP hold timeout'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountDisallowedCodec', false, _('Disallowed codec'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountAllowedCodec', false, _('Allowed codec'), null, false)); - $configContainerOptions->addNewLine(); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountMusicOnHold', false, _('Music on hold'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountExpirationTimestamp', false, _('Expiration timestamp'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountRegistrationContext', false, _('Registration context'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountRegistrationExten', false, _('Registration extension'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountCanCallForward', false, _('Can call forward'), null, false)); - $configContainerOptions->addNewLine(); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountIPAddress', false, _('IP address'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountDefaultUser', false, _('Default user'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountRegistrationServer', false, _('Registration server'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('asteriskAccount_hideAstAccountLastQualifyMilliseconds', false, _('Last qualify milliseconds'), null, false)); - $configContainerOptions->addNewLine(); - $configContainer->addElement($configContainerOptions, true); - $return[] = $configContainer; - return $return; + $configContainer->add($configHiddenHead, 12); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountUserAgent', false, _('User agent'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountAMAFlags', false, _('AMA flags'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountCallGroup', false, _('Call groups'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountDTMFMode', false, _('DTFM flags'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountFromUser', false, _('From user'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountFromDomain', false, _('From domain'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountFullContact', false, _('Full contact'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountInsecure', false, _('Insecure'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountMailbox', false, _('Mailbox'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountNAT', false, _('NAT'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountDeny', false, _('Deny'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountPermit', false, _('Permit'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountPickupGroup', false, _('Pickup group'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountPort', false, _('Port'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountQualify', false, _('Qualify'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountRestrictCID', false, _('Restrict caller ID'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountRTPTimeout', false, _('RTP timeout'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountRTPHoldTimeout', false, _('RTP hold timeout'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountDisallowedCodec', false, _('Disallowed codec'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountAllowedCodec', false, _('Allowed codec'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountMusicOnHold', false, _('Music on hold'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountExpirationTimestamp', false, _('Expiration timestamp'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountRegistrationContext', false, _('Registration context'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountRegistrationExten', false, _('Registration extension'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountCanCallForward', false, _('Can call forward'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountIPAddress', false, _('IP address'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountDefaultUser', false, _('Default user'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountRegistrationServer', false, _('Registration server'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('asteriskAccount_hideAstAccountLastQualifyMilliseconds', false, _('Last qualify milliseconds'), null, true), 12, 4); + $configContainer->add(new htmlOutputText(''), 0, 4); + return $configContainer; } } 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/freeRadius.inc b/lam/lib/modules/freeRadius.inc index 6c1d7a6e..62ba1ba4 100644 --- a/lam/lib/modules/freeRadius.inc +++ b/lam/lib/modules/freeRadius.inc @@ -293,32 +293,22 @@ class freeRadius extends baseModule { * @see htmlElement */ public function get_configOptions($scopes, $allScopes) { - $configContainer = new htmlTable(); - $configContainer->addElement(new htmlTableExtendedInputField(_('Profile DN'), 'freeRadius_profileDN', '', 'profileDN'), true); - $configContainer->addVerticalSpace('10px'); - $configContainerHead = new htmlTable(); - $configContainerHead->colspan = 5; - $configContainerHead->addElement(new htmlOutputText(_('Hidden options'))); - $configContainerHead->addElement(new htmlHelpLink('hiddenOptions')); - $configContainerOptions = new htmlTable(); - $configContainerOptions->colspan = 5; - $configContainer->addElement($configContainerHead, true); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('freeRadius_hideRadiusFramedIPAddress', false, _('IP address'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('freeRadius_hideRadiusFramedIPNetmask', false, _('Net mask'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('freeRadius_hideRadiusRealm', false, _('Realm'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $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); + $configContainer = new htmlResponsiveRow(); + $configContainer->add(new htmlResponsiveInputField(_('Profile DN'), 'freeRadius_profileDN', '', 'profileDN'), 12); + $configContainer->addVerticalSpacer('1rem'); + $hiddenGroup = new htmlGroup(); + $hiddenGroup->addElement(new htmlOutputText(_('Hidden options'))); + $hiddenGroup->addElement(new htmlHelpLink('hiddenOptions')); + $configContainer->add($hiddenGroup, 12); + $configContainer->addVerticalSpacer('0.5rem'); + $configContainer->add(new htmlResponsiveInputCheckbox('freeRadius_hideRadiusFramedIPAddress', false, _('IP address'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('freeRadius_hideRadiusFramedIPNetmask', false, _('Net mask'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('freeRadius_hideRadiusRealm', false, _('Realm'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('freeRadius_hideRadiusGroupName', false, _('Group names'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('freeRadius_hideRadiusExpiration', false, _('Expiration date'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('freeRadius_hideRadiusIdleTimeout', false, _('Idle timeout'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('freeRadius_hideRadiusProfileDn', false, _('Profile'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('freeRadius_hideDialupAccess', false, _('Enabled'), null, true), 12, 4); return $configContainer; } diff --git a/lam/lib/modules/imapAccess.inc b/lam/lib/modules/imapAccess.inc index ee7a0094..4b6e6142 100644 --- a/lam/lib/modules/imapAccess.inc +++ b/lam/lib/modules/imapAccess.inc @@ -4,7 +4,7 @@ $Id$ This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) 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 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) { // configuration settings - $configContainer = new htmlTable(); - $configServer = new htmlTableExtendedInputField(_('Server address'), 'ImapAccess_ImapServerAddress', '', 'ImapServerAddress'); + $configContainer = new htmlResponsiveRow(); + $configServer = new htmlResponsiveInputField(_('Server address'), 'ImapAccess_ImapServerAddress', '', 'ImapServerAddress'); $configServer->setRequired(true); - $configContainer->addElement($configServer, true); - $configContainer->addElement(new htmlTableExtendedSelect('ImapAccess_ImapServerEncriptionProtocol', array('TLS', 'SSL'), array('TLS'), _("Encryption protocol"), 'ImapServerEncryptionProtocol'), true); - $configCertValidate = new htmlTableExtendedSelect('ImapAccess_ImapValidateServerCert', array(_('Yes') => 'validate-cert', _('No') => 'novalidate-cert'), array('validate-cert'), _("Validate server certificate"), 'ImapValidateServerCert'); + $configContainer->add($configServer, 12); + $configContainer->add(new htmlResponsiveSelect('ImapAccess_ImapServerEncriptionProtocol', array('TLS', 'SSL'), array('TLS'), _("Encryption protocol"), 'ImapServerEncryptionProtocol'), 12); + $configCertValidate = new htmlResponsiveSelect('ImapAccess_ImapValidateServerCert', array(_('Yes') => 'validate-cert', _('No') => 'novalidate-cert'), array('validate-cert'), _("Validate server certificate"), 'ImapValidateServerCert'); $configCertValidate->setHasDescriptiveElements(true); - $configContainer->addElement($configCertValidate, true); - $configUser = new htmlTableExtendedInputField(_('IMAP admin user'), 'ImapAccess_ImapAdmin', '', 'ImapAdmin'); + $configContainer->add($configCertValidate, 12); + $configUser = new htmlResponsiveInputField(_('IMAP admin user'), 'ImapAccess_ImapAdmin', '', 'ImapAdmin'); $configUser->setRequired(true); - $configContainer->addElement($configUser, true); + $configContainer->add($configUser, 12); $pwdSelectOptions = array( _('LAM user password') => 'lam_user_pass', _('Ask') => 'ask_pass', _('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->setTableRowsToShow(array('config' => array('ImapAccess_ImapAdminPassword'))); $configPasswordType->setTableRowsToHide(array('lam_user_pass' => array('ImapAccess_ImapAdminPassword'), 'ask_pass' => array('ImapAccess_ImapAdminPassword'))); - $configContainer->addElement($configPasswordType, true); - $adminPwdInput = new htmlTableExtendedInputField(_('Admin password'), 'ImapAccess_ImapAdminPassword', null, 'ImapAdminPasswordSelect'); + $configContainer->add($configPasswordType, 12); + $adminPwdInput = new htmlResponsiveInputField(_('Admin password'), 'ImapAccess_ImapAdminPassword', null, 'ImapAdminPasswordSelect'); $adminPwdInput->setIsPassword(true); $adminPwdInput->setObfuscate(true); - $configContainer->addElement($adminPwdInput, true); - $mailDomainsInput = new htmlTableExtendedInputField(_('Mail domains'), 'ImapAccess_ImapDomain', '', 'ImapMailDomain'); + $configContainer->add($adminPwdInput, 12); + $mailDomainsInput = new htmlResponsiveInputField(_('Mail domains'), 'ImapAccess_ImapDomain', '', 'ImapMailDomain'); $mailDomainsInput->setRequired(true); - $configContainer->addElement($mailDomainsInput, true); - $configContainer->addElement(new htmlTableExtendedInputField(_('Prefix for mailboxes'), 'ImapAccess_ImapUserPrefix', '', 'ImapUserPrefix'), true); - $configContainer->addElement(new htmlTableExtendedInputTextarea('ImapAccess_initialFolders', '', 10, 3, _('Initial folders'), 'initialFolders'), true); - $configUserName = new htmlTableExtendedSelect('ImapAccess_UserNameAttribute', array('mail', 'uid', 'userPrincipalName'), array('mail'), _("User name attribute"), 'ImapUserNameAttr'); - $configContainer->addElement($configUserName, true); - $configPathSeparator = new htmlTableExtendedSelect('ImapAccess_pathSeparator', array('.', '/'), array('.'), _("Path separator"), 'pathSeparator'); - $configContainer->addElement($configPathSeparator, true); - $configContainer->addElement(new htmlEqualWidth(array('ImapAccess_ImapServerAddress', 'ImapAccess_initialFolders', 'ImapAccess_UserNameAttribute', - 'ImapAccess_ImapServerEncriptionProtocol', 'ImapAccess_ImapValidateServerCert', 'ImapAccess_ImapAdminPasswordSelect', - 'ImapAccess_pathSeparator' - ))); + $configContainer->add($mailDomainsInput, 12); + $configContainer->add(new htmlResponsiveInputField(_('Prefix for mailboxes'), 'ImapAccess_ImapUserPrefix', '', 'ImapUserPrefix'), 12); + $configContainer->add(new htmlResponsiveInputTextarea('ImapAccess_initialFolders', '', 10, 3, _('Initial folders'), 'initialFolders'), 12); + $configUserName = new htmlResponsiveSelect('ImapAccess_UserNameAttribute', array('mail', 'uid', 'userPrincipalName'), array('mail'), _("User name attribute"), 'ImapUserNameAttr'); + $configContainer->add($configUserName, 12); + $configPathSeparator = new htmlResponsiveSelect('ImapAccess_pathSeparator', array('.', '/'), array('.'), _("Path separator"), 'pathSeparator'); + $configContainer->add($configPathSeparator, 12); return $configContainer; } diff --git a/lam/lib/modules/inetOrgPerson.inc b/lam/lib/modules/inetOrgPerson.inc index 5370ac20..99b29140 100644 --- a/lam/lib/modules/inetOrgPerson.inc +++ b/lam/lib/modules/inetOrgPerson.inc @@ -3625,23 +3625,11 @@ 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 - $configContainer = new htmlTable(); + $configContainer = new htmlResponsiveRow(); if (isset($_SESSION['conf_config'])) { // add password hash type if posixAccount is inactive $unixModuleFound = false; @@ -3656,87 +3644,57 @@ class inetOrgPerson extends baseModule implements passwordService { } if (!$unixModuleFound) { $optionsSelected = array('SSHA'); - $hashOption = new htmlTable(); - $hashOption->addElement(new htmlTableExtendedSelect('posixAccount_pwdHash', getSupportedHashTypes(), $optionsSelected, _("Password hash type"), 'pwdHash')); - $configContainer->addElement($hashOption, true); + $hashOption = new htmlResponsiveSelect('posixAccount_pwdHash', getSupportedHashTypes(), $optionsSelected, _("Password hash type"), 'pwdHash'); + $configContainer->add($hashOption, 12); } } - $configContainerHead = new htmlTable(); + $configContainerHead = new htmlGroup(); $configContainerHead->addElement(new htmlOutputText(_('Hidden options'))); $configContainerHead->addElement(new htmlHelpLink('hiddenOptions')); - $configContainerOptions = new htmlTable(); - $configContainer->addElement($configContainerHead, true); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hideDescription', false, _('Description'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hideStreet', false, _('Street'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hidePostOfficeBox', false, _('Post office box'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hidePostalCode', false, _('Postal code'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hideLocation', false, _('Location'), null, false)); - $configContainerOptions->addNewLine(); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hideState', false, _('State'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hidePostalAddress', false, _('Postal address'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hideRegisteredAddress', false, _('Registered address'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hideOfficeName', false, _('Office name'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hideRoomNumber', false, _('Room number'), null, false)); - $configContainerOptions->addNewLine(); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hideTelephoneNumber', false, _('Telephone number'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hideHomeTelephoneNumber', false, _('Home telephone number'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hideMobileNumber', false, _('Mobile number'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hideFaxNumber', false, _('Fax number'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hidePager', true, _('Pager'), null, false)); - $configContainerOptions->addNewLine(); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hideEMailAddress', false, _('Email address'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hideJobTitle', false, _('Job title'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hideCarLicense', false, _('Car license'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hideEmployeeType', false, _('Employee type'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hideBusinessCategory', false, _('Business category'), null, false)); - $configContainerOptions->addNewLine(); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hideDepartments', false, _('Department'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hideManager', false, _('Manager'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hideOu', false, _('Organisational unit'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hideO', false, _('Organisation'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hideEmployeeNumber', false, _('Employee number'), null, false)); - $configContainerOptions->addNewLine(); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hideInitials', false, _('Initials'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hideLabeledURI', false, _('Web site'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hideuserCertificate', false, _('User certificates'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hidejpegPhoto', false, _('Photo'), null, false)); + $configContainer->add($configContainerHead, 12); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideDescription', false, _('Description'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideStreet', false, _('Street'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hidePostOfficeBox', false, _('Post office box'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hidePostalCode', false, _('Postal code'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideLocation', false, _('Location'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideState', false, _('State'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hidePostalAddress', false, _('Postal address'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideRegisteredAddress', false, _('Registered address'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideOfficeName', false, _('Office name'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideRoomNumber', false, _('Room number'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideTelephoneNumber', false, _('Telephone number'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideHomeTelephoneNumber', false, _('Home telephone number'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideMobileNumber', false, _('Mobile number'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideFaxNumber', false, _('Fax number'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hidePager', true, _('Pager'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideEMailAddress', false, _('Email address'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideJobTitle', false, _('Job title'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideCarLicense', false, _('Car license'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideEmployeeType', false, _('Employee type'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideBusinessCategory', false, _('Business category'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideDepartments', false, _('Department'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideManager', false, _('Manager'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideOu', false, _('Organisational unit'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideO', false, _('Organisation'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideEmployeeNumber', false, _('Employee number'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideInitials', false, _('Initials'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideLabeledURI', false, _('Web site'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideuserCertificate', false, _('User certificates'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hidejpegPhoto', false, _('Photo'), null, true), 12, 4); if (isset($_SESSION['conf_config'])) { $confActiveUnixUserModules = $_SESSION['conf_config']->get_AccountModules('user'); // option to hide uid if (!in_array('posixAccount', $confActiveUnixUserModules)) { - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_hideUID', false, _('User name'), null, false)); + $configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideUID', false, _('User name'), null, true), 12, 4); + } + else { + $configContainer->add(new htmlOutputText(''), 0, 4); } } - $configContainer->addElement($configContainerOptions, true); - $advancedOptions = new htmlTable(); - $addressbookTable = new htmlTable(); - $addressbookTable->addElement(new htmlTableExtendedInputCheckbox('inetOrgPerson_addAddressbook', false, _('Add addressbook (ou=addressbook)'), 'addAddressbook')); - $advancedOptions->addElement($addressbookTable, true); - $advancedOptions->addElement(new htmlSubTitle(_('Read-only fields')), true); + $configContainer->addVerticalSpacer('1rem'); + $advancedOptions = new htmlResponsiveRow(); + $advancedOptions->add(new htmlResponsiveInputCheckbox('inetOrgPerson_addAddressbook', false, _('Add addressbook (ou=addressbook)'), 'addAddressbook'), 12); + $advancedOptions->add(new htmlSubTitle(_('Read-only fields')), 12); $readOnlyOptions = array( _('Description') => 'inetOrgPerson_readOnly_description', _('Street') => 'inetOrgPerson_readOnly_street', _('First name') => 'inetOrgPerson_readOnly_givenName', _('Last name') => 'inetOrgPerson_readOnly_sn', @@ -3761,31 +3719,18 @@ class inetOrgPerson extends baseModule implements passwordService { $readOnlyOptions[_('Common name')] = 'inetOrgPerson_readOnly_cn'; } ksort($readOnlyOptions); - $readOnlyCounter = 0; - $readOnlyOptionsTable = new htmlTable(); - $readOnlyOptionsTable->colspan = 5; foreach ($readOnlyOptions as $label => $id) { - $readOnlyOptionsTable->addElement(new htmlTableExtendedInputCheckbox($id, false, $label, null, false)); - $readOnlyCounter++; - if (($readOnlyCounter % 5) == 0) { - $readOnlyOptionsTable->addNewLine(); - } + $advancedOptions->add(new htmlResponsiveInputCheckbox($id, false, $label, null, true), 12, 4); } - $advancedOptions->addElement($readOnlyOptionsTable, true); - $advancedOptions->addElement(new htmlSubTitle(_('Photo')), true); - $photoTable = new htmlTable(); - $photoTable->colspan = 2; + $advancedOptions->add(new htmlSubTitle(_('Photo')), 12); if (extension_loaded('imagick')) { - $photoTable->addElement(new htmlTableExtendedInputField(_('Maximum width (px)'), 'inetOrgPerson_jpegPhoto_maxWidth', null, 'crop'), true); - $photoTable->addElement(new htmlTableExtendedInputField(_('Maximum height (px)'), 'inetOrgPerson_jpegPhoto_maxHeight', null, 'crop'), true); + $advancedOptions->add(new htmlResponsiveInputField(_('Maximum width (px)'), 'inetOrgPerson_jpegPhoto_maxWidth', null, 'crop'), 12); + $advancedOptions->add(new htmlResponsiveInputField(_('Maximum height (px)'), 'inetOrgPerson_jpegPhoto_maxHeight', null, 'crop'), 12); } - $photoTable->addElement(new htmlTableExtendedInputField(_('Maximum file size (kB)'), 'inetOrgPerson_jpegPhoto_maxSize'), true); - $advancedOptions->addElement($photoTable, true); + $advancedOptions->add(new htmlResponsiveInputField(_('Maximum file size (kB)'), 'inetOrgPerson_jpegPhoto_maxSize'), 12); $advancedOptionsAccordion = new htmlAccordion('inetOrgPersonAdvancedOptions', array(_('Advanced options') => $advancedOptions), false); - $advancedOptionsAccordion->colspan = 5; - $configContainer->addElement($advancedOptionsAccordion); - $return[] = $configContainer; - return $return; + $configContainer->add($advancedOptionsAccordion, 12); + return $configContainer; } /** diff --git a/lam/lib/modules/kolabUser.inc b/lam/lib/modules/kolabUser.inc index 4c370215..e3dd0460 100644 --- a/lam/lib/modules/kolabUser.inc +++ b/lam/lib/modules/kolabUser.inc @@ -110,10 +110,6 @@ class kolabUser extends baseModule { 'type' => 'ext_preg', 'regex' => 'digit', 'error_message' => $this->messages['mailQuota'][0]); - // config options - $configContainer = new htmlTable(); - $configContainer->addElement(new htmlTableExtendedInputCheckbox('kolabUser_mailrecipient', true, _('Manage object class "mailrecipient"'), 'mailrecipient'), true); - $return['config_options']['all'] = $configContainer; // self service field settings $return['selfServiceFieldSettings'] = array( 'kolabDelegate' => _('Delegates'), @@ -993,6 +989,16 @@ class kolabUser extends baseModule { } + /** + * {@inheritDoc} + * @see baseModule::get_configOptions() + */ + public function get_configOptions($scopes, $allScopes) { + $configContainer = new htmlResponsiveRow(); + $configContainer->add(new htmlResponsiveInputCheckbox('kolabUser_mailrecipient', true, _('Manage object class "mailrecipient"'), 'mailrecipient'), 12); + return $configContainer; + } + } diff --git a/lam/lib/modules/nisMailAliasUser.inc b/lam/lib/modules/nisMailAliasUser.inc index f3772520..a4a01588 100644 --- a/lam/lib/modules/nisMailAliasUser.inc +++ b/lam/lib/modules/nisMailAliasUser.inc @@ -567,16 +567,15 @@ class nisMailAliasUser extends baseModule { * @see htmlElement */ public function get_configOptions($scopes, $allScopes) { - $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('nisMailAliasUser_hideUserAliases', false, _('Aliases for user name'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('nisMailAliasUser_hideMailAliases', false, _('Aliases for email'), null, false)); - $configContainer->addElement($configContainerOptions, true); + $configContainer = new htmlResponsiveRow(); + $hiddenGroup = new htmlGroup(); + $hiddenGroup->addElement(new htmlOutputText(_('Hidden options'))); + $hiddenGroup->addElement(new htmlHelpLink('hiddenOptions')); + $configContainer->addLabel($hiddenGroup); + $configContainer->addField(new htmlOutputText('')); + $configContainer->addVerticalSpacer('0.5rem'); + $configContainer->add(new htmlResponsiveInputCheckbox('nisMailAliasUser_hideUserAliases', false, _('Aliases for user name')), 12); + $configContainer->add(new htmlResponsiveInputCheckbox('nisMailAliasUser_hideMailAliases', false, _('Aliases for email')), 12); return $configContainer; } diff --git a/lam/lib/modules/posixAccount.inc b/lam/lib/modules/posixAccount.inc index 993ef161..1f329928 100644 --- a/lam/lib/modules/posixAccount.inc +++ b/lam/lib/modules/posixAccount.inc @@ -1909,17 +1909,17 @@ class posixAccount extends baseModule implements passwordService { */ function get_configOptions($scopes, $allScopes) { $return = array(); + $generatorOptions = array( + _('Fixed range') => 'range', + _('Samba ID pool') => 'sambaPool', + _('Windows domain info') => 'windowsDomain', + _('Magic number') => 'magicNumber' + ); if (in_array('user', $scopes)) { // user options - $configUserContainer = new htmlTable(); - $configUserContainer->addElement(new htmlSubTitle(_("Users")), true); - $generatorOptions = array( - _('Fixed range') => 'range', - _('Samba ID pool') => 'sambaPool', - _('Windows domain info') => 'windowsDomain', - _('Magic number') => 'magicNumber' - ); - $uidGeneratorSelect = new htmlTableExtendedSelect('posixAccount_uidGeneratorUsers', $generatorOptions, array('range'), _('UID generator'), 'uidGenerator'); + $configUserContainer = new htmlResponsiveRow(); + $configUserContainer->add(new htmlSubTitle(_("Users")), 12); + $uidGeneratorSelect = new htmlResponsiveSelect('posixAccount_uidGeneratorUsers', $generatorOptions, array('range'), _('UID generator'), 'uidGenerator'); $uidGeneratorSelect->setHasDescriptiveElements(true); $uidGeneratorSelect->setTableRowsToHide(array( 'range' => array('posixAccount_sambaIDPoolDNUsers', 'posixAccount_windowsIDPoolDNUsers', 'posixAccount_magicNumberUser'), @@ -1933,30 +1933,30 @@ class posixAccount extends baseModule implements passwordService { 'windowsDomain' => array('posixAccount_windowsIDPoolDNUsers'), 'magicNumber' => array('posixAccount_magicNumberUser') )); - $configUserContainer->addElement($uidGeneratorSelect, true); - $uidUsersGeneratorDN = new htmlTableExtendedInputField(_('Samba ID pool DN'), 'posixAccount_sambaIDPoolDNUsers', null, 'sambaIDPoolDN'); + $configUserContainer->add($uidGeneratorSelect, 12); + $uidUsersGeneratorDN = new htmlResponsiveInputField(_('Samba ID pool DN'), 'posixAccount_sambaIDPoolDNUsers', null, 'sambaIDPoolDN'); $uidUsersGeneratorDN->setRequired(true); - $configUserContainer->addElement($uidUsersGeneratorDN, true); - $uidUsersGeneratorWinDN = new htmlTableExtendedInputField(_('Windows domain info DN'), 'posixAccount_windowsIDPoolDNUsers', null, 'windowsIDPoolDN'); + $configUserContainer->add($uidUsersGeneratorDN, 12); + $uidUsersGeneratorWinDN = new htmlResponsiveInputField(_('Windows domain info DN'), 'posixAccount_windowsIDPoolDNUsers', null, 'windowsIDPoolDN'); $uidUsersGeneratorWinDN->setRequired(true); - $configUserContainer->addElement($uidUsersGeneratorWinDN, true); - $minUid = new htmlTableExtendedInputField(_('Minimum UID number'), 'posixAccount_minUID', null, 'minMaxUser'); + $configUserContainer->add($uidUsersGeneratorWinDN, 12); + $minUid = new htmlResponsiveInputField(_('Minimum UID number'), 'posixAccount_minUID', null, 'minMaxUser'); $minUid->setRequired(true); - $configUserContainer->addElement($minUid, true); - $maxUid = new htmlTableExtendedInputField(_('Maximum UID number'), 'posixAccount_maxUID', null, 'minMaxUser'); + $configUserContainer->add($minUid, 12); + $maxUid = new htmlResponsiveInputField(_('Maximum UID number'), 'posixAccount_maxUID', null, 'minMaxUser'); $maxUid->setRequired(true); - $configUserContainer->addElement($maxUid, true); - $magicNumberUser = new htmlTableExtendedInputField(_('Magic number'), 'posixAccount_magicNumberUser', null, 'magicNumber'); + $configUserContainer->add($maxUid, 12); + $magicNumberUser = new htmlResponsiveInputField(_('Magic number'), 'posixAccount_magicNumberUser', null, 'magicNumber'); $magicNumberUser->setRequired(true); - $configUserContainer->addElement($magicNumberUser, true); - $configUserContainer->addElement(new htmlTableExtendedInputField(_('Suffix for UID/user name check'), 'posixAccount_uidCheckSuffixUser', '', 'uidCheckSuffix'), true); + $configUserContainer->add($magicNumberUser, 12); + $configUserContainer->add(new htmlResponsiveInputField(_('Suffix for UID/user name check'), 'posixAccount_uidCheckSuffixUser', '', 'uidCheckSuffix'), 12); $return[] = $configUserContainer; } // host options if (in_array('host', $scopes)) { - $configHostContainer = new htmlTable(); - $configHostContainer->addElement(new htmlSubTitle(_("Hosts")), true); - $uidHostGeneratorSelect = new htmlTableExtendedSelect('posixAccount_uidGeneratorHosts', $generatorOptions, array('range'), _('UID generator'), 'uidGenerator'); + $configHostContainer = new htmlResponsiveRow(); + $configHostContainer->add(new htmlSubTitle(_("Hosts")), 12); + $uidHostGeneratorSelect = new htmlResponsiveSelect('posixAccount_uidGeneratorHosts', $generatorOptions, array('range'), _('UID generator'), 'uidGenerator'); $uidHostGeneratorSelect->setHasDescriptiveElements(true); $uidHostGeneratorSelect->setTableRowsToHide(array( 'range' => array('posixAccount_sambaIDPoolDNHosts', 'posixAccount_windowsIDPoolDNHosts', 'posixAccount_magicNumberHost'), @@ -1970,60 +1970,56 @@ class posixAccount extends baseModule implements passwordService { 'windowsDomain' => array('posixAccount_windowsIDPoolDNHosts'), 'magicNumber' => array('posixAccount_magicNumberHost') )); - $configHostContainer->addElement($uidHostGeneratorSelect, true); - $uidHostsGeneratorDN = new htmlTableExtendedInputField(_('Samba ID pool DN'), 'posixAccount_sambaIDPoolDNHosts', null, 'sambaIDPoolDN'); + $configHostContainer->add($uidHostGeneratorSelect, 12); + $uidHostsGeneratorDN = new htmlResponsiveInputField(_('Samba ID pool DN'), 'posixAccount_sambaIDPoolDNHosts', null, 'sambaIDPoolDN'); $uidHostsGeneratorDN->setRequired(true); - $configHostContainer->addElement($uidHostsGeneratorDN, true); - $uidHostsGeneratorWinDN = new htmlTableExtendedInputField(_('Windows domain info DN'), 'posixAccount_windowsIDPoolDNHosts', null, 'windowsIDPoolDN'); + $configHostContainer->add($uidHostsGeneratorDN, 12); + $uidHostsGeneratorWinDN = new htmlResponsiveInputField(_('Windows domain info DN'), 'posixAccount_windowsIDPoolDNHosts', null, 'windowsIDPoolDN'); $uidHostsGeneratorWinDN->setRequired(true); - $configHostContainer->addElement($uidHostsGeneratorWinDN, true); - $minUid = new htmlTableExtendedInputField(_('Minimum UID number'), 'posixAccount_minMachine', null, 'minMaxHost'); + $configHostContainer->add($uidHostsGeneratorWinDN, 12); + $minUid = new htmlResponsiveInputField(_('Minimum UID number'), 'posixAccount_minMachine', null, 'minMaxHost'); $minUid->setRequired(true); - $configHostContainer->addElement($minUid, true); - $maxUid = new htmlTableExtendedInputField(_('Maximum UID number'), 'posixAccount_maxMachine', null, 'minMaxHost'); + $configHostContainer->add($minUid, 12); + $maxUid = new htmlResponsiveInputField(_('Maximum UID number'), 'posixAccount_maxMachine', null, 'minMaxHost'); $maxUid->setRequired(true); - $configHostContainer->addElement($maxUid, true); - $magicNumberHost = new htmlTableExtendedInputField(_('Magic number'), 'posixAccount_magicNumberHost', null, 'magicNumber'); + $configHostContainer->add($maxUid, 12); + $magicNumberHost = new htmlResponsiveInputField(_('Magic number'), 'posixAccount_magicNumberHost', null, 'magicNumber'); $magicNumberHost->setRequired(true); - $configHostContainer->addElement($magicNumberHost, true); - $configHostContainer->addElement(new htmlTableExtendedInputField(_('Suffix for UID/user name check'), 'posixAccount_uidCheckSuffixHost', '', 'uidCheckSuffix'), true); + $configHostContainer->add($magicNumberHost, 12); + $configHostContainer->add(new htmlResponsiveInputField(_('Suffix for UID/user name check'), 'posixAccount_uidCheckSuffixHost', '', 'uidCheckSuffix'), 12); $return[] = $configHostContainer; } // common options - $configOptionsContainer = new htmlTable(); - $configOptionsContainer->addElement(new htmlSubTitle(_('Options')), true); - $configOptionsContainer->addElement(new htmlTableExtendedSelect('posixAccount_pwdHash', getSupportedHashTypes(), - array('SSHA'), _("Password hash type"), 'pwdHash'), true); - $configOptionsContainer->addElement(new htmlTableExtendedInputTextarea('posixAccount_shells', implode("\r\n", $this->getShells()), 30, 4, _('Login shells'), 'loginShells'), true); - $hiddenOptionsContainer = new htmlGroup(); - $hiddenOptionsContainer->colspan = 5; - $hiddenOptionsContainerHead = new htmlTable(); + $configOptionsContainer = new htmlResponsiveRow(); + $configOptionsContainer->add(new htmlSubTitle(_('Options')), 12); + $configOptionsContainer->add(new htmlResponsiveSelect('posixAccount_pwdHash', getSupportedHashTypes(), + array('SSHA'), _("Password hash type"), 'pwdHash'), 12); + $configOptionsContainer->add(new htmlResponsiveInputTextarea('posixAccount_shells', implode("\r\n", $this->getShells()), 30, 4, _('Login shells'), 'loginShells'), 12); + $hiddenOptionsContainerHead = new htmlGroup(); $hiddenOptionsContainerHead->addElement(new htmlOutputText(_('Hidden options'))); $hiddenOptionsContainerHead->addElement(new htmlHelpLink('hiddenOptions')); - $hiddenOptionsContainer->addElement($hiddenOptionsContainerHead); - $configContainerOptions = new htmlTable(); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('posixAccount_hidegecos', false, _('Gecos'), null, false)); + $configOptionsContainer->addLabel($hiddenOptionsContainerHead, 12); + $configOptionsContainer->addField(new htmlOutputText('')); + $configOptionsContainer->addVerticalSpacer('0.5rem'); + $configOptionsContainer->add(new htmlResponsiveInputCheckbox('posixAccount_hidegecos', false, _('Gecos'), null, false), 12); if (isset($_SESSION['conf_config'])) { $confActiveGONModules = array_merge($_SESSION['conf_config']->get_AccountModules('group'), $_SESSION['conf_config']->get_AccountModules('gon')); if (in_array('groupOfNames', $confActiveGONModules) || in_array('groupOfMembers', $confActiveGONModules) || in_array('groupOfUniqueNames', $confActiveGONModules)) { - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('posixAccount_hidegon', false, _('Groups of names'), null, false)); - $configContainerOptions->addElement(new htmlOutputText(' ')); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('posixAccount_hideposixGroups', false, _('Unix groups'), null, false)); + $configOptionsContainer->add(new htmlResponsiveInputCheckbox('posixAccount_hidegon', false, _('Groups of names'), null, false), 12); + $configOptionsContainer->add(new htmlResponsiveInputCheckbox('posixAccount_hideposixGroups', false, _('Unix groups'), null, false), 12); } } - $hiddenOptionsContainer->addElement($configContainerOptions); - $configOptionsContainer->addElement($hiddenOptionsContainer, true); - $advancedOptions = new htmlTable(); - $advancedOptions->addElement(new htmlTableExtendedInputCheckbox('posixAccount_primaryGroupAsSecondary', false, _('Set primary group as memberUid'), 'primaryGroupAsSecondary'), true); + $configOptionsContainer->addVerticalSpacer('1rem'); + $advancedOptions = new htmlResponsiveRow(); + $advancedOptions->add(new htmlResponsiveInputCheckbox('posixAccount_primaryGroupAsSecondary', false, _('Set primary group as memberUid'), 'primaryGroupAsSecondary'), 12); $isWindows = array_key_exists('windowsUser', $allScopes); if ($isWindows) { - $advancedOptions->addElement(new htmlTableExtendedInputCheckbox('posixAccount_noObjectClass', false, _('Do not add object class'), 'noObjectClass'), true); + $advancedOptions->add(new htmlResponsiveInputCheckbox('posixAccount_noObjectClass', false, _('Do not add object class'), 'noObjectClass'), 12); } - $advancedOptions->addElement(new htmlTableExtendedInputField(_('User name suggestion'), 'posixAccount_userNameSuggestion', '@givenname@%sn%', 'userNameSuggestion')); + $advancedOptions->add(new htmlResponsiveInputField(_('User name suggestion'), 'posixAccount_userNameSuggestion', '@givenname@%sn%', 'userNameSuggestion'), 12); $advancedOptionsAccordion = new htmlAccordion('posixAccountAdvancedOptions', array(_('Advanced options') => $advancedOptions), false); $advancedOptionsAccordion->colspan = 5; - $configOptionsContainer->addElement($advancedOptionsAccordion); + $configOptionsContainer->add($advancedOptionsAccordion, 12); $return[] = $configOptionsContainer; return $return; diff --git a/lam/lib/modules/posixGroup.inc b/lam/lib/modules/posixGroup.inc index ce68a323..893a3247 100644 --- a/lam/lib/modules/posixGroup.inc +++ b/lam/lib/modules/posixGroup.inc @@ -541,23 +541,20 @@ class posixGroup extends baseModule implements passwordService { /** - * Returns a list of elements for the configuration. - * - * @param array $scopes account types (user, group, host) - * @param array $allScopes list of all modules and active scopes - * @return array configuration elements - */ - function get_configOptions($scopes, $allScopes) { + * {@inheritDoc} + * @see baseModule::get_configOptions() + */ + public function get_configOptions($scopes, $allScopes) { // configuration options - $configContainer = new htmlTable(); - $configContainer->addElement(new htmlSubTitle(_("Groups")), true); + $configContainer = new htmlResponsiveRow(); + $configContainer->add(new htmlSubTitle(_("Groups")), 12); $genOptions = array( _('Fixed range') => 'range', _('Samba ID pool') => 'sambaPool', _('Windows domain info') => 'windowsDomain', _('Magic number') => 'magicNumber' ); - $gidGeneratorSelect = new htmlTableExtendedSelect('posixGroup_gidGenerator', $genOptions, array('range'), _('GID generator'), 'gidGenerator'); + $gidGeneratorSelect = new htmlResponsiveSelect('posixGroup_gidGenerator', $genOptions, array('range'), _('GID generator'), 'gidGenerator'); $gidGeneratorSelect->setHasDescriptiveElements(true); $gidGeneratorSelect->setTableRowsToHide(array( 'range' => array('posixGroup_sambaIDPoolDN', 'posixGroup_windowsIDPoolDN', 'posixGroup_magicNumber'), @@ -571,31 +568,31 @@ class posixGroup extends baseModule implements passwordService { 'windowsDomain' => array('posixGroup_windowsIDPoolDN'), 'magicNumber' => array('posixGroup_magicNumber') )); - $configContainer->addElement($gidGeneratorSelect, true); - $minGidInput = new htmlTableExtendedInputField(_('Minimum GID number'), 'posixGroup_minGID', null, 'minMaxGID'); + $configContainer->add($gidGeneratorSelect, 12); + $minGidInput = new htmlResponsiveInputField(_('Minimum GID number'), 'posixGroup_minGID', null, 'minMaxGID'); $minGidInput->setRequired(true); - $configContainer->addElement($minGidInput, true); - $maxGidInput = new htmlTableExtendedInputField(_('Maximum GID number'), 'posixGroup_maxGID', null, 'minMaxGID'); + $configContainer->add($minGidInput, 12); + $maxGidInput = new htmlResponsiveInputField(_('Maximum GID number'), 'posixGroup_maxGID', null, 'minMaxGID'); $maxGidInput->setRequired(true); - $configContainer->addElement($maxGidInput, true); - $gidGeneratorDN = new htmlTableExtendedInputField(_('Samba ID pool DN'), 'posixGroup_sambaIDPoolDN', null, 'sambaIDPoolDN'); + $configContainer->add($maxGidInput, 12); + $gidGeneratorDN = new htmlResponsiveInputField(_('Samba ID pool DN'), 'posixGroup_sambaIDPoolDN', null, 'sambaIDPoolDN'); $gidGeneratorDN->setRequired(true); - $configContainer->addElement($gidGeneratorDN, true); - $winGeneratorDN = new htmlTableExtendedInputField(_('Windows domain info DN'), 'posixGroup_windowsIDPoolDN', null, 'windowsIDPoolDN'); + $configContainer->add($gidGeneratorDN, 12); + $winGeneratorDN = new htmlResponsiveInputField(_('Windows domain info DN'), 'posixGroup_windowsIDPoolDN', null, 'windowsIDPoolDN'); $winGeneratorDN->setRequired(true); - $configContainer->addElement($winGeneratorDN, true); - $magicNumber = new htmlTableExtendedInputField(_('Magic number'), 'posixGroup_magicNumber', null, 'magicNumber'); + $configContainer->add($winGeneratorDN, 12); + $magicNumber = new htmlResponsiveInputField(_('Magic number'), 'posixGroup_magicNumber', null, 'magicNumber'); $magicNumber->setRequired(true); - $configContainer->addElement($magicNumber, true); - $configContainer->addElement(new htmlTableExtendedInputField(_('Suffix for GID/group name check'), 'posixGroup_gidCheckSuffix', '', 'gidCheckSuffix'), true); - $configContainer->addElement(new htmlTableExtendedInputCheckbox('posixGroup_hidememberUid', false, _('Disable membership management'), 'hidememberUid'), true); + $configContainer->add($magicNumber, 12); + $configContainer->add(new htmlResponsiveInputField(_('Suffix for GID/group name check'), 'posixGroup_gidCheckSuffix', '', 'gidCheckSuffix'), 12); + $configContainer->add(new htmlResponsiveInputCheckbox('posixGroup_hidememberUid', false, _('Disable membership management'), 'hidememberUid'), 12); if ((!empty($allScopes['groupOfNames']) && in_array('group', $allScopes['groupOfNames'])) || (!empty($allScopes['groupOfUniqueNames']) && in_array('group', $allScopes['groupOfUniqueNames']))) { - $configContainer->addElement(new htmlTableExtendedInputCheckbox('posixGroup_autoSyncGon', false, _('Force sync with group of names'), 'autoSyncGon'), true); + $configContainer->add(new htmlResponsiveInputCheckbox('posixGroup_autoSyncGon', false, _('Force sync with group of names'), 'autoSyncGon'), 12); } // display password hash option only if posixAccount module is not used if (!isset($allScopes['posixAccount'])) { - $configContainer->addElement(new htmlTableExtendedSelect('posixAccount_pwdHash', getSupportedHashTypes(), array('SSHA'), _("Password hash type"), 'pwdHash')); + $configContainer->add(new htmlResponsiveSelect('posixAccount_pwdHash', getSupportedHashTypes(), array('SSHA'), _("Password hash type"), 'pwdHash'), 12); } return $configContainer; } diff --git a/lam/lib/modules/puppetClient.inc b/lam/lib/modules/puppetClient.inc index becdff7b..e20f4985 100644 --- a/lam/lib/modules/puppetClient.inc +++ b/lam/lib/modules/puppetClient.inc @@ -516,26 +516,14 @@ class puppetClient extends baseModule { } /** - * 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); + $return = new htmlResponsiveRow(); // config options - $configContainer = new htmlTable(); - $configContainer->addElement(new htmlTableExtendedInputTextarea('puppetClient_environments', "production\r\ntesting", 30, 5, _('Predefined environments'), 'predefinedEnvironments'), true); - $configContainer->addElement(new htmlTableExtendedInputTextarea('puppetClient_enforceClasses', '', 30, 5, _('Enforce classes'), 'enforceClasses'), true); - $return[] = $configContainer; + $return->add(new htmlResponsiveInputTextarea('puppetClient_environments', "production\r\ntesting", 30, 5, _('Predefined environments'), 'predefinedEnvironments'), 12); + $return->add(new htmlResponsiveInputTextarea('puppetClient_enforceClasses', '', 30, 5, _('Enforce classes'), 'enforceClasses'), 12); return $return; } diff --git a/lam/lib/modules/pykotaUser.inc b/lam/lib/modules/pykotaUser.inc index 00694a7d..03d0879a 100644 --- a/lam/lib/modules/pykotaUser.inc +++ b/lam/lib/modules/pykotaUser.inc @@ -259,10 +259,6 @@ class pykotaUser extends baseModule { $selfServiceContainer->addElement(new htmlHelpLink('jobSuffix', get_class($this)), true); $return['selfServiceSettings'] = $selfServiceContainer; } - // config options - $configContainer = new htmlTable(); - $configContainer->addElement(new htmlTableExtendedInputField(_('Job suffix'), 'pykotaUser_jobSuffix', '', 'jobSuffix'), true); - $return['config_options']['all'] = $configContainer; // configuration checks $return['config_checks']['all']['pykotaUser_jobSuffix'] = array ( 'type' => 'ext_preg', @@ -1210,6 +1206,16 @@ class pykotaUser extends baseModule { return array_values($jobs); } + /** + * {@inheritDoc} + * @see baseModule::get_configOptions() + */ + public function get_configOptions($scopes, $allScopes) { + $configContainer = new htmlResponsiveRow(); + $configContainer->add(new htmlResponsiveInputField(_('Job suffix'), 'pykotaUser_jobSuffix', '', 'jobSuffix'), 12); + return $configContainer; + } + } diff --git a/lam/lib/modules/sambaSamAccount.inc b/lam/lib/modules/sambaSamAccount.inc index f4df4491..3e673525 100644 --- a/lam/lib/modules/sambaSamAccount.inc +++ b/lam/lib/modules/sambaSamAccount.inc @@ -1869,49 +1869,37 @@ class sambaSamAccount extends baseModule implements passwordService { if (!in_array('user', $scopes)) { return $return; } - $configContainer = new htmlTable(); + $configContainer = new htmlResponsiveRow(); // password history - $history = new htmlTable(); $historyOptions = array( _('yes - ordered ascending') => 'yes_deleteLast', _('yes - ordered descending') => 'yes_deleteFirst', _('no') => 'no' ); - $historySelect = new htmlTableExtendedSelect('sambaSamAccount_history', $historyOptions, array('yes_deleteLast'), _("Password history"), 'history'); + $historySelect = new htmlResponsiveSelect('sambaSamAccount_history', $historyOptions, array('yes_deleteLast'), _("Password history"), 'history'); $historySelect->setHasDescriptiveElements(true); - $history->addElement($historySelect, true); - $configContainer->addElement($history, true); + $configContainer->add($historySelect, 12); // disable LM passwords - $disableLM = new htmlTable(); $yesNo = array(_('yes') => 'yes', _('no') => 'no'); - $lmYesNoSelect = new htmlTableExtendedSelect('sambaSamAccount_lmHash', $yesNo, array('yes'), _("Disable LM hashes"), 'lmHash'); + $lmYesNoSelect = new htmlResponsiveSelect('sambaSamAccount_lmHash', $yesNo, array('yes'), _("Disable LM hashes"), 'lmHash'); $lmYesNoSelect->setHasDescriptiveElements(true); - $disableLM->addElement($lmYesNoSelect, true); - $configContainer->addElement($disableLM, true); + $configContainer->add($lmYesNoSelect, 12); // hidden options - $configContainer->addElement(new htmlSpacer(null, '10px'), true); + $configContainer->addVerticalSpacer('1rem'); $configHiddenLabelGroup = new htmlGroup(); $configHiddenLabelGroup->addElement(new htmlOutputText(_('Hidden options') . ' ')); $configHiddenLabelGroup->addElement(new htmlHelpLink('hiddenOptions')); - $configContainer->addElement($configHiddenLabelGroup, true); - $hiddenContainer = new htmlTable(); - $hiddenContainer->colspan = 5; - $hiddenContainer->addElement(new htmlTableExtendedInputCheckbox('sambaSamAccount_hideHomeDrive', false, _('Home drive'), null, false)); - $hiddenContainer->addElement(new htmlOutputText(' ')); - $hiddenContainer->addElement(new htmlTableExtendedInputCheckbox('sambaSamAccount_hideHomePath', false, _('Home path'), null, false)); - $hiddenContainer->addElement(new htmlOutputText(' ')); - $hiddenContainer->addElement(new htmlTableExtendedInputCheckbox('sambaSamAccount_hideProfilePath', false, _('Profile path'), null, false)); - $hiddenContainer->addElement(new htmlOutputText(' ')); - $hiddenContainer->addElement(new htmlTableExtendedInputCheckbox('sambaSamAccount_hideLogonScript', false, _('Logon script'), null, false)); - $hiddenContainer->addElement(new htmlOutputText(' ')); - $hiddenContainer->addElement(new htmlTableExtendedInputCheckbox('sambaSamAccount_hideSambaPwdLastSet', false, _('Last password change'), null, false)); - $hiddenContainer->addNewLine(); - $hiddenContainer->addElement(new htmlTableExtendedInputCheckbox('sambaSamAccount_hideWorkstations', false, _('Samba workstations'), null, false)); - $hiddenContainer->addElement(new htmlOutputText(' ')); - $hiddenContainer->addElement(new htmlTableExtendedInputCheckbox('sambaSamAccount_hideLogonHours', false, _('Logon hours'), null, false)); - $hiddenContainer->addElement(new htmlOutputText(' ')); - $hiddenContainer->addElement(new htmlTableExtendedInputCheckbox('sambaSamAccount_hideTerminalServer', false, _('Terminal server options'), null, false)); - $configContainer->addElement($hiddenContainer); + $configContainer->add($configHiddenLabelGroup, 12); + $configContainer->addVerticalSpacer('0.5rem'); + $configContainer->add(new htmlResponsiveInputCheckbox('sambaSamAccount_hideHomeDrive', false, _('Home drive'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('sambaSamAccount_hideHomePath', false, _('Home path'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('sambaSamAccount_hideProfilePath', false, _('Profile path'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('sambaSamAccount_hideLogonScript', false, _('Logon script'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('sambaSamAccount_hideSambaPwdLastSet', false, _('Last password change'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('sambaSamAccount_hideWorkstations', false, _('Samba workstations'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('sambaSamAccount_hideLogonHours', false, _('Logon hours'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('sambaSamAccount_hideTerminalServer', false, _('Terminal server options'), null, true), 12, 4); + $configContainer->add(new htmlOutputText(''), 12, 4); $return[] = $configContainer; return $return; } diff --git a/lam/lib/modules/windowsGroup.inc b/lam/lib/modules/windowsGroup.inc index 91bd8a8b..37b44e20 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, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsGroup_hidemanagedBy', false, _('Managed by'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsGroup_hidemsSFU30Name', true, _('NIS name'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsGroup_hidemsSFU30NisDomain', true, _('NIS domain'), null, true), 12, 4); + for ($i = 0; $i < 2; $i++) { + $configContainer->add(new htmlOutputText(''), 0, 4); + } + return $configContainer; + } + } diff --git a/lam/lib/modules/windowsUser.inc b/lam/lib/modules/windowsUser.inc index 6923834d..b61891db 100644 --- a/lam/lib/modules/windowsUser.inc +++ b/lam/lib/modules/windowsUser.inc @@ -3184,67 +3184,52 @@ class windowsUser 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) { // configuration options - $configContainer = new htmlTable(); - $configContainerHead = new htmlTable(); - $configContainerHead->addElement(new htmlTableExtendedInputTextarea('windowsUser_domains', '', 30, 3, _('Domains'), 'domains')); - $configContainer->addElement($configContainerHead, true); - $configContainer->addVerticalSpace('10px'); + $configContainer = new htmlResponsiveRow(); + $configContainer->add(new htmlResponsiveInputTextarea('windowsUser_domains', '', 30, 3, _('Domains'), 'domains'), 12); $configHiddenGroup = new htmlGroup(); $configHiddenGroup->addElement(new htmlOutputText(_('Hidden options'))); $configHiddenGroup->addElement(new htmlHelpLink('hiddenOptions')); - $configContainer->addElement($configHiddenGroup, true); - $configContainerOptions = new htmlTable(); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('windowsUser_hideproxyAddresses', true, _('Proxy-Addresses'), null, false)); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('windowsUser_hidefacsimileTelephoneNumber', false, _('Fax number'), null, false)); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('windowsUser_hidemobile', true, _('Mobile'), null, false)); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('windowsUser_hideotherMobile', true, _('Other mobiles'), null, false)); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('windowsUser_hidepager', true, _('Pager'), null, false)); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('windowsUser_hideotherPager', true, _('Other pagers'), null, false), true); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('windowsUser_hidesAMAccountName', true, _('User name (pre W2K)'), null, false)); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('windowsUser_hidemsSFU30Name', true, _('NIS name'), null, false)); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('windowsUser_hidemsSFU30NisDomain', true, _('NIS domain'), null, false)); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('windowsUser_hidepwdLastSet', false, _('Last password change'), null, false)); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('windowsUser_hidelastLogonTimestamp', false, _('Last login'), null, false)); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('windowsUser_hidejpegPhoto', true, _('Photo'), null, false), true); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('windowsUser_hidetitle', true, _('Job title'), null, false)); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('windowsUser_hidecarLicense', true, _('Car license'), null, false)); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('windowsUser_hideemployeeNumber', true, _('Employee number'), null, false)); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('windowsUser_hideemployeeType', true, _('Employee type'), null, false)); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('windowsUser_hidebusinessCategory', true, _('Business category'), null, false)); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('windowsUser_hidecompany', true, _('Company'), null, false), true); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('windowsUser_hidedepartment', true, _('Department'), null, false)); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('windowsUser_hideou', true, _('Organisational unit'), null, false)); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('windowsUser_hideo', true, _('Organisation'), null, false)); - $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('windowsUser_hidemanager', true, _('Manager'), null, false)); - $configContainer->addElement($configContainerOptions, true); - $advancedOptions = new htmlTable(); - $advancedOptions->addElement(new htmlSubTitle(_('Photo')), true); - $photoTable = new htmlTable(); - $photoTable->colspan = 2; - if (extension_loaded('imagick')) { - $photoTable->addElement(new htmlTableExtendedInputField(_('Maximum width (px)'), 'windowsUser_jpegPhoto_maxWidth', null, 'crop'), true); - $photoTable->addElement(new htmlTableExtendedInputField(_('Maximum height (px)'), 'windowsUser_jpegPhoto_maxHeight', null, 'crop'), true); + $configContainer->add($configHiddenGroup, 12); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsUser_hideproxyAddresses', true, _('Proxy-Addresses'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsUser_hidefacsimileTelephoneNumber', false, _('Fax number'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsUser_hidemobile', true, _('Mobile'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsUser_hideotherMobile', true, _('Other mobiles'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsUser_hidepager', true, _('Pager'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsUser_hideotherPager', true, _('Other pagers'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsUser_hidesAMAccountName', true, _('User name (pre W2K)'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsUser_hidemsSFU30Name', true, _('NIS name'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsUser_hidemsSFU30NisDomain', true, _('NIS domain'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsUser_hidepwdLastSet', false, _('Last password change'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsUser_hidelastLogonTimestamp', false, _('Last login'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsUser_hidejpegPhoto', true, _('Photo'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsUser_hidetitle', true, _('Job title'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsUser_hidecarLicense', true, _('Car license'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsUser_hideemployeeNumber', true, _('Employee number'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsUser_hideemployeeType', true, _('Employee type'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsUser_hidebusinessCategory', true, _('Business category'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsUser_hidecompany', true, _('Company'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsUser_hidedepartment', true, _('Department'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsUser_hideou', true, _('Organisational unit'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsUser_hideo', true, _('Organisation'), null, true), 12, 4); + $configContainer->add(new htmlResponsiveInputCheckbox('windowsUser_hidemanager', true, _('Manager'), null, true), 12, 4); + for ($i = 0; $i < 2; $i++) { + $configContainer->add(new htmlOutputText(''), 0, 4); } - $photoTable->addElement(new htmlTableExtendedInputField(_('Maximum file size (kB)'), 'windowsUser_jpegPhoto_maxSize'), true); - $advancedOptions->addElement($photoTable, true); + $advancedOptions = new htmlResponsiveRow(); + $advancedOptions->add(new htmlSubTitle(_('Photo')), 12); + if (extension_loaded('imagick')) { + $advancedOptions->add(new htmlResponsiveInputField(_('Maximum width (px)'), 'windowsUser_jpegPhoto_maxWidth', null, 'crop'), 12); + $advancedOptions->add(new htmlResponsiveInputField(_('Maximum height (px)'), 'windowsUser_jpegPhoto_maxHeight', null, 'crop'), 12); + } + $advancedOptions->add(new htmlResponsiveInputField(_('Maximum file size (kB)'), 'windowsUser_jpegPhoto_maxSize'), 12); $advancedOptionsAccordion = new htmlAccordion('inetOrgPersonAdvancedOptions', array(_('Advanced options') => $advancedOptions), false); $advancedOptionsAccordion->colspan = 5; - $configContainer->addElement($advancedOptionsAccordion); + $configContainer->add($advancedOptionsAccordion, 12); 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/confmodules.php b/lam/templates/config/confmodules.php index 2b24c162..e510d355 100644 --- a/lam/templates/config/confmodules.php +++ b/lam/templates/config/confmodules.php @@ -211,8 +211,12 @@ function config_showAccountModules($type, &$container) { // add account module selection $container->add(new htmlSubTitle($type->getAlias(), '../../graphics/' . $type->getIcon()), 12); - $container->add(new htmlOutputText(_("Selected modules")), 12, 6); - $container->add(new htmlOutputText(_("Available modules")), 0, 6); + if (sizeof($selOptions) > 0) { + $container->add(new htmlOutputText(_("Selected modules")), 12, 6); + } + if (sizeof($availOptions) > 0) { + $container->add(new htmlOutputText(_("Available modules")), 0, 6); + } $container->addVerticalSpacer('1rem'); // selected modules if (sizeof($selOptions) > 0) { diff --git a/lam/templates/config/moduleSettings.php b/lam/templates/config/moduleSettings.php index ad9eaa1f..db554a7e 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,25 @@ $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); + 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 "
\n"; echo "
"; }