responsive tools

This commit is contained in:
Roland Gruber 2018-05-19 13:26:35 +02:00
parent dd2308f780
commit 179f08ddb2
4 changed files with 52 additions and 62 deletions

View File

@ -2006,76 +2006,75 @@ class inetOrgPerson extends baseModule implements passwordService {
$modules = $typeManager->getConfiguredType($typeId)->getModules(); $modules = $typeManager->getConfiguredType($typeId)->getModules();
$profileElements = array(); $profileElements = array();
if (!$this->isUnixActive($modules)) { if (!$this->isUnixActive($modules)) {
$profileElements[] = new htmlTableExtendedInputField(_('Common name'), 'inetOrgPerson_cn', null, 'cn'); $profileElements[] = new htmlResponsiveInputField(_('Common name'), 'inetOrgPerson_cn', null, 'cn');
} }
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideInitials')) { if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideInitials')) {
$profileElements[] = new htmlTableExtendedInputField(_('Initials'), 'inetOrgPerson_initials', null, 'initials'); $profileElements[] = new htmlResponsiveInputField(_('Initials'), 'inetOrgPerson_initials', null, 'initials');
} }
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideDescription')) { if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideDescription')) {
$profileElements[] = new htmlTableExtendedInputField(_('Description'), 'inetOrgPerson_description', null, 'description'); $profileElements[] = new htmlResponsiveInputField(_('Description'), 'inetOrgPerson_description', null, 'description');
} }
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideStreet')) { if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideStreet')) {
$profileElements[] = new htmlTableExtendedInputField(_('Street'), 'inetOrgPerson_street', null, 'streetList'); $profileElements[] = new htmlResponsiveInputField(_('Street'), 'inetOrgPerson_street', null, 'streetList');
} }
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hidePostOfficeBox')) { if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hidePostOfficeBox')) {
$profileElements[] = new htmlTableExtendedInputField(_('Post office box'), 'inetOrgPerson_postOfficeBox', null, 'postOfficeBoxList'); $profileElements[] = new htmlResponsiveInputField(_('Post office box'), 'inetOrgPerson_postOfficeBox', null, 'postOfficeBoxList');
} }
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hidePostalCode')) { if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hidePostalCode')) {
$profileElements[] = new htmlTableExtendedInputField(_('Postal code'), 'inetOrgPerson_postalCode', null, 'postalCodeList'); $profileElements[] = new htmlResponsiveInputField(_('Postal code'), 'inetOrgPerson_postalCode', null, 'postalCodeList');
} }
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideLocation')) { if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideLocation')) {
$profileElements[] = new htmlTableExtendedInputField(_('Location'), 'inetOrgPerson_l', null, 'lList'); $profileElements[] = new htmlResponsiveInputField(_('Location'), 'inetOrgPerson_l', null, 'lList');
} }
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideState')) { if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideState')) {
$profileElements[] = new htmlTableExtendedInputField(_('State'), 'inetOrgPerson_st', null, 'stList'); $profileElements[] = new htmlResponsiveInputField(_('State'), 'inetOrgPerson_st', null, 'stList');
} }
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hidePostalAddress')) { if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hidePostalAddress')) {
$profileElements[] = new htmlTableExtendedInputField(_('Postal address'), 'inetOrgPerson_postalAddress', null, 'postalAddress'); $profileElements[] = new htmlResponsiveInputField(_('Postal address'), 'inetOrgPerson_postalAddress', null, 'postalAddress');
} }
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideRegisteredAddress')) { if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideRegisteredAddress')) {
$profileElements[] = new htmlTableExtendedInputField(_('Registered address'), 'inetOrgPerson_registeredAddress', null, 'registeredAddress'); $profileElements[] = new htmlResponsiveInputField(_('Registered address'), 'inetOrgPerson_registeredAddress', null, 'registeredAddress');
} }
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideOfficeName')) { if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideOfficeName')) {
$profileElements[] = new htmlTableExtendedInputField(_('Office name'), 'inetOrgPerson_physicalDeliveryOfficeName', null, 'physicalDeliveryOfficeName'); $profileElements[] = new htmlResponsiveInputField(_('Office name'), 'inetOrgPerson_physicalDeliveryOfficeName', null, 'physicalDeliveryOfficeName');
} }
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideRoomNumber')) { if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideRoomNumber')) {
$profileElements[] = new htmlTableExtendedInputField(_('Room number'), 'inetOrgPerson_roomNumber', null, 'roomNumber'); $profileElements[] = new htmlResponsiveInputField(_('Room number'), 'inetOrgPerson_roomNumber', null, 'roomNumber');
} }
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideTelephoneNumber')) { if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideTelephoneNumber')) {
$profileElements[] = new htmlTableExtendedInputField(_('Telephone number'), 'inetOrgPerson_telephoneNumber', null, 'telephoneNumberList'); $profileElements[] = new htmlResponsiveInputField(_('Telephone number'), 'inetOrgPerson_telephoneNumber', null, 'telephoneNumberList');
} }
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideFaxNumber')) { if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideFaxNumber')) {
$profileElements[] = new htmlTableExtendedInputField(_('Fax number'), 'inetOrgPerson_facsimileTelephoneNumber', null, 'facsimileTelephoneNumberList'); $profileElements[] = new htmlResponsiveInputField(_('Fax number'), 'inetOrgPerson_facsimileTelephoneNumber', null, 'facsimileTelephoneNumberList');
} }
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideEMailAddress')) { if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideEMailAddress')) {
$profileElements[] = new htmlTableExtendedInputField(_('Email address'), 'inetOrgPerson_mail', null, 'mailList'); $profileElements[] = new htmlResponsiveInputField(_('Email address'), 'inetOrgPerson_mail', null, 'mailList');
} }
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideLabeledURI')) { if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideLabeledURI')) {
$profileElements[] = new htmlTableExtendedInputField(_('Web site'), 'inetOrgPerson_labeledURI', null, 'labeledURIList'); $profileElements[] = new htmlResponsiveInputField(_('Web site'), 'inetOrgPerson_labeledURI', null, 'labeledURIList');
} }
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideDepartments')) { if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideDepartments')) {
$profileElements[] = new htmlTableExtendedInputField(_('Department'), 'inetOrgPerson_departmentNumber', null, 'departmentNumberList'); $profileElements[] = new htmlResponsiveInputField(_('Department'), 'inetOrgPerson_departmentNumber', null, 'departmentNumberList');
} }
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideOu')) { if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideOu')) {
$profileElements[] = new htmlTableExtendedInputField(_('Organisational unit'), 'inetOrgPerson_ou', null, 'ouList'); $profileElements[] = new htmlResponsiveInputField(_('Organisational unit'), 'inetOrgPerson_ou', null, 'ouList');
} }
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideO')) { if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideO')) {
$profileElements[] = new htmlTableExtendedInputField(_('Organisation'), 'inetOrgPerson_o', null, 'oList'); $profileElements[] = new htmlResponsiveInputField(_('Organisation'), 'inetOrgPerson_o', null, 'oList');
} }
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideJobTitle')) { if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideJobTitle')) {
$profileElements[] = new htmlTableExtendedInputField(_('Job title'), 'inetOrgPerson_title', null, 'title'); $profileElements[] = new htmlResponsiveInputField(_('Job title'), 'inetOrgPerson_title', null, 'title');
} }
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideEmployeeType')) { if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideEmployeeType')) {
$profileElements[] = new htmlTableExtendedInputField(_('Employee type'), 'inetOrgPerson_employeeType', null, 'employeeType'); $profileElements[] = new htmlResponsiveInputField(_('Employee type'), 'inetOrgPerson_employeeType', null, 'employeeType');
} }
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideBusinessCategory')) { if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideBusinessCategory')) {
$profileElements[] = new htmlTableExtendedInputField(_('Business category'), 'inetOrgPerson_businessCategory', null, 'businessCategory'); $profileElements[] = new htmlResponsiveInputField(_('Business category'), 'inetOrgPerson_businessCategory', null, 'businessCategory');
} }
if (sizeof($profileElements) > 0) { if (sizeof($profileElements) > 0) {
$profileContainer = new htmlTable(); $profileContainer = new htmlResponsiveRow();
for ($i = 0; $i < sizeof($profileElements); $i++) { for ($i = 0; $i < sizeof($profileElements); $i++) {
$profileContainer->addElement($profileElements[$i]); $profileContainer->add($profileElements[$i], 12);
$profileContainer->addNewLine();
} }
return $profileContainer; return $profileContainer;
} }

