added support for mouseOver effects and row checking

This commit is contained in:
Roland Gruber 2003-04-12 15:38:57 +00:00
parent 57b334b7a2
commit 4ceb87ca9e
3 changed files with 119 additions and 22 deletions

View File

@ -522,3 +522,82 @@ function onKeyDownArrowsHandler(e) {
} }
e.returnValue = false; e.returnValue = false;
} }
// functions for row checking and mouseOver effects
// mouseOver function
function user_over(list, box) {
cbox = document.getElementsByName(box)[0];
if (cbox.checked == false) list.setAttribute('class','userlist_over', 0);
}
// mouseOut function
function user_out(list, box) {
cbox = document.getElementsByName(box)[0];
if (cbox.checked == false) list.setAttribute('class','userlist', 0);
}
// onClick function
function user_click(list, box) {
cbox = document.getElementsByName(box)[0];
if (cbox.checked == true) {
cbox.checked = false;
list.setAttribute('class','userlist_over', 0);
}
else {
cbox.checked = true;
list.setAttribute('class','userlist_checked', 0);
}
}
// mouseOver function
function group_over(list, box) {
cbox = document.getElementsByName(box)[0];
if (cbox.checked == false) list.setAttribute('class','grouplist_over', 0);
}
// mouseOut function
function group_out(list, box) {
cbox = document.getElementsByName(box)[0];
if (cbox.checked == false) list.setAttribute('class','grouplist', 0);
}
// onClick function
function group_click(list, box) {
cbox = document.getElementsByName(box)[0];
if (cbox.checked == true) {
cbox.checked = false;
list.setAttribute('class','grouplist_over', 0);
}
else {
cbox.checked = true;
list.setAttribute('class','grouplist_checked', 0);
}
}
// mouseOver function
function host_over(list, box) {
cbox = document.getElementsByName(box)[0];
if (cbox.checked == false) list.setAttribute('class','hostlist_over', 0);
}
// mouseOut function
function host_out(list, box) {
cbox = document.getElementsByName(box)[0];
if (cbox.checked == false) list.setAttribute('class','hostlist', 0);
}
// onClick function
function host_click(list, box) {
cbox = document.getElementsByName(box)[0];
if (cbox.checked == true) {
cbox.checked = false;
list.setAttribute('class','hostlist_over', 0);
}
else {
cbox.checked = true;
list.setAttribute('class','hostlist_checked', 0);
}
}

View File

