responsive

This commit is contained in:
Roland Gruber 2019-11-04 19:54:39 +01:00
parent 50102f2c3f
commit c05d07d8f5
2 changed files with 44 additions and 35 deletions

View File

@ -220,15 +220,11 @@ class nisnetgroup extends baseModule {
$return->addField($subgroupsContainer); $return->addField($subgroupsContainer);
$return->addLabel(new htmlOutputText(' ', false)); $return->addLabel(new htmlOutputText(' ', false));
// members // members
$memberTable = new htmlTable(); $membersLabel = new htmlSubTitle(_('Members'));
$hostLabel = new htmlOutputText(_('Host')); $membersLabel->setHelpId('members');
$hostLabel->colspan = 2; $return->add($membersLabel, 12);
$memberTable->addElement($hostLabel); $titles = array(_('Host'), _('User'), _('Domain'), '');
$userLabel = new htmlOutputText(_('User')); $data = array();
$userLabel->colspan = 2;
$memberTable->addElement($userLabel);
$memberTable->addElement(new htmlOutputText(_('Domain')));
$memberTable->addElement(new htmlSpacer('5px', null), true);
if (isset($this->attributes['nisNetgroupTriple']) && (sizeof($this->attributes['nisNetgroupTriple']) > 0)) { if (isset($this->attributes['nisNetgroupTriple']) && (sizeof($this->attributes['nisNetgroupTriple']) > 0)) {
for ($i = 0; $i < sizeof($this->attributes['nisNetgroupTriple']); $i++) { for ($i = 0; $i < sizeof($this->attributes['nisNetgroupTriple']); $i++) {
$triple = substr($this->attributes['nisNetgroupTriple'][$i], 1, strlen($this->attributes['nisNetgroupTriple'][$i]) - 2); $triple = substr($this->attributes['nisNetgroupTriple'][$i], 1, strlen($this->attributes['nisNetgroupTriple'][$i]) - 2);
@ -239,29 +235,35 @@ class nisnetgroup extends baseModule {
if (isset($_POST['form_subpage_nisnetgroup_attributes_select']) && ($_POST['type'] == 'user') && ($_POST['position'] == strval($i))) { if (isset($_POST['form_subpage_nisnetgroup_attributes_select']) && ($_POST['type'] == 'user') && ($_POST['position'] == strval($i))) {
$triple[1] = $_POST['selectBox']; $triple[1] = $_POST['selectBox'];
} }
$dataRow = array();
$hostGroup = new htmlGroup();
$hostField = new htmlInputField('host_' . $i, $triple[0]); $hostField = new htmlInputField('host_' . $i, $triple[0]);
$hostField->setFieldSize(20); $hostField->setCSSClasses(array('auto-width'));
$memberTable->addElement($hostField); $hostField->setFieldSize(null);
$hostGroup->addElement($hostField);
$hostButton = new htmlAccountPageButton(get_class($this), 'select', 'host' . $i, 'host.png', true); $hostButton = new htmlAccountPageButton(get_class($this), 'select', 'host' . $i, 'host.png', true);
$hostButton->setTitle(_('Select host')); $hostButton->setTitle(_('Select host'));
$memberTable->addElement($hostButton); $hostGroup->addElement($hostButton);
$dataRow[] = $hostGroup;
$userGroup = new htmlGroup();
$userField = new htmlInputField('user_' . $i, $triple[1]); $userField = new htmlInputField('user_' . $i, $triple[1]);
$userField->setFieldSize(20); $userField->setCSSClasses(array('auto-width'));
$memberTable->addElement($userField); $userField->setFieldSize(null);
$userGroup->addElement($userField);
$userButton = new htmlAccountPageButton(get_class($this), 'select', 'user' . $i, 'user.png', true); $userButton = new htmlAccountPageButton(get_class($this), 'select', 'user' . $i, 'user.png', true);
$userButton->setTitle(_('Select user')); $userButton->setTitle(_('Select user'));
$memberTable->addElement($userButton); $userGroup->addElement($userButton);
$dataRow[] = $userGroup;
$domainField = new htmlInputField('domain_' . $i, $triple[2]); $domainField = new htmlInputField('domain_' . $i, $triple[2]);
$domainField->setFieldSize(20); $domainField->setFieldSize(null);
$memberTable->addElement($domainField); $dataRow[] = $domainField;
$memberTable->addElement(new htmlSpacer('5px', null));
$delButton = new htmlButton('del_' . $i, 'del.png', true); $delButton = new htmlButton('del_' . $i, 'del.png', true);
$delButton->setTitle(_('Delete')); $delButton->setTitle(_('Delete'));
$memberTable->addElement($delButton); $dataRow[] = $delButton;
$memberTable->addNewLine(); $data[] = $dataRow;
} }
} }
$memberTable->addElement(new htmlSpacer(null, '10px'), true); $dataRowNew = array();
$hostNew = ''; $hostNew = '';
$userNew = ''; $userNew = '';
$domainNew = ''; $domainNew = '';
@ -274,30 +276,33 @@ class nisnetgroup extends baseModule {
if (isset($_POST['domain_new'])) { if (isset($_POST['domain_new'])) {
$domainNew = $_POST['domain_new']; $domainNew = $_POST['domain_new'];
} }
$hostNewGroup = new htmlGroup();
$hostField = new htmlInputField('host_new', $hostNew); $hostField = new htmlInputField('host_new', $hostNew);
$hostField->setFieldSize(20); $hostField->setCSSClasses(array('auto-width'));
$memberTable->addElement($hostField); $hostField->setFieldSize(null);
$hostNewGroup->addElement($hostField);
$hostButton = new htmlAccountPageButton(get_class($this), 'select', 'hostNew', 'host.png', true); $hostButton = new htmlAccountPageButton(get_class($this), 'select', 'hostNew', 'host.png', true);
$hostButton->setTitle(_('Select host')); $hostButton->setTitle(_('Select host'));
$memberTable->addElement($hostButton); $hostNewGroup->addElement($hostButton);
$dataRowNew[] = $hostNewGroup;
$userNewGroup = new htmlGroup();
$userField = new htmlInputField('user_new', $userNew); $userField = new htmlInputField('user_new', $userNew);
$userField->setFieldSize(20); $userField->setCSSClasses(array('auto-width'));
$memberTable->addElement($userField); $userField->setFieldSize(null);
$userNewGroup->addElement($userField);
$userButton = new htmlAccountPageButton(get_class($this), 'select', 'userNew', 'user.png', true); $userButton = new htmlAccountPageButton(get_class($this), 'select', 'userNew', 'user.png', true);
$userButton->setTitle(_('Select user')); $userButton->setTitle(_('Select user'));
$memberTable->addElement($userButton); $userNewGroup->addElement($userButton);
$dataRowNew[] = $userNewGroup;
$domainField = new htmlInputField('domain_new', $domainNew); $domainField = new htmlInputField('domain_new', $domainNew);
$domainField->setFieldSize(20); $domainField->setFieldSize(null);
$memberTable->addElement($domainField); $dataRowNew[] = $domainField;
$memberTable->addElement(new htmlSpacer('5px', null));
$addButton = new htmlButton('add_new', 'add.png', true); $addButton = new htmlButton('add_new', 'add.png', true);
$addButton->setTitle(_('Add')); $addButton->setTitle(_('Add'));
$memberTable->addElement($addButton); $dataRowNew[] = $addButton;
$memberTable->colspan = 2; $data[] = $dataRowNew;
$membersLabel = new htmlSubTitle(_('Members')); $memberTable = new htmlResponsiveTable($titles, $data);
$membersLabel->setHelpId('members');
$return->add($membersLabel, 12);
$return->add($memberTable, 12); $return->add($memberTable, 12);
return $return; return $return;
} }

View File

@ -48,6 +48,10 @@
width: auto; width: auto;
} }
input.auto-width {
width: auto;
}
input.maxwidth10 { input.maxwidth10 {
max-width: 10rem; max-width: 10rem;
} }