responsive

This commit is contained in:
Roland Gruber 2019-08-25 12:41:14 +02:00
parent 5668f5f634
commit 92110ed8da
1 changed files with 40 additions and 27 deletions

View File

@ -2,7 +2,7 @@
/* /*
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2011 - 2018 Roland Gruber Copyright (C) 2011 - 2019 Roland Gruber
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -336,7 +336,7 @@ class freeRadius extends baseModule {
* @return htmlElement HTML meta data * @return htmlElement HTML meta data
*/ */
function display_html_attributes() { function display_html_attributes() {
$return = new htmlTable(); $return = new htmlResponsiveRow();
if (in_array('radiusprofile', $this->attributes['objectClass'])) { if (in_array('radiusprofile', $this->attributes['objectClass'])) {
// realm // realm
if (!$this->isBooleanConfigOptionSet('freeRadius_hideRadiusRealm')) { if (!$this->isBooleanConfigOptionSet('freeRadius_hideRadiusRealm')) {
@ -365,12 +365,12 @@ class freeRadius extends baseModule {
if (isset($this->attributes['radiusExpiration'][0])) { if (isset($this->attributes['radiusExpiration'][0])) {
$radiusExpiration = $this->formatExpirationDate($this->attributes['radiusExpiration'][0]); $radiusExpiration = $this->formatExpirationDate($this->attributes['radiusExpiration'][0]);
} }
$return->addElement(new htmlOutputText('Expiration date')); $return->addLabel(new htmlOutputText('Expiration date'));
$radiusExpirationList = new htmlGroup(); $radiusExpirationList = new htmlGroup();
$radiusExpirationList->addElement(new htmlOutputText($radiusExpiration . '     ', false)); $radiusExpirationList->addElement(new htmlOutputText($radiusExpiration . '     ', false));
$radiusExpirationList->addElement(new htmlAccountPageButton(get_class($this), 'expiration', 'change', _('Change'))); $radiusExpirationList->addElement(new htmlAccountPageButton(get_class($this), 'expiration', 'change', _('Change')));
$return->addElement($radiusExpirationList); $radiusExpirationList->addElement(new htmlHelpLink('radiusExpiration'));
$return->addElement(new htmlHelpLink('radiusExpiration'), true); $return->addField($radiusExpirationList);
} }
// profile DN // profile DN
if (!$this->isBooleanConfigOptionSet('freeRadius_hideRadiusProfileDn')) { if (!$this->isBooleanConfigOptionSet('freeRadius_hideRadiusProfileDn')) {
@ -385,9 +385,9 @@ class freeRadius extends baseModule {
$profiles[getAbstractDN($this->attributes['radiusProfileDn'][0])] = $this->attributes['radiusProfileDn'][0]; $profiles[getAbstractDN($this->attributes['radiusProfileDn'][0])] = $this->attributes['radiusProfileDn'][0];
} }
} }
$profileSelect = new htmlTableExtendedSelect('radiusProfileDn', $profiles, $profile, _('Profile'), 'radiusProfileDn'); $profileSelect = new htmlResponsiveSelect('radiusProfileDn', $profiles, $profile, _('Profile'), 'radiusProfileDn');
$profileSelect->setHasDescriptiveElements(true); $profileSelect->setHasDescriptiveElements(true);
$return->addElement($profileSelect, true); $return->add($profileSelect, 12);
} }
// enabled // enabled
if (!$this->isBooleanConfigOptionSet('freeRadius_hideDialupAccess')) { if (!$this->isBooleanConfigOptionSet('freeRadius_hideDialupAccess')) {
@ -400,18 +400,17 @@ class freeRadius extends baseModule {
} }
} }
$enabledOptions = array('-' => '', _('Yes') => 'true', _('No') => 'false'); $enabledOptions = array('-' => '', _('Yes') => 'true', _('No') => 'false');
$enabledSelect = new htmlTableExtendedSelect('dialupAccess', $enabledOptions, $enabled, _('Enabled'), 'dialupAccess'); $enabledSelect = new htmlResponsiveSelect('dialupAccess', $enabledOptions, $enabled, _('Enabled'), 'dialupAccess');
$enabledSelect->setHasDescriptiveElements(true); $enabledSelect->setHasDescriptiveElements(true);
$return->addElement($enabledSelect, true); $return->add($enabledSelect, 12);
} }
// button to remove extension // button to remove extension
$return->addElement(new htmlSpacer(null, '10px'), true); $return->addVerticalSpacer('2rem');
$remButton = new htmlButton('remObjectClass', _('Remove FreeRadius extension')); $remButton = new htmlButton('remObjectClass', _('Remove FreeRadius extension'));
$remButton->colspan = 3; $return->add($remButton, 12, 12, 12, 'text-center');
$return->addElement($remButton);
} }
else { else {
$return->addElement(new htmlButton('addObjectClass', _('Add FreeRadius extension'))); $return->add(new htmlButton('addObjectClass', _('Add FreeRadius extension')), 12);
} }
return $return; return $return;
} }
@ -503,7 +502,7 @@ class freeRadius extends baseModule {
* @return htmlElement meta HTML code * @return htmlElement meta HTML code
*/ */
function display_html_expiration() { function display_html_expiration() {
$return = new htmlTable(); $return = new htmlResponsiveRow();
$attr = 'radiusExpiration'; $attr = 'radiusExpiration';
$text = _('Expiration date'); $text = _('Expiration date');
$help = "radiusExpiration"; $help = "radiusExpiration";
@ -534,26 +533,40 @@ class freeRadius extends baseModule {
for ( $i=1; $i<=31; $i++ ) { for ( $i=1; $i<=31; $i++ ) {
$dayList[] = str_pad($i, 2, '0', STR_PAD_LEFT); $dayList[] = str_pad($i, 2, '0', STR_PAD_LEFT);
} }
for ( $i=2003; $i<=2050; $i++ ) $yearList[] = $i; for ( $i=2003; $i<=2050; $i++ ) {
$return->addElement(new htmlOutputText($text)); $yearList[] = $i;
$return->addElement(new htmlSelect('expire_day', $dayList, array($day))); }
$return->addLabel(new htmlOutputText($text));
$dateGroup = new htmlGroup();
$daySelect = new htmlSelect('expire_day', $dayList, array($day));
$daySelect->setWidth('3rem');
$dateGroup->addElement($daySelect);
$monthSelect = new htmlSelect('expire_mon', freeRadius::$monthList, array($month)); $monthSelect = new htmlSelect('expire_mon', freeRadius::$monthList, array($month));
$monthSelect->setHasDescriptiveElements(true); $monthSelect->setHasDescriptiveElements(true);
$return->addElement($monthSelect); $monthSelect->setWidth('3rem');
$return->addElement(new htmlSelect('expire_yea', $yearList, array($year))); $dateGroup->addElement($monthSelect);
$return->addElement(new htmlSpacer('10px', null)); $yearSelect = new htmlSelect('expire_yea', $yearList, array($year));
$return->addElement(new htmlSelect('expire_hour', $hourList, array($hour))); $yearSelect->setWidth('5rem');
$return->addElement(new htmlSelect('expire_minute', $minuteList, array($minute))); $dateGroup->addElement($yearSelect);
$return->addElement(new htmlHelpLink($help), true); $dateGroup->addElement(new htmlSpacer('10px', null));
$return->addElement(new htmlSpacer(null, '10px'), true); $hourSelect = new htmlSelect('expire_hour', $hourList, array($hour));
$buttons = new htmlTable(); $hourSelect->setWidth('3rem');
$dateGroup->addElement($hourSelect);
$minuteSelect = new htmlSelect('expire_minute', $minuteList, array($minute));
$minuteSelect->setWidth('3rem');
$dateGroup->addElement($minuteSelect);
$dateGroup->addElement(new htmlHelpLink($help));
$return->addField($dateGroup);
$return->addVerticalSpacer('2rem');
$buttons = new htmlGroup();
$buttons->addElement(new htmlAccountPageButton(get_class($this), 'attributes', 'change' . $attr, _('Change'))); $buttons->addElement(new htmlAccountPageButton(get_class($this), 'attributes', 'change' . $attr, _('Change')));
$buttons->addElement(new htmlSpacer('0.5rem', null));
if (isset($this->attributes[$attr][0])) { if (isset($this->attributes[$attr][0])) {
$buttons->addElement(new htmlAccountPageButton(get_class($this), 'attributes', 'del' . $attr, _('Remove'))); $buttons->addElement(new htmlAccountPageButton(get_class($this), 'attributes', 'del' . $attr, _('Remove')));
$buttons->addElement(new htmlSpacer('0.5rem', null));
} }
$buttons->addElement(new htmlAccountPageButton(get_class($this), 'attributes', 'back' . $attr, _('Cancel'))); $buttons->addElement(new htmlAccountPageButton(get_class($this), 'attributes', 'back' . $attr, _('Cancel')));
$buttons->colspan = 6; $return->add($buttons, 12);
$return->addElement($buttons);
return $return; return $return;
} }