@ -29,7 +29,10 @@ include_once("ldap.php");
session_save_path("../sess"); session_save_path("../sess");
@session_start(); @session_start();
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../style/layout.css\" />"; echo "<html><head><title>hjhj</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../style/layout.css\">\n";
echo "</head><body bgcolor=\"#F4F4F4\">\n";
echo "<script src=\"./functions.js\" type=\"text/javascript\" language=\"javascript\"></script>\n";
// generate attribute-description table // generate attribute-description table
$attr_array; // list of LDAP attributes to show $attr_array; // list of LDAP attributes to show
@ -65,20 +68,25 @@ if ($sr) {
} }
else echo ("<br><br><font color=\"red\"><b>" . _("LDAP Search failed! Please check your preferences. <br> No Groups found!") . "</b></font><br><br>"); else echo ("<br><br><font color=\"red\"><b>" . _("LDAP Search failed! Please check your preferences. <br> No Groups found!") . "</b></font><br><br>");
echo ("<form action=\"../templates/account.php?type=group\" method=\"post\">\n");
// print host table header // print host table header
echo "<table width=\"100%\">\n"; echo "<table rules='all' class=\"grouplist\" width=\"100%\">\n";
echo "<tr><th class=\"grouplist\" width=12></th>"; echo "<tr class=\"grouplist_head\"><th width=22 height=34></th><th></th>";
// table header // table header
for ($k = 0; $k < sizeof($desc_array); $k++) { for ($k = 0; $k < sizeof($desc_array); $k++) {
echo "<th class=\"grouplist\">" . $desc_array[$k] . "</th>"; echo "<th>" . $desc_array[$k] . "</th>";
} }
echo "</tr>\n"; echo "</tr>\n";
echo ("<form action=\"../templates/account.php?type=group\" method=\"post\">\n");
// print group list // print group list
for ($i = 0; $i < sizeof($info)-1; $i++) { // ignore last entry in array which is "count" for ($i = 0; $i < sizeof($info)-1; $i++) { // ignore last entry in array which is "count"
echo("<tr><td class=\"grouplist\"><input type=\"radio\" name=\"DN\" value=\"" . $info[$i]["dn"] . "\"></td>"); echo("<tr class=\"grouplist\" onMouseOver=\"group_over(this, '" . $info[$i]["dn"] . "')\"" .
"onMouseOut=\"group_out(this, '" . $info[$i]["dn"] . "')\"" .
"onClick=\"group_click(this, '" . $info[$i]["dn"] . "')\">" .
"<td height=22><input type=\"checkbox\" name=\"" . $info[$i]["dn"] . "\"></td>" .
"<td align='center'><a href=\"../templates/account.php?type=group,DN='" . $info[$i]["dn"] . "'\">" . _("Edit") . "</a></td>");
for ($k = 0; $k < sizeof($attr_array); $k++) { for ($k = 0; $k < sizeof($attr_array); $k++) {
echo ("<td class=\"grouplist\">"); echo ("<td>");
// print all attribute entries seperated by "; " // print all attribute entries seperated by "; "
if (sizeof($info[$i][strtolower($attr_array[$k])]) > 0) { if (sizeof($info[$i][strtolower($attr_array[$k])]) > 0) {
array_shift($info[$i][strtolower($attr_array[$k])]); array_shift($info[$i][strtolower($attr_array[$k])]);
@ -90,11 +98,10 @@ for ($i = 0; $i < sizeof($info)-1; $i++) { // ignore last entry in array which i
} }
echo ("</table>"); echo ("</table>");
echo ("<p>&nbsp</p>\n"); echo ("<p>&nbsp</p>\n");
echo ("<p>&nbsp</p>\n");
echo ("<table align=\"left\" border=\"0\">"); echo ("<table align=\"left\" border=\"0\">");
echo ("<tr><td align=\"left\"><input type=\"submit\" name=\"editgroup\" value=\"" . _("Edit Group") . "\">"); echo ("<tr><td align=\"left\"><input type=\"button\" name=\"newgroup\" value=\"" . _("New Group") . "\" onClick=\"self.location.href='../templates/account.php?type=group'\">");
echo ("&nbsp<input type=\"button\" name=\"newgroup\" value=\"" . _("New Group") . "\" onClick=\"self.location.href='../templates/account.php?type=group'\">"); echo ("&nbsp<input type=\"button\" name=\"delgroup\" value=\"" . _("Delete Group(s)") . "\" onClick=\"self.location.href='../templates/account.php?type=delete'\"></td></tr>\n");
echo ("&nbsp<input type=\"button\" name=\"delgroup\" value=\"" . _("Delete Group") . "\" onClick=\"self.location.href='../templates/account.php?type=delete'\"></td></tr>\n");
echo ("</table>\n"); echo ("</table>\n");
echo ("</form>\n"); echo ("</form>\n");
echo "</body></html>\n";
?> ?>

View File

@ -96,23 +96,34 @@ text-decoration:none;
* table style for grouplist.php * table style for grouplist.php
* *
*/ */
th.grouplist {
/* table preferences */
table.grouplist {
border-width:1px; border-width:1px;
border-style:solid; border-style:solid;
border-color:#B7C7B7; border-color:#7167bf;
padding:10px;
background-color:#a8c3ff;
font-size:14px; font-size:14px;
}
/* color of entry rows */
tr.grouplist {
background-color:#d6e3ff;
}
/* color of head row */
tr.grouplist_head {
background-color:#a8c3ff;
font-weight:bold; font-weight:bold;
} }
td.grouplist { /* color of rows on mouseOver */
border-width:1px; tr.grouplist_over {
border-style:solid; background-color:#C7E7C7;
border-color:#C7D7C7; }
padding:4px;
background-color:#d6e3ff; /* color of checked rows */
font-size:14px; tr.grouplist_checked {
background-color:#f27c71;
} }
/** /**