diff --git a/lam/lib/baseModule.inc b/lam/lib/baseModule.inc index 6bce7670..26af355e 100644 --- a/lam/lib/baseModule.inc +++ b/lam/lib/baseModule.inc @@ -1337,12 +1337,12 @@ abstract class baseModule { /** * Adds a simple read-only field to the given container. * - * @param htmlTable $container parent container + * @param htmlTable|htmlResponsiveRow $container parent container * @param String $attrName attribute name * @param String $label field label */ protected function addSimpleReadOnlyField(&$container, $attrName, $label) { - $val = ''; + $val = ' '; if (!empty($this->attributes[$attrName][0])) { $values = $this->attributes[$attrName]; array_map('htmlspecialchars', $values); @@ -1352,8 +1352,14 @@ abstract class baseModule { if (!empty($this->attributes[$attrName]) && (sizeof($this->attributes[$attrName]) > 1)) { $labelBox->alignment = htmlElement::ALIGN_TOP; } - $container->addElement($labelBox); - $container->addElement(new htmlOutputText($val, false), true); + if ($container instanceof htmlTable) { + $container->addElement($labelBox); + $container->addElement(new htmlOutputText($val, false), true); + } + else { + $container->addLabel($labelBox); + $container->addField(new htmlOutputText($val, false)); + } } /** diff --git a/lam/lib/modules/ldapPublicKey.inc b/lam/lib/modules/ldapPublicKey.inc index 565f35f3..e4369db0 100644 --- a/lam/lib/modules/ldapPublicKey.inc +++ b/lam/lib/modules/ldapPublicKey.inc @@ -137,28 +137,27 @@ class ldapPublicKey extends baseModule { * @return htmlElement HTML meta data */ function display_html_attributes() { - $return = new htmlTable(); + $return = new htmlResponsiveRow(); if (in_array('ldapPublicKey', $this->attributes['objectClass'])) { $this->addMultiValueInputTextField($return, 'sshPublicKey', _('SSH public key'), false, '16384', false, null, '50'); // file upload - $return->addElement(new htmlSpacer(null, '20px'), true); - $return->addElement(new htmlOutputText(_('Upload file'))); + $return->addVerticalSpacer('2rem'); + $return->addLabel(new htmlOutputText(_('Upload file'))); $uploadGroup = new htmlGroup(); $uploadGroup->addElement(new htmlInputFileUpload('sshPublicKeyFile')); $uploadGroup->addElement(new htmlSpacer('1px', null)); $uploadGroup->addElement(new htmlButton('sshPublicKeyFileSubmit', _('Upload'))); $uploadGroup->addElement(new htmlSpacer('5px', null)); $uploadGroup->addElement(new htmlHelpLink('upload')); - $return->addElement($uploadGroup, true); + $return->addField($uploadGroup); - $return->addElement(new htmlSpacer(null, '30px'), true); + $return->addVerticalSpacer('2rem'); $remButton = new htmlButton('remObjectClass', _('Remove SSH public key extension')); - $remButton->colspan = 3; - $return->addElement($remButton); + $return->add($remButton, 12, 12, 12, 'text-center'); } else { - $return->addElement(new htmlButton('addObjectClass', _('Add SSH public key extension'))); + $return->add(new htmlButton('addObjectClass', _('Add SSH public key extension')), 12); } return $return; }