View File

@ -3,10 +3,9 @@ use \LAM\PDF\PDFTable;
use \LAM\PDF\PDFTableCell; use \LAM\PDF\PDFTableCell;
use \LAM\PDF\PDFTableRow; use \LAM\PDF\PDFTableRow;
/* /*
$Id$
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) 2016 - 2017 Roland Gruber Copyright (C) 2016 - 2018 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
@ -214,17 +213,17 @@ class nisNetGroupHost extends nisNetGroupUser {
foreach ($groups as $group) { foreach ($groups as $group) {
$groupOptions[$group['cn'][0]] = $group['cn'][0] . '#+#' . $group['dn']; $groupOptions[$group['cn'][0]] = $group['cn'][0] . '#+#' . $group['dn'];
} }
$return = new htmlTable(); $return = new htmlResponsiveRow();
$return->addElement(new htmlOutputText(_('Group'))); $labels = array(_('Group'), _('User name'), _('Domain name'));
$return->addElement(new htmlOutputText(_('User name'))); $data = array();
$return->addElement(new htmlOutputText(_('Domain name')), true);
for ($i = 0; $i < 5; $i++) { for ($i = 0; $i < 5; $i++) {
$select = new htmlSelect('nisNetGroupUser_group' . $i, $groupOptions, array('')); $select = new htmlSelect('nisNetGroupUser_group' . $i, $groupOptions, array(''));
$select->setHasDescriptiveElements(true); $select->setHasDescriptiveElements(true);
$return->addElement($select); $data[$i][] = $select;
$return->addElement(new htmlInputField('nisNetGroupUser_user' . $i)); $data[$i][] = new htmlInputField('nisNetGroupUser_user' . $i);
$return->addElement(new htmlInputField('nisNetGroupUser_domain' . $i), true); $data[$i][] = new htmlInputField('nisNetGroupUser_domain' . $i);
} }
$return->add(new htmlResponsiveTable($labels, $data), 12);
return $return; return $return;
} }

View File

@ -4,10 +4,9 @@ use \LAM\PDF\PDFTableCell;
use \LAM\PDF\PDFTableRow; use \LAM\PDF\PDFTableRow;
use \LAM\TYPES\TypeManager; use \LAM\TYPES\TypeManager;
/* /*
$Id$
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) 2015 - 2017 Roland Gruber Copyright (C) 2015 - 2018 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
@ -436,17 +435,17 @@ class nisNetGroupUser extends baseModule {
foreach ($groups as $group) { foreach ($groups as $group) {
$groupOptions[$group['cn'][0]] = $group['cn'][0] . '#+#' . $group['dn']; $groupOptions[$group['cn'][0]] = $group['cn'][0] . '#+#' . $group['dn'];
} }
$return = new htmlTable(); $return = new htmlResponsiveRow();
$return->addElement(new htmlOutputText(_('Group'))); $labels = array(_('Group'), _('Host name'), _('Domain name'));
$return->addElement(new htmlOutputText(_('Host name'))); $data = array();
$return->addElement(new htmlOutputText(_('Domain name')), true);
for ($i = 0; $i < 5; $i++) { for ($i = 0; $i < 5; $i++) {
$select = new htmlSelect('nisNetGroupUser_group' . $i, $groupOptions, array('')); $select = new htmlSelect('nisNetGroupUser_group' . $i, $groupOptions, array(''));
$select->setHasDescriptiveElements(true); $select->setHasDescriptiveElements(true);
$return->addElement($select); $data[$i][] = $select;
$return->addElement(new htmlInputField('nisNetGroupUser_host' . $i)); $data[$i][] = new htmlInputField('nisNetGroupUser_host' . $i);
$return->addElement(new htmlInputField('nisNetGroupUser_domain' . $i), true); $data[$i][] = new htmlInputField('nisNetGroupUser_domain' . $i);
} }
$return->add(new htmlResponsiveTable($labels, $data), 12);
return $return; return $return;
} }

View File

@ -1726,7 +1726,7 @@ class posixAccount extends baseModule implements passwordService {
* {@inheritDoc} * {@inheritDoc}
*/ */
function get_profileOptions($typeId) { function get_profileOptions($typeId) {
$return = new htmlTable(); $return = new htmlResponsiveRow();
$typeManager = new TypeManager(); $typeManager = new TypeManager();
$modules = $typeManager->getConfiguredType($typeId)->getModules(); $modules = $typeManager->getConfiguredType($typeId)->getModules();
$groupList = $this->findGroups($modules); $groupList = $this->findGroups($modules);
@ -1737,12 +1737,12 @@ class posixAccount extends baseModule implements passwordService {
if ($this->get_scope() == 'user') { if ($this->get_scope() == 'user') {
$shelllist = $this->getShells(); // list of all valid shells $shelllist = $this->getShells(); // list of all valid shells
// primary Unix group // primary Unix group
$return->addElement(new htmlTableExtendedSelect('posixAccount_primaryGroup', $groups, array(), _('Primary group'), 'gidNumber'), true); $return->add(new htmlResponsiveSelect('posixAccount_primaryGroup', $groups, array(), _('Primary group'), 'gidNumber'), 12);
// additional group memberships // additional group memberships
$addGroupSelect = new htmlTableExtendedSelect('posixAccount_additionalGroup', $groups, array(), _('Additional groups'), 'addgroup', 10); $addGroupSelect = new htmlResponsiveSelect('posixAccount_additionalGroup', $groups, array(), _('Additional groups'), 'addgroup', 10);
$addGroupSelect->setMultiSelect(true); $addGroupSelect->setMultiSelect(true);
$addGroupSelect->setTransformSingleSelect(false); $addGroupSelect->setTransformSingleSelect(false);
$return->addElement($addGroupSelect, true); $return->add($addGroupSelect, 12);
// group of names // group of names
if (self::areGroupOfNamesActive()) { if (self::areGroupOfNamesActive()) {
$gons = $this->findGroupOfNames(); $gons = $this->findGroupOfNames();
@ -1750,43 +1750,36 @@ class posixAccount extends baseModule implements passwordService {
foreach ($gons as $dn => $attr) { foreach ($gons as $dn => $attr) {
$gonList[$attr['cn'][0]] = $dn; $gonList[$attr['cn'][0]] = $dn;
} }
$gonSelect = new htmlTableExtendedSelect('posixAccount_gon', $gonList, array(), _('Groups of names'), 'addgroup', 10); $gonSelect = new htmlResponsiveSelect('posixAccount_gon', $gonList, array(), _('Groups of names'), 'addgroup', 10);
$gonSelect->setHasDescriptiveElements(true); $gonSelect->setHasDescriptiveElements(true);
$gonSelect->setMultiSelect(true); $gonSelect->setMultiSelect(true);
$gonSelect->setTransformSingleSelect(false); $gonSelect->setTransformSingleSelect(false);
$return->addElement($gonSelect, true); $return->add($gonSelect, 12);
} }
// home directory // home directory
$return->addElement(new htmlTableExtendedInputField(_('Home directory'), 'posixAccount_homeDirectory', '/home/$user', 'homeDirectory'), true); $return->add(new htmlResponsiveInputField(_('Home directory'), 'posixAccount_homeDirectory', '/home/$user', 'homeDirectory'), 12);
// login shell // login shell
$return->addElement(new htmlTableExtendedSelect('posixAccount_loginShell', $shelllist, array("/bin/bash"), _('Login shell'), 'loginShell'), true); $return->add(new htmlResponsiveSelect('posixAccount_loginShell', $shelllist, array("/bin/bash"), _('Login shell'), 'loginShell'), 12);
// lamdaemon settings // lamdaemon settings
if (($_SESSION['config']->get_scriptPath() != null)) { if (($_SESSION['config']->get_scriptPath() != null)) {
$homeDirLabel = new htmlOutputText(_('Create home directory')); $return->add(new htmlSubTitle(_('Create home directory')), 12);
$homeDirLabel->alignment = htmlElement::ALIGN_TOP;
$return->addElement($homeDirLabel);
$lamdaemonServers = explode(";", $_SESSION['config']->get_scriptServers()); $lamdaemonServers = explode(";", $_SESSION['config']->get_scriptServers());
for ($i = 0; $i < sizeof($lamdaemonServers); $i++) { for ($i = 0; $i < sizeof($lamdaemonServers); $i++) {
$temp = explode(":", $lamdaemonServers[$i]); $temp = explode(":", $lamdaemonServers[$i]);
if (isset($temp[1])) $lamdaemonServers[$i] = $temp[1]; if (isset($temp[1])) $lamdaemonServers[$i] = $temp[1];
else $lamdaemonServers[$i] = $temp[0]; else $lamdaemonServers[$i] = $temp[0];
} }
$homeServerContainer = new htmlTable();
for ($h = 0; $h < sizeof($lamdaemonServers); $h++) { for ($h = 0; $h < sizeof($lamdaemonServers); $h++) {
$homeServerContainer->addElement(new htmlTableExtendedInputCheckbox('posixAccount_createHomedir_' . $h, in_array($lamdaemonServers[$h], $this->lamdaemonServers), $lamdaemonServers[$h], null, false), true); $return->add(new htmlResponsiveInputCheckbox('posixAccount_createHomedir_' . $h, in_array($lamdaemonServers[$h], $this->lamdaemonServers), $lamdaemonServers[$h], 'createhomedir', false), 12);
} }
$return->addElement($homeServerContainer);
$homeDirHelp = new htmlHelpLink('createhomedir');
$homeDirHelp->alignment = htmlElement::ALIGN_TOP;
$return->addElement($homeDirHelp, true);
} }
} }
elseif ($this->get_scope() == 'host') { elseif ($this->get_scope() == 'host') {
// primary Unix group // primary Unix group
$return->addElement(new htmlTableExtendedSelect('posixAccount_primaryGroup', $groups, array(), _('Primary group'), 'gidNumber')); $return->add(new htmlResponsiveSelect('posixAccount_primaryGroup', $groups, array(), _('Primary group'), 'gidNumber'), 12);
} }
if ($this->isOptional($modules)) { if ($this->isOptional($modules)) {
$return->addElement(new htmlTableExtendedInputCheckbox('posixAccount_addExt', false, _('Automatically add this extension'), 'autoAdd'), true); $return->add(new htmlResponsiveInputCheckbox('posixAccount_addExt', false, _('Automatically add this extension'), 'autoAdd'), 12);
} }
return $return; return $return;
} }