diff --git a/lam/lib/modules/inetOrgPerson.inc b/lam/lib/modules/inetOrgPerson.inc index 9ba8ef8f..d0126338 100644 --- a/lam/lib/modules/inetOrgPerson.inc +++ b/lam/lib/modules/inetOrgPerson.inc @@ -2006,76 +2006,75 @@ class inetOrgPerson extends baseModule implements passwordService { $modules = $typeManager->getConfiguredType($typeId)->getModules(); $profileElements = array(); 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')) { - $profileElements[] = new htmlTableExtendedInputField(_('Initials'), 'inetOrgPerson_initials', null, 'initials'); + $profileElements[] = new htmlResponsiveInputField(_('Initials'), 'inetOrgPerson_initials', null, 'initials'); } 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')) { - $profileElements[] = new htmlTableExtendedInputField(_('Street'), 'inetOrgPerson_street', null, 'streetList'); + $profileElements[] = new htmlResponsiveInputField(_('Street'), 'inetOrgPerson_street', null, 'streetList'); } 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')) { - $profileElements[] = new htmlTableExtendedInputField(_('Postal code'), 'inetOrgPerson_postalCode', null, 'postalCodeList'); + $profileElements[] = new htmlResponsiveInputField(_('Postal code'), 'inetOrgPerson_postalCode', null, 'postalCodeList'); } 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')) { - $profileElements[] = new htmlTableExtendedInputField(_('State'), 'inetOrgPerson_st', null, 'stList'); + $profileElements[] = new htmlResponsiveInputField(_('State'), 'inetOrgPerson_st', null, 'stList'); } 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')) { - $profileElements[] = new htmlTableExtendedInputField(_('Registered address'), 'inetOrgPerson_registeredAddress', null, 'registeredAddress'); + $profileElements[] = new htmlResponsiveInputField(_('Registered address'), 'inetOrgPerson_registeredAddress', null, 'registeredAddress'); } 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')) { - $profileElements[] = new htmlTableExtendedInputField(_('Room number'), 'inetOrgPerson_roomNumber', null, 'roomNumber'); + $profileElements[] = new htmlResponsiveInputField(_('Room number'), 'inetOrgPerson_roomNumber', null, 'roomNumber'); } 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')) { - $profileElements[] = new htmlTableExtendedInputField(_('Fax number'), 'inetOrgPerson_facsimileTelephoneNumber', null, 'facsimileTelephoneNumberList'); + $profileElements[] = new htmlResponsiveInputField(_('Fax number'), 'inetOrgPerson_facsimileTelephoneNumber', null, 'facsimileTelephoneNumberList'); } 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')) { - $profileElements[] = new htmlTableExtendedInputField(_('Web site'), 'inetOrgPerson_labeledURI', null, 'labeledURIList'); + $profileElements[] = new htmlResponsiveInputField(_('Web site'), 'inetOrgPerson_labeledURI', null, 'labeledURIList'); } 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')) { - $profileElements[] = new htmlTableExtendedInputField(_('Organisational unit'), 'inetOrgPerson_ou', null, 'ouList'); + $profileElements[] = new htmlResponsiveInputField(_('Organisational unit'), 'inetOrgPerson_ou', null, 'ouList'); } 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')) { - $profileElements[] = new htmlTableExtendedInputField(_('Job title'), 'inetOrgPerson_title', null, 'title'); + $profileElements[] = new htmlResponsiveInputField(_('Job title'), 'inetOrgPerson_title', null, 'title'); } 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')) { - $profileElements[] = new htmlTableExtendedInputField(_('Business category'), 'inetOrgPerson_businessCategory', null, 'businessCategory'); + $profileElements[] = new htmlResponsiveInputField(_('Business category'), 'inetOrgPerson_businessCategory', null, 'businessCategory'); } if (sizeof($profileElements) > 0) { - $profileContainer = new htmlTable(); + $profileContainer = new htmlResponsiveRow(); for ($i = 0; $i < sizeof($profileElements); $i++) { - $profileContainer->addElement($profileElements[$i]); - $profileContainer->addNewLine(); + $profileContainer->add($profileElements[$i], 12); } return $profileContainer; } diff --git a/lam/lib/modules/nisNetGroupHost.inc b/lam/lib/modules/nisNetGroupHost.inc index 484a514b..acbdf62b 100644 --- a/lam/lib/modules/nisNetGroupHost.inc +++ b/lam/lib/modules/nisNetGroupHost.inc @@ -3,10 +3,9 @@ use \LAM\PDF\PDFTable; use \LAM\PDF\PDFTableCell; use \LAM\PDF\PDFTableRow; /* -$Id$ 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 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) { $groupOptions[$group['cn'][0]] = $group['cn'][0] . '#+#' . $group['dn']; } - $return = new htmlTable(); - $return->addElement(new htmlOutputText(_('Group'))); - $return->addElement(new htmlOutputText(_('User name'))); - $return->addElement(new htmlOutputText(_('Domain name')), true); + $return = new htmlResponsiveRow(); + $labels = array(_('Group'), _('User name'), _('Domain name')); + $data = array(); for ($i = 0; $i < 5; $i++) { $select = new htmlSelect('nisNetGroupUser_group' . $i, $groupOptions, array('')); $select->setHasDescriptiveElements(true); - $return->addElement($select); - $return->addElement(new htmlInputField('nisNetGroupUser_user' . $i)); - $return->addElement(new htmlInputField('nisNetGroupUser_domain' . $i), true); + $data[$i][] = $select; + $data[$i][] = new htmlInputField('nisNetGroupUser_user' . $i); + $data[$i][] = new htmlInputField('nisNetGroupUser_domain' . $i); } + $return->add(new htmlResponsiveTable($labels, $data), 12); return $return; } diff --git a/lam/lib/modules/nisNetGroupUser.inc b/lam/lib/modules/nisNetGroupUser.inc index b4a42a7a..394e2e83 100644 --- a/lam/lib/modules/nisNetGroupUser.inc +++ b/lam/lib/modules/nisNetGroupUser.inc @@ -4,10 +4,9 @@ use \LAM\PDF\PDFTableCell; use \LAM\PDF\PDFTableRow; use \LAM\TYPES\TypeManager; /* -$Id$ 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 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) { $groupOptions[$group['cn'][0]] = $group['cn'][0] . '#+#' . $group['dn']; } - $return = new htmlTable(); - $return->addElement(new htmlOutputText(_('Group'))); - $return->addElement(new htmlOutputText(_('Host name'))); - $return->addElement(new htmlOutputText(_('Domain name')), true); + $return = new htmlResponsiveRow(); + $labels = array(_('Group'), _('Host name'), _('Domain name')); + $data = array(); for ($i = 0; $i < 5; $i++) { $select = new htmlSelect('nisNetGroupUser_group' . $i, $groupOptions, array('')); $select->setHasDescriptiveElements(true); - $return->addElement($select); - $return->addElement(new htmlInputField('nisNetGroupUser_host' . $i)); - $return->addElement(new htmlInputField('nisNetGroupUser_domain' . $i), true); + $data[$i][] = $select; + $data[$i][] = new htmlInputField('nisNetGroupUser_host' . $i); + $data[$i][] = new htmlInputField('nisNetGroupUser_domain' . $i); } + $return->add(new htmlResponsiveTable($labels, $data), 12); return $return; } diff --git a/lam/lib/modules/posixAccount.inc b/lam/lib/modules/posixAccount.inc index e7fe3447..e782ec46 100644 --- a/lam/lib/modules/posixAccount.inc +++ b/lam/lib/modules/posixAccount.inc @@ -1726,7 +1726,7 @@ class posixAccount extends baseModule implements passwordService { * {@inheritDoc} */ function get_profileOptions($typeId) { - $return = new htmlTable(); + $return = new htmlResponsiveRow(); $typeManager = new TypeManager(); $modules = $typeManager->getConfiguredType($typeId)->getModules(); $groupList = $this->findGroups($modules); @@ -1737,12 +1737,12 @@ class posixAccount extends baseModule implements passwordService { if ($this->get_scope() == 'user') { $shelllist = $this->getShells(); // list of all valid shells // 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 - $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->setTransformSingleSelect(false); - $return->addElement($addGroupSelect, true); + $return->add($addGroupSelect, 12); // group of names if (self::areGroupOfNamesActive()) { $gons = $this->findGroupOfNames(); @@ -1750,43 +1750,36 @@ class posixAccount extends baseModule implements passwordService { foreach ($gons as $dn => $attr) { $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->setMultiSelect(true); $gonSelect->setTransformSingleSelect(false); - $return->addElement($gonSelect, true); + $return->add($gonSelect, 12); } // 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 - $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 if (($_SESSION['config']->get_scriptPath() != null)) { - $homeDirLabel = new htmlOutputText(_('Create home directory')); - $homeDirLabel->alignment = htmlElement::ALIGN_TOP; - $return->addElement($homeDirLabel); + $return->add(new htmlSubTitle(_('Create home directory')), 12); $lamdaemonServers = explode(";", $_SESSION['config']->get_scriptServers()); for ($i = 0; $i < sizeof($lamdaemonServers); $i++) { $temp = explode(":", $lamdaemonServers[$i]); if (isset($temp[1])) $lamdaemonServers[$i] = $temp[1]; else $lamdaemonServers[$i] = $temp[0]; } - $homeServerContainer = new htmlTable(); 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') { // 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)) { - $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; }