use JQuery for select all link and support deselection, too
This commit is contained in:
parent
5c615e3892
commit
1931b2ac49
|
@ -361,14 +361,8 @@ class lamList {
|
|||
" onMouseOut=\"list_out(this, '" . $rowID . "', '" . $this->type . "')\"\n" .
|
||||
" onClick=\"list_click(this, '" . $rowID . "', '" . $this->type . "')\"\n" .
|
||||
" onDblClick=\"top.location.href='../account/edit.php?type=" . $this->type . "&DN=" . rawurlencode($info[$i]['dn']) . "'\">\n");
|
||||
if (isset($_GET['selectall'])) {
|
||||
echo " <td align=\"center\"><input onClick=\"list_click(this, '" . $rowID . "', '" . $this->type . "')\"" .
|
||||
" type=\"checkbox\" checked name=\"" . $rowID . "\"></td>\n";
|
||||
}
|
||||
else {
|
||||
echo " <td align=\"center\"><input onClick=\"list_click(this, '" . $rowID . "', '" . $this->type . "')\"" .
|
||||
echo " <td align=\"center\"><input class=\"accountBoxUnchecked\" onClick=\"list_click(this, '" . $rowID . "', '" . $this->type . "')\"" .
|
||||
" type=\"checkbox\" name=\"" . $rowID . "\"></td>\n";
|
||||
}
|
||||
echo " <td align='center' style=\"white-space: nowrap;\">";
|
||||
$this->listPrintToolLinks($info[$i], $rowID);
|
||||
echo "</td>\n";
|
||||
|
@ -384,8 +378,7 @@ class lamList {
|
|||
$colspan = sizeof($this->attrArray) + 1;
|
||||
echo "<tr class=\"" . $this->type . "list\">\n";
|
||||
echo "<td align=\"center\"><img src=\"../../graphics/select.png\" alt=\"select all\"></td>\n";
|
||||
echo "<td colspan=$colspan> <a href=\"list.php?type=" . $this->type . "&norefresh=y&page=" . $this->page .
|
||||
"&sort=" . $this->sortColumn . $this->filterText . "&selectall=yes\">" .
|
||||
echo "<td colspan=$colspan> <a href=\"#\" onClick=\"list_switchAccountSelection();\">" .
|
||||
"<font color=\"black\"><b>" . _("Select all") . "</b></font></a></td>\n";
|
||||
echo "</tr>\n";
|
||||
echo ("</table>");
|
||||
|
|
|
@ -83,3 +83,19 @@ function addResizeHandler(item, min, max) {
|
|||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Selects/deselects all accounts on the page.
|
||||
*/
|
||||
function list_switchAccountSelection() {
|
||||
// set checkbox selection
|
||||
jQuery('.accountBoxUnchecked').attr('checked', 'checked');
|
||||
jQuery('.accountBoxChecked').removeAttr('checked');
|
||||
// switch CSS class
|
||||
nowChecked = jQuery('.accountBoxUnchecked');
|
||||
nowUnchecked = jQuery('.accountBoxChecked');
|
||||
nowChecked.addClass('accountBoxChecked');
|
||||
nowChecked.removeClass('accountBoxUnchecked');
|
||||
nowUnchecked.addClass('accountBoxUnchecked');
|
||||
nowUnchecked.removeClass('accountBoxChecked');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue