responsive

This commit is contained in:
Roland Gruber 2019-09-06 21:13:43 +02:00
parent 533ea1645f
commit a8eb89aaf2
2 changed files with 17 additions and 12 deletions

View File

@ -1337,12 +1337,12 @@ abstract class baseModule {
/** /**
* Adds a simple read-only field to the given container. * 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 $attrName attribute name
* @param String $label field label * @param String $label field label
*/ */
protected function addSimpleReadOnlyField(&$container, $attrName, $label) { protected function addSimpleReadOnlyField(&$container, $attrName, $label) {
$val = ''; $val = ' ';
if (!empty($this->attributes[$attrName][0])) { if (!empty($this->attributes[$attrName][0])) {
$values = $this->attributes[$attrName]; $values = $this->attributes[$attrName];
array_map('htmlspecialchars', $values); array_map('htmlspecialchars', $values);
@ -1352,8 +1352,14 @@ abstract class baseModule {
if (!empty($this->attributes[$attrName]) && (sizeof($this->attributes[$attrName]) > 1)) { if (!empty($this->attributes[$attrName]) && (sizeof($this->attributes[$attrName]) > 1)) {
$labelBox->alignment = htmlElement::ALIGN_TOP; $labelBox->alignment = htmlElement::ALIGN_TOP;
} }
$container->addElement($labelBox); if ($container instanceof htmlTable) {
$container->addElement(new htmlOutputText($val, false), true); $container->addElement($labelBox);
$container->addElement(new htmlOutputText($val, false), true);
}
else {
$container->addLabel($labelBox);
$container->addField(new htmlOutputText($val, false));
}
} }
/** /**

View File

@ -137,28 +137,27 @@ class ldapPublicKey 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('ldapPublicKey', $this->attributes['objectClass'])) { if (in_array('ldapPublicKey', $this->attributes['objectClass'])) {
$this->addMultiValueInputTextField($return, 'sshPublicKey', _('SSH public key'), false, '16384', false, null, '50'); $this->addMultiValueInputTextField($return, 'sshPublicKey', _('SSH public key'), false, '16384', false, null, '50');
// file upload // file upload
$return->addElement(new htmlSpacer(null, '20px'), true); $return->addVerticalSpacer('2rem');
$return->addElement(new htmlOutputText(_('Upload file'))); $return->addLabel(new htmlOutputText(_('Upload file')));
$uploadGroup = new htmlGroup(); $uploadGroup = new htmlGroup();
$uploadGroup->addElement(new htmlInputFileUpload('sshPublicKeyFile')); $uploadGroup->addElement(new htmlInputFileUpload('sshPublicKeyFile'));
$uploadGroup->addElement(new htmlSpacer('1px', null)); $uploadGroup->addElement(new htmlSpacer('1px', null));
$uploadGroup->addElement(new htmlButton('sshPublicKeyFileSubmit', _('Upload'))); $uploadGroup->addElement(new htmlButton('sshPublicKeyFileSubmit', _('Upload')));
$uploadGroup->addElement(new htmlSpacer('5px', null)); $uploadGroup->addElement(new htmlSpacer('5px', null));
$uploadGroup->addElement(new htmlHelpLink('upload')); $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 = new htmlButton('remObjectClass', _('Remove SSH public key extension'));
$remButton->colspan = 3; $return->add($remButton, 12, 12, 12, 'text-center');
$return->addElement($remButton);
} }
else { else {
$return->addElement(new htmlButton('addObjectClass', _('Add SSH public key extension'))); $return->add(new htmlButton('addObjectClass', _('Add SSH public key extension')), 12);
} }
return $return; return $return;
} }