responsive tools

This commit is contained in:
Roland Gruber 2018-05-17 19:56:58 +02:00
parent cd8dab077e
commit d5c1e06bac
1 changed files with 25 additions and 24 deletions

View File

@ -1,13 +1,12 @@
<?php <?php
namespace LAM\TOOLS\PROFILE_EDITOR; namespace LAM\TOOLS\PROFILE_EDITOR;
use \htmlTable; use \htmlResponsiveRow;
use \htmlTitle; use \htmlTitle;
use \htmlTableExtendedInputField; use \htmlResponsiveInputField;
use \htmlSpacer; use \htmlResponsiveSelect;
use \htmlTableExtendedSelect;
use \htmlFieldset;
use \htmlButton; use \htmlButton;
use \htmlHiddenInput; use \htmlHiddenInput;
use \htmlSubTitle;
/* /*
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/)
@ -140,6 +139,7 @@ if (isset($_POST['save'])) {
// print header // print header
include '../../lib/adminHeader.inc'; include '../../lib/adminHeader.inc';
echo '<div class="user-bright smallPaddingContent">';
// print error messages if any // print error messages if any
if (sizeof($errors) > 0) { if (sizeof($errors) > 0) {
@ -182,13 +182,13 @@ if (isset($_GET['edit'])) {
$tabindex = 1; $tabindex = 1;
$container = new htmlTable(); $container = new htmlResponsiveRow();
$container->addElement(new htmlTitle(_("Profile editor")), true); $container->add(new htmlTitle(_("Profile editor")), 12);
// general options // general options
$dnContent = new htmlTable(); $container->add(new htmlSubTitle(_("General settings"), '../../graphics/logo32.png', null, true), 12);
$dnContent->addElement(new htmlTableExtendedInputField(_("Profile name") . '*', 'profname', $profName, '360'), true); $container->add(new htmlResponsiveInputField(_("Profile name") . '*', 'profname', $profName, '360'), 12);
$dnContent->addElement(new htmlSpacer(null, '10px'), true); $container->addVerticalSpacer('1rem');
// suffix box // suffix box
// get root suffix // get root suffix
$rootsuffix = $type->getSuffix(); $rootsuffix = $type->getSuffix();
@ -202,21 +202,20 @@ $selectedSuffix = array();
if (isset($old_options['ldap_suffix'][0])) { if (isset($old_options['ldap_suffix'][0])) {
$selectedSuffix[] = $old_options['ldap_suffix'][0]; $selectedSuffix[] = $old_options['ldap_suffix'][0];
} }
$suffixSelect = new htmlTableExtendedSelect('ldap_suffix', $suffixes, $selectedSuffix, _("LDAP suffix"), '361'); $suffixSelect = new htmlResponsiveSelect('ldap_suffix', $suffixes, $selectedSuffix, _("LDAP suffix"), '361');
$suffixSelect->setHasDescriptiveElements(true); $suffixSelect->setHasDescriptiveElements(true);
$suffixSelect->setSortElements(false); $suffixSelect->setSortElements(false);
$suffixSelect->setRightToLeftTextDirection(true); $suffixSelect->setRightToLeftTextDirection(true);
$dnContent->addElement($suffixSelect, true); $container->add($suffixSelect, 12);
// RDNs // RDNs
$rdns = getRDNAttributes($type->getId()); $rdns = getRDNAttributes($type->getId());
$selectedRDN = array(); $selectedRDN = array();
if (isset($old_options['ldap_rdn'][0])) { if (isset($old_options['ldap_rdn'][0])) {
$selectedRDN[] = $old_options['ldap_rdn'][0]; $selectedRDN[] = $old_options['ldap_rdn'][0];
} }
$dnContent->addElement(new htmlTableExtendedSelect('ldap_rdn', $rdns, $selectedRDN, _("RDN identifier"), '301'), true); $container->add(new htmlResponsiveSelect('ldap_rdn', $rdns, $selectedRDN, _("RDN identifier"), '301'), 12);
$container->addElement(new htmlFieldset($dnContent, _("General settings"), '../../graphics/logo32.png'), true); $container->addVerticalSpacer('2rem');
$container->addElement(new htmlSpacer(null, '15px'), true);
$_SESSION['profile_types'] = parseHtml(null, $container, $old_options, false, $tabindex, $type->getScope()); $_SESSION['profile_types'] = parseHtml(null, $container, $old_options, false, $tabindex, $type->getScope());
@ -231,21 +230,22 @@ foreach ($options as $moduleName => $moduleOptions) {
if (!empty($icon) && !(strpos($icon, 'http') === 0) && !(strpos($icon, '/') === 0)) { if (!empty($icon) && !(strpos($icon, 'http') === 0) && !(strpos($icon, '/') === 0)) {
$icon = '../../graphics/' . $icon; $icon = '../../graphics/' . $icon;
} }
$container = new htmlTable(); $modContainer = new htmlResponsiveRow();
$container->addElement(new htmlFieldset($moduleOptions, getModuleAlias($moduleName, $type->getScope()), $icon), true); $modContainer->add(new htmlSubTitle(getModuleAlias($moduleName, $type->getScope()), $icon, null, true), 12);
$container->addElement(new htmlSpacer(null, '15px'), true); $modContainer->add($moduleOptions, 12);
$_SESSION['profile_types'] = array_merge($_SESSION['profile_types'], parseHtml($moduleName, $container, $old_options, false, $tabindex, $type->getScope())); $modContainer->addVerticalSpacer('2rem');
$_SESSION['profile_types'] = array_merge($_SESSION['profile_types'], parseHtml($moduleName, $modContainer, $old_options, false, $tabindex, $type->getScope()));
} }
// profile name and submit/abort buttons // profile name and submit/abort buttons
$buttonTable = new htmlTable(); $buttonTable = new htmlResponsiveRow();
$saveButton = new htmlButton('save', _('Save')); $saveButton = new htmlButton('save', _('Save'));
$saveButton->setIconClass('saveButton'); $saveButton->setIconClass('saveButton');
$buttonTable->addElement($saveButton); $buttonTable->addLabel($saveButton);
$cancelButton = new htmlButton('abort', _('Cancel')); $cancelButton = new htmlButton('abort', _('Cancel'));
$cancelButton->setIconClass('cancelButton'); $cancelButton->setIconClass('cancelButton');
$buttonTable->addElement($cancelButton); $buttonTable->addField($cancelButton);
$buttonTable->addElement(new htmlHiddenInput('accounttype', $type->getId())); $buttonTable->add(new htmlHiddenInput('accounttype', $type->getId()), 0);
$_SESSION['profile_types'] = array_merge($_SESSION['profile_types'], parseHtml(null, $buttonTable, $old_options, false, $tabindex, $type->getScope())); $_SESSION['profile_types'] = array_merge($_SESSION['profile_types'], parseHtml(null, $buttonTable, $old_options, false, $tabindex, $type->getScope()));
@ -263,8 +263,9 @@ $_SESSION['profile_types'] = array_merge($_SESSION['profile_types'], parseHtml(n
}); });
}); });
</script> </script>
</form>
</div>
<?php <?php
echo ("</form>\n");
include '../../lib/adminFooter.inc'; include '../../lib/adminFooter.inc';
?> ?>