added (un)checkall links to the "Global privileges" edition form

This commit is contained in:
Olivier Müller
2004-04-03 00:29:59 +00:00
parent 3eb019f25a
commit c56cf7cf47
3 changed files with 16 additions and 5 deletions

View File

@@ -5,6 +5,12 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2004-03-23 Olivier Mueller <om@omnis.ch>
* server_privileges.php, libraries/server_privileges.js: added
(un)checkall links to the "Global privileges" edition form.
Todo: make it work even if JS is disabled + local links
for the "Data" and "Structure" checkboxes groups.
2004-04-02 Alexander M. Turek <me@derrabus.de> 2004-04-02 Alexander M. Turek <me@derrabus.de>
* lang/german-*.inc.php: Fixed a typo. * lang/german-*.inc.php: Fixed a typo.

View File

@@ -69,7 +69,9 @@ function checkAddUser(the_form)
*/ */
function setCheckboxes(the_form, the_checkboxes, do_check) function setCheckboxes(the_form, the_checkboxes, do_check)
{ {
var elts = document.forms[the_form].elements[the_checkboxes + '[]']; var elts = (the_checkboxes != '')
? document.forms[the_form].elements[the_checkboxes + '[]']
: document.forms[the_form].elements;
var elts_cnt = (typeof(elts.length) != 'undefined') var elts_cnt = (typeof(elts.length) != 'undefined')
? elts.length ? elts.length
: 0; : 0;
@@ -83,4 +85,4 @@ function setCheckboxes(the_form, the_checkboxes, do_check)
} // end if... else } // end if... else
return true; return true;
} // end of the 'setCheckboxes()' function } // end of the 'setCheckboxes()' function

View File

@@ -371,7 +371,10 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = TRUE, $indent =
. $spaces . ' <th colspan="6">&nbsp;' . ($db == '*' ? $GLOBALS['strGlobalPrivileges'] : ($table == '*' ? $GLOBALS['strDbPrivileges'] : $GLOBALS['strTblPrivileges'])) . '&nbsp;</th>' . "\n" . $spaces . ' <th colspan="6">&nbsp;' . ($db == '*' ? $GLOBALS['strGlobalPrivileges'] : ($table == '*' ? $GLOBALS['strDbPrivileges'] : $GLOBALS['strTblPrivileges'])) . '&nbsp;</th>' . "\n"
. $spaces . ' </tr>' . "\n" . $spaces . ' </tr>' . "\n"
. $spaces . ' <tr>' . "\n" . $spaces . ' <tr>' . "\n"
. $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '" colspan="6"><small><i>' . $GLOBALS['strEnglishPrivileges'] . '</i></small></td>' . "\n" . $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '" align="center" colspan="6"><small><i>' . $GLOBALS['strEnglishPrivileges'] . '</i></small><br />' . "\n"
. $spaces . ' <a href="./server_privileges.php?' . $url_query . '&amp;checkall=1" onclick="setCheckboxes(\'usersForm\', \'\', true); return false;">' . $GLOBALS['strCheckAll'] . '</a>' . "\n"
. $spaces . ' &nbsp;&nbsp;&nbsp' . "\n"
. $spaces . ' <a href="./server_privileges.php?' . $url_query . '" onclick="setCheckboxes(\'usersForm\', \'\', false); return false;">' . $GLOBALS['strUncheckAll'] . '</a></td>' . "\n"
. $spaces . ' </tr>' . "\n" . $spaces . ' </tr>' . "\n"
. $spaces . ' <tr>' . "\n" . $spaces . ' <tr>' . "\n"
. $spaces . ' <td bgcolor="' . $cfg['BgcolorOne'] . '" colspan="2">&nbsp;<b><i>' . $GLOBALS['strData'] . '</i></b>&nbsp;</td>' . "\n" . $spaces . ' <td bgcolor="' . $cfg['BgcolorOne'] . '" colspan="2">&nbsp;<b><i>' . $GLOBALS['strData'] . '</i></b>&nbsp;</td>' . "\n"
@@ -1030,7 +1033,7 @@ if (empty($adduser) && empty($checkprivs)) {
unset($res); unset($res);
echo '<ul>' . "\n" echo '<ul>' . "\n"
. ' <li>' . "\n" . ' <li>' . "\n"
. ' <form action="server_privileges.php" method="post">' . "\n" . ' <form name="usersForm" action="server_privileges.php" method="post">' . "\n"
. PMA_generate_common_hidden_inputs('', '', 3) . PMA_generate_common_hidden_inputs('', '', 3)
. ' <input type="hidden" name="username" value="' . htmlspecialchars($username) . '" />' . "\n" . ' <input type="hidden" name="username" value="' . htmlspecialchars($username) . '" />' . "\n"
. ' <input type="hidden" name="hostname" value="' . htmlspecialchars($hostname) . '" />' . "\n"; . ' <input type="hidden" name="hostname" value="' . htmlspecialchars($hostname) . '" />' . "\n";
@@ -1273,7 +1276,7 @@ if (empty($adduser) && empty($checkprivs)) {
echo '<h2>' . "\n" echo '<h2>' . "\n"
. ' ' . $strAddUser . "\n" . ' ' . $strAddUser . "\n"
. '</h2>' . "\n" . '</h2>' . "\n"
. '<form action="server_privileges.php" method="post" onsubmit="return checkAddUser(this);">' . "\n" . '<form name="usersForm" action="server_privileges.php" method="post" onsubmit="return checkAddUser(this);">' . "\n"
. PMA_generate_common_hidden_inputs('', '', 1) . PMA_generate_common_hidden_inputs('', '', 1)
. ' <table border="0">' . "\n" . ' <table border="0">' . "\n"
. ' <tr>' . "\n" . ' <tr>' . "\n"