responsive
This commit is contained in:
parent
3b8addba5e
commit
fa9f2490ec
|
@ -4,10 +4,9 @@ use \LAM\PDF\PDFTable;
|
||||||
use LAM\TYPES\ConfiguredType;
|
use LAM\TYPES\ConfiguredType;
|
||||||
use function LAM\TYPES\getScopeFromTypeId;
|
use function LAM\TYPES\getScopeFromTypeId;
|
||||||
/*
|
/*
|
||||||
$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) 2003 - 2017 Roland Gruber
|
Copyright (C) 2003 - 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
|
||||||
|
@ -171,6 +170,7 @@ abstract class baseModule {
|
||||||
// load attributes
|
// load attributes
|
||||||
$attributeNames = array_merge($this->getManagedAttributes($typeId), $this->getManagedHiddenAttributes($typeId));
|
$attributeNames = array_merge($this->getManagedAttributes($typeId), $this->getManagedHiddenAttributes($typeId));
|
||||||
$attributeNames = array_unique($attributeNames);
|
$attributeNames = array_unique($attributeNames);
|
||||||
|
$attributeNames = array_values($attributeNames);
|
||||||
for ($i = 0; $i < sizeof($attributeNames); $i++) {
|
for ($i = 0; $i < sizeof($attributeNames); $i++) {
|
||||||
if (isset($attributes[$attributeNames[$i]])) {
|
if (isset($attributes[$attributeNames[$i]])) {
|
||||||
$this->attributes[$attributeNames[$i]] = $attributes[$attributeNames[$i]];
|
$this->attributes[$attributeNames[$i]] = $attributes[$attributeNames[$i]];
|
||||||
|
|
|
@ -556,10 +556,14 @@ function validateSecurityToken($post = true) {
|
||||||
* Adds a hidden input field to the given meta HTML table.
|
* Adds a hidden input field to the given meta HTML table.
|
||||||
* Should be used to add token at the end of table.
|
* Should be used to add token at the end of table.
|
||||||
*
|
*
|
||||||
* @param htmlTable|htmlGroup $container table
|
* @param htmlTable|htmlGroup|htmlResponsiveRow $container table
|
||||||
*/
|
*/
|
||||||
function addSecurityTokenToMetaHTML(&$container) {
|
function addSecurityTokenToMetaHTML(&$container) {
|
||||||
$token = new htmlHiddenInput(getSecurityTokenName(), $_SESSION[getSecurityTokenName()]);
|
$token = new htmlHiddenInput(getSecurityTokenName(), $_SESSION[getSecurityTokenName()]);
|
||||||
|
if ($container instanceof htmlResponsiveRow) {
|
||||||
|
$container->add($token, 12);
|
||||||
|
return;
|
||||||
|
}
|
||||||
$container->addElement($token, true);
|
$container->addElement($token, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
<?php
|
<?php
|
||||||
namespace LAM\TOOLS\OU_EDIT;
|
namespace LAM\TOOLS\OU_EDIT;
|
||||||
use \htmlTable;
|
|
||||||
use \htmlSpacer;
|
use \htmlSpacer;
|
||||||
use \htmlOutputText;
|
use \htmlOutputText;
|
||||||
use \htmlButton;
|
use \htmlButton;
|
||||||
use \htmlHiddenInput;
|
use \htmlHiddenInput;
|
||||||
|
use \htmlTitle;
|
||||||
use \htmlSubTitle;
|
use \htmlSubTitle;
|
||||||
use \htmlStatusMessage;
|
use \htmlStatusMessage;
|
||||||
use \htmlSelect;
|
use \htmlResponsiveRow;
|
||||||
use \htmlHelpLink;
|
use \htmlResponsiveSelect;
|
||||||
use \htmlInputField;
|
use \htmlResponsiveInputField;
|
||||||
|
use \htmlGroup;
|
||||||
/*
|
/*
|
||||||
$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) 2003 - 2017 Roland Gruber
|
Copyright (C) 2003 - 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
|
||||||
|
@ -122,19 +122,22 @@ if (isset($_POST['createOU']) || isset($_POST['deleteOU'])) {
|
||||||
echo '<div class="user-bright smallPaddingContent">';
|
echo '<div class="user-bright smallPaddingContent">';
|
||||||
echo "<form action=\"ou_edit.php\" method=\"post\">\n";
|
echo "<form action=\"ou_edit.php\" method=\"post\">\n";
|
||||||
$tabindex = 1;
|
$tabindex = 1;
|
||||||
$container = new htmlTable();
|
$container = new htmlResponsiveRow();
|
||||||
$label = new htmlOutputText(_("Do you really want to delete this OU?"));
|
$label = new htmlOutputText(_("Do you really want to delete this OU?"));
|
||||||
$label->colspan = 5;
|
$label->colspan = 5;
|
||||||
$container->addElement($label, true);
|
$container->add($label, 12);
|
||||||
$container->addElement(new htmlSpacer(null, '10px'), true);
|
$container->addVerticalSpacer('1rem');
|
||||||
$dnLabel = new htmlOutputText(getAbstractDN($_POST['deleteableOU']));
|
$dnLabel = new htmlOutputText(getAbstractDN($_POST['deleteableOU']));
|
||||||
$dnLabel->colspan = 5;
|
$dnLabel->colspan = 5;
|
||||||
$container->addElement($dnLabel, true);
|
$container->add($dnLabel, 12);
|
||||||
$container->addElement(new htmlSpacer(null, '10px'), true);
|
$container->addVerticalSpacer('1rem');
|
||||||
$container->addElement(new htmlButton('sure', _("Delete")));
|
$buttonGroup = new htmlGroup();
|
||||||
$container->addElement(new htmlButton('abort', _("Cancel")));
|
$buttonGroup->addElement(new htmlButton('sure', _("Delete")));
|
||||||
$container->addElement(new htmlHiddenInput('deleteOU', 'submit'));
|
$buttonGroup->addElement(new htmlSpacer('0.5rem', null));
|
||||||
$container->addElement(new htmlHiddenInput('deletename', $_POST['deleteableOU']));
|
$buttonGroup->addElement(new htmlButton('abort', _("Cancel")));
|
||||||
|
$container->add($buttonGroup, 12);
|
||||||
|
$container->add(new htmlHiddenInput('deleteOU', 'submit'), 12);
|
||||||
|
$container->add(new htmlHiddenInput('deletename', $_POST['deleteableOU']), 12);
|
||||||
addSecurityTokenToMetaHTML($container);
|
addSecurityTokenToMetaHTML($container);
|
||||||
parseHtml(null, $container, array(), false, $tabindex, 'user');
|
parseHtml(null, $container, array(), false, $tabindex, 'user');
|
||||||
echo "</form>";
|
echo "</form>";
|
||||||
|
@ -158,22 +161,22 @@ display_main($message, $error);
|
||||||
*/
|
*/
|
||||||
function display_main($message, $error) {
|
function display_main($message, $error) {
|
||||||
// display main page
|
// display main page
|
||||||
include 'main_header.php';
|
include '../lib/adminHeader.inc';
|
||||||
echo '<div class="user-bright smallPaddingContent">';
|
echo '<div class="user-bright smallPaddingContent">';
|
||||||
echo "<form action=\"ou_edit.php\" method=\"post\">\n";
|
echo "<form action=\"ou_edit.php\" method=\"post\">\n";
|
||||||
|
|
||||||
$tabindex = 1;
|
$tabindex = 1;
|
||||||
$container = new htmlTable();
|
$container = new htmlResponsiveRow();
|
||||||
$container->addElement(new htmlSubTitle(_("OU editor")), true);
|
$container->add(new htmlTitle(_("OU editor")), 12);
|
||||||
if (isset($error)) {
|
if (isset($error)) {
|
||||||
$msg = new htmlStatusMessage("ERROR", "", $error);
|
$msg = new htmlStatusMessage("ERROR", "", $error);
|
||||||
$msg->colspan = 5;
|
$msg->colspan = 5;
|
||||||
$container->addElement($msg, true);
|
$container->add($msg, 12);
|
||||||
}
|
}
|
||||||
elseif (isset($message)) {
|
elseif (isset($message)) {
|
||||||
$msg = new htmlStatusMessage("INFO", "", $message);
|
$msg = new htmlStatusMessage("INFO", "", $message);
|
||||||
$msg->colspan = 5;
|
$msg->colspan = 5;
|
||||||
$container->addElement($msg, true);
|
$container->add($msg, 12);
|
||||||
}
|
}
|
||||||
|
|
||||||
$typeManager = new \LAM\TYPES\TypeManager();
|
$typeManager = new \LAM\TYPES\TypeManager();
|
||||||
|
@ -199,35 +202,33 @@ function display_main($message, $error) {
|
||||||
|
|
||||||
if (!empty($options)) {
|
if (!empty($options)) {
|
||||||
// new OU
|
// new OU
|
||||||
$container->addElement(new htmlOutputText(_("New organisational unit")));
|
$container->add(new htmlSubTitle(_("New organisational unit")), 12);
|
||||||
$parentOUSelect = new htmlSelect('parentOU', $options, array());
|
$parentOUSelect = new htmlResponsiveSelect('parentOU', $options, array(), _('Parent DN'), '601');
|
||||||
$parentOUSelect->setContainsOptgroups(true);
|
$parentOUSelect->setContainsOptgroups(true);
|
||||||
$parentOUSelect->setHasDescriptiveElements(true);
|
$parentOUSelect->setHasDescriptiveElements(true);
|
||||||
$parentOUSelect->setRightToLeftTextDirection(true);
|
$parentOUSelect->setRightToLeftTextDirection(true);
|
||||||
$parentOUSelect->setSortElements(false);
|
$parentOUSelect->setSortElements(false);
|
||||||
$container->addElement($parentOUSelect);
|
$container->add($parentOUSelect, 12);
|
||||||
$container->addElement(new htmlInputField('newOU'));
|
$container->add(new htmlResponsiveInputField(_('Name'), 'newOU'), 12);
|
||||||
$container->addElement(new htmlButton('createOU', _("Ok")));
|
$container->addLabel(new htmlOutputText(' ', false));
|
||||||
$container->addElement(new htmlHelpLink('601'), true);
|
$container->addField(new htmlButton('createOU', _("Ok")));
|
||||||
|
$container->addVerticalSpacer('2rem');
|
||||||
$container->addElement(new htmlSpacer(null, '10px'), true);
|
|
||||||
|
|
||||||
// delete OU
|
// delete OU
|
||||||
$container->addElement(new htmlOutputText(_("Delete organisational unit")));
|
$container->add(new htmlSubTitle(_("Delete organisational unit")), 12);
|
||||||
$deleteableOUSelect = new htmlSelect('deleteableOU', $options, array());
|
$deleteableOUSelect = new htmlResponsiveSelect('deleteableOU', $options, array(), _('Organisational unit'), '602');
|
||||||
$deleteableOUSelect->setContainsOptgroups(true);
|
$deleteableOUSelect->setContainsOptgroups(true);
|
||||||
$deleteableOUSelect->setHasDescriptiveElements(true);
|
$deleteableOUSelect->setHasDescriptiveElements(true);
|
||||||
$deleteableOUSelect->setRightToLeftTextDirection(true);
|
$deleteableOUSelect->setRightToLeftTextDirection(true);
|
||||||
$deleteableOUSelect->setSortElements(false);
|
$deleteableOUSelect->setSortElements(false);
|
||||||
$container->addElement($deleteableOUSelect);
|
$container->add($deleteableOUSelect, 12);
|
||||||
$container->addElement(new htmlOutputText(''));
|
$container->addLabel(new htmlOutputText(' ', false));
|
||||||
$container->addElement(new htmlButton('deleteOU', _("Ok")));
|
$container->addField(new htmlButton('deleteOU', _("Ok")));
|
||||||
$container->addElement(new htmlHelpLink('602'), true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
addSecurityTokenToMetaHTML($container);
|
addSecurityTokenToMetaHTML($container);
|
||||||
parseHtml(null, $container, array(), false, $tabindex, 'user');
|
parseHtml(null, $container, array(), false, $tabindex, 'user');
|
||||||
echo ("</form>\n");
|
echo ("</form>\n");
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
include 'main_footer.php';
|
include '../lib/adminFooter.inc';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue