use new meta HTML classes and new buttons

This commit is contained in:
Roland Gruber 2010-10-12 17:49:18 +00:00
parent bb333e477b
commit 70f3f03073
4 changed files with 122 additions and 90 deletions

View File

@ -147,6 +147,10 @@ tr.highlight {
padding: 0.1em 0.4em !important;
}
.smallPaddingContent {
padding: 0.5em;
}
/** subtitles */
div.subTitle {
margin: 20px 0px 15px 0px;

View File

@ -77,11 +77,9 @@ if (isset($_GET['type']) && isset($_SESSION['delete_dn'])) {
$_SESSION['account'] = new accountContainer($_GET['type'], 'account');
// Show HTML Page
include 'main_header.php';
echo "<div class=\"".$_GET['type']."list-bright smallPaddingContent\">";
echo "<br>\n";
echo "<form action=\"delete.php\" method=\"post\">\n";
echo "<fieldset class=\"".$_GET['type']."edit\"><legend><b>";
echo _('Please confirm:');
echo "</b></legend><br>\n";
echo "<input name=\"type\" type=\"hidden\" value=\"" . $_GET['type'] . "\">\n";
echo "<b>" . _("Do you really want to remove the following accounts?") . "</b>";
echo "<br><br>\n";
@ -109,10 +107,18 @@ if (isset($_GET['type']) && isset($_SESSION['delete_dn'])) {
}
echo "</table>\n";
echo "<br>\n";
echo "<input name=\"delete\" type=\"submit\" value=\"" . _('Delete') . "\">&nbsp;\n";
echo "<input name=\"cancel\" type=\"submit\" value=\"" . _('Cancel') . "\">\n";
echo "</fieldset>\n";
echo "<button class=\"smallPadding\" name=\"delete\" id=\"submitButton\">" . _('Delete') . "</button>&nbsp;\n";
echo "<button class=\"smallPadding\" name=\"cancel\" id=\"cancelButton\">" . _('Cancel') . "</button>\n";
echo "</form>\n";
echo "</div>\n";
?>
<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {
jQuery('#submitButton').button();
jQuery('#cancelButton').button();
});
</script>
<?php
include 'main_footer.php';
}
@ -124,12 +130,10 @@ if (isset($_POST['cancel'])) {
if (isset($_POST['delete'])) {
// Show HTML Page
include 'main_header.php';
echo "<br>\n";
echo "<form action=\"delete.php\" method=\"post\">\n";
echo "<input name=\"type\" type=\"hidden\" value=\"" . $_POST['type'] . "\">\n";
echo "<fieldset class=\"".$_POST['type']."edit\"><legend><b>";
echo _('Deleting. Please stand by ...');
echo "</b></legend><br>\n";
echo "<div class=\"".$_POST['type']."list-bright smallPaddingContent\"><br>\n";
echo "<br>\n";
// Delete dns
for ($m=0; $m<count($_SESSION['delete_dn']); $m++) {
@ -221,6 +225,7 @@ if (isset($_POST['delete'])) {
echo sprintf(_('Deleted DN: %s'), $_SESSION['delete_dn'][$m]) . "<br>\n";
foreach ($errors as $error) StatusMessage($error[0], $error[1], $error[2]);
echo "<br>\n";
flush();
}
else {
echo sprintf(_('Error while deleting DN: %s'), $_SESSION['delete_dn'][$m]) . "<br>\n";
@ -230,9 +235,16 @@ if (isset($_POST['delete'])) {
}
$_SESSION['cache']->refresh_cache(true);
echo "<br>\n";
echo "<br><input name=\"cancel\" type=\"submit\" value=\"" . _('Back to list') . "\">\n";
echo "</fieldset>\n";
echo "<br><button class=\"smallPadding\" name=\"cancel\" id=\"backButton\">" . _('Back to list') . "</button>\n";
echo "</div>\n";
echo "</form>\n";
?>
<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {
jQuery('#backButton').button();
});
</script>
<?php
include 'main_footer.php';
}
@ -268,6 +280,7 @@ function deleteDN($dn) {
}
else {
$errors[] = array ('ERROR', sprintf(_('Was unable to delete DN: %s.'), $dn), ldap_error($_SESSION['ldap']->server()));
return $errors;
}
// delete parent DN
$success = @ldap_delete($_SESSION['ldap']->server(), $dn);

View File

@ -49,7 +49,7 @@ $types = $_SESSION['config']->get_ActiveTypes();
// check if deletion was canceled
if (isset($_POST['abort'])) {
display_main();
display_main(null, null);
exit;
}
@ -102,16 +102,25 @@ if (isset($_POST['createOU']) || isset($_POST['deleteOU'])) {
if ($sr && $info['count'] == 0) {
// print header
include 'main_header.php';
echo "<br>\n" .
"<p><big><b>" . _("Do you really want to delete this OU?") . " </b></big>" . "\n" .
"<br>\n<p>" . getAbstractDN($_POST['deleteableOU']) . "</p>\n" .
"<br>\n" .
"<form action=\"ou_edit.php\" method=\"post\">\n" .
"<input type=\"hidden\" name=\"deleteOU\" value=\"submit\">\n" .
"<input type=\"hidden\" name=\"deletename\" value=\"" . $_POST['deleteableOU'] . "\">\n" .
"<input type=\"submit\" name=\"sure\" value=\"" . _("Delete") . "\">\n" .
"<input type=\"submit\" name=\"abort\" value=\"" . _("Cancel") . "\">\n" .
"</form>";
echo '<div class="userlist-bright smallPaddingContent">';
echo "<form action=\"ou_edit.php\" method=\"post\">\n";
$tabindex = 1;
$container = new htmlTable();
$label = new htmlOutputText(_("Do you really want to delete this OU?"));
$label->colspan = 5;
$container->addElement($label, true);
$container->addElement(new htmlSpacer(null, '10px'), true);
$dnLabel = new htmlOutputText(getAbstractDN($_POST['deleteableOU']));
$dnLabel->colspan = 5;
$container->addElement($dnLabel, true);
$container->addElement(new htmlSpacer(null, '10px'), true);
$container->addElement(new htmlButton('sure', _("Delete")));
$container->addElement(new htmlButton('abort', _("Cancel")));
$container->addElement(new htmlHiddenInput('deleteOU', 'submit'));
$container->addElement(new htmlHiddenInput('deletename', $_POST['deleteableOU']));
parseHtml(null, $container, array(), false, $tabindex, 'user');
echo "</form>";
echo '</div>';
include 'main_footer.php';
exit();
}
@ -132,15 +141,22 @@ display_main($message, $error);
function display_main($message, $error) {
// display main page
include 'main_header.php';
echo "<h1>" . _("OU editor") . "</h1>";
echo '<div class="userlist-bright smallPaddingContent">';
echo ("<form action=\"ou_edit.php\" method=\"post\">\n");
$tabindex = 1;
$container = new htmlTable();
$container->addElement(new htmlSubTitle(_("OU editor")), true);
if (isset($error)) {
StatusMessage("ERROR", "", $error);
$msg = new htmlStatusMessage("ERROR", "", $error);
$msg->colspan = 5;
$container->addElement($msg, true);
}
elseif (isset($message)) {
StatusMessage("INFO", "", $message);
$msg = new htmlStatusMessage("INFO", "", $message);
$msg->colspan = 5;
$container->addElement($msg, true);
}
echo ("<br>\n");
echo ("<form action=\"ou_edit.php\" method=\"post\">\n");
$types = array();
$typeList = $_SESSION['config']->get_ActiveTypes();
@ -148,53 +164,43 @@ function display_main($message, $error) {
$types[$typeList[$i]] = getTypeAlias($typeList[$i]);
}
natcasesort($types);
$options = "";
$options = array();
foreach ($types as $name => $title) {
$options .= "<optgroup label=\"" . $title . "\">\n";
$elements = array();
$units = $_SESSION['ldap']->search_units($_SESSION["config"]->get_Suffix($name));
for ($u = 0; $u < sizeof($units); $u++) {
$options .= "<option value=\"" . $units[$u] . "\">" . getAbstractDN($units[$u]) . "</option>\n";
$elements[getAbstractDN($units[$u])] = $units[$u];
}
$options .= "</optgroup>\n";
$options[$title] = $elements;
}
echo ("<fieldset class=\"useredit\"><legend><b>" . _("OU editor") . "</b></legend><br>\n");
echo ("<table border=0>\n");
// new OU
echo ("<tr>\n");
echo ("<td><b>" . _("New organizational unit") . "</b></td>\n");
echo ("<td>&nbsp;</td>\n");
echo ("<td><select class=\"rightToLeftText\" size=1 name=\"parentOU\">");
echo $options;
echo ("</select><td>\n");
echo ("<td><input type=text name=\"newOU\"></td>\n");
echo "<td>";
echo "<input type=\"submit\" name=\"createOU\" value=\"" . _("Ok") . "\">&nbsp;";
echo "</td>";
echo "<td>";
printHelpLink(getHelp('', '601'), '601');
echo "</td>\n";
echo ("</tr>\n");
echo "<tr><td colspan=5>&nbsp;</td></tr>\n";
// delete OU
echo ("<tr>\n");
echo ("<td><b>" . _("Delete organizational unit") . "</b></td>\n");
echo ("<td>&nbsp;</td>\n");
echo ("<td><select class=\"rightToLeftText\" size=1 name=\"deleteableOU\">");
echo $options;
echo ("</select><td>\n");
echo ("<td>&nbsp;</td>\n");
echo "<td>";
echo "<input type=\"submit\" name=\"deleteOU\" value=\"" . _("Ok") . "\">&nbsp;";
echo "</td>";
echo "<td>";
printHelpLink(getHelp('', '602'), '602');
echo "</td>\n";
echo ("</tr>\n");
echo ("</table>\n");
echo ("</fieldset>\n");
echo ("<br>\n");
$container->addElement(new htmlOutputText(_("New organizational unit")));
$parentOUSelect = new htmlSelect('parentOU', $options, array());
$parentOUSelect->setContainsOptgroups(true);
$parentOUSelect->setHasDescriptiveElements(true);
$parentOUSelect->setRightToLeftTextDirection(true);
$parentOUSelect->setSortElements(false);
$container->addElement($parentOUSelect);
$container->addElement(new htmlInputField('newOU'));
$container->addElement(new htmlButton('createOU', _("Ok")));
$container->addElement(new htmlHelpLink('601'), true);
$container->addElement(new htmlSpacer(null, '10px'), true);
// delete OU
$container->addElement(new htmlOutputText(_("Delete organizational unit")));
$deleteableOUSelect = new htmlSelect('deleteableOU', $options, array());
$deleteableOUSelect->setContainsOptgroups(true);
$deleteableOUSelect->setHasDescriptiveElements(true);
$deleteableOUSelect->setRightToLeftTextDirection(true);
$deleteableOUSelect->setSortElements(false);
$container->addElement($deleteableOUSelect);
$container->addElement(new htmlOutputText(''));
$container->addElement(new htmlButton('deleteOU', _("Ok")));
$container->addElement(new htmlHelpLink('602'), true);
parseHtml(null, $container, array(), false, $tabindex, 'user');
echo ("</form>\n");
echo '</div>';
include 'main_footer.php';
}

View File

@ -85,46 +85,55 @@ if ($result) {
}
include 'main_header.php';
echo '<div class="userlist-bright smallPaddingContent">';
$tabindex = 1;
$container = new htmlTable();
echo "<h1>" . _("Server information") . "</h1>\n";
$container->addElement(new htmlSubTitle(_("Server information")), true);
echo "<table class=\"userlist\" rules=\"none\">\n";
$container->addElement(new htmlOutputText('<b>' . _("Managed suffixes") . '</b>', false));
$container->addElement(new htmlSpacer('20px', null));
$container->addElement(new htmlOutputText($namingContexts), true);
echo "<tr class=\"userlist-bright\"><td style=\"padding:10px;\"><b>" . _("Managed suffixes") . "</b>&nbsp;&nbsp;</td>";
echo "<td style=\"padding:10px;\">" . $namingContexts . "</td></tr>";
echo "<tr class=\"userlist-bright\"><td style=\"padding:10px;\"><b>" . _("LDAP version") . "</b>&nbsp;&nbsp;</td>";
echo "<td style=\"padding:10px;\">" . $supportedldapversion . "</td></tr>";
$container->addElement(new htmlOutputText('<b>' . _("LDAP version") . '</b>', false));
$container->addElement(new htmlSpacer('20px', null));
$container->addElement(new htmlOutputText($supportedldapversion), true);
if ($configcontext != '') {
echo "<tr class=\"userlist-bright\"><td style=\"padding:10px;\"><b>" . _("Config suffix") . "</b>&nbsp;&nbsp;</td>";
echo "<td style=\"padding:10px;\">" . $configcontext . "</td></tr>";
$container->addElement(new htmlOutputText('<b>' . _("Config suffix") . '</b>', false));
$container->addElement(new htmlSpacer('20px', null));
$container->addElement(new htmlOutputText($configcontext), true);
}
echo "<tr class=\"userlist-bright\"><td style=\"padding:10px;\"><b>" . _("Schema suffix") . "</b>&nbsp;&nbsp;</td>";
echo "<td style=\"padding:10px;\">" . $subschemasubentry . "</td></tr>";
$container->addElement(new htmlOutputText('<b>' . _("Schema suffix") . '</b>', false));
$container->addElement(new htmlSpacer('20px', null));
$container->addElement(new htmlOutputText($subschemasubentry), true);
if ($dynamicSubtrees != '') {
echo "<tr class=\"userlist-bright\"><td style=\"padding:10px;\"><b>" . _("Dynamic subtrees") . "</b>&nbsp;&nbsp;</td>";
echo "<td style=\"padding:10px;\">" . $dynamicSubtrees . "</td></tr>";
$container->addElement(new htmlOutputText('<b>' . _("Dynamic subtrees") . '</b>', false));
$container->addElement(new htmlSpacer('20px', null));
$container->addElement(new htmlOutputText($dynamicSubtrees), true);
}
echo "<tr class=\"userlist-bright\"><td style=\"padding:10px;\"><b>" . _("SASL mechanisms") . "</b>&nbsp;&nbsp;</td>";
echo "<td style=\"padding:10px;\">" . $supportedsaslmechanisms . "</td></tr>";
$container->addElement(new htmlOutputText('<b>' . _("SASL mechanisms") . '</b>', false));
$container->addElement(new htmlSpacer('20px', null));
$container->addElement(new htmlOutputText($supportedsaslmechanisms), true);
if ($vendorname != '') {
echo "<tr class=\"userlist-bright\"><td style=\"padding:10px;\"><b>" . _("Vendor name") . "</b>&nbsp;&nbsp;</td>";
echo "<td style=\"padding:10px;\">" . $vendorname . "</td></tr>";
$container->addElement(new htmlOutputText('<b>' . _("Vendor name") . '</b>', false));
$container->addElement(new htmlSpacer('20px', null));
$container->addElement(new htmlOutputText($vendorname), true);
}
if ($vendorversion != '') {
echo "<tr class=\"userlist-bright\"><td style=\"padding:10px;\"><b>" . _("Vendor version") . "</b>&nbsp;&nbsp;</td>";
echo "<td style=\"padding:10px;\">" . $vendorversion . "</td></tr>";
$container->addElement(new htmlOutputText('<b>' . _("Vendor version") . '</b>', false));
$container->addElement(new htmlSpacer('20px', null));
$container->addElement(new htmlOutputText($vendorversion), true);
}
echo "</table>\n";
parseHtml(null, $container, array(), true, $tabindex, 'user');
echo '</div>';
include 'main_footer.php';
?>