Conditional Ajax in Privileges

This commit is contained in:
Marc Delisle
2011-02-05 07:18:42 -05:00
parent d17b0e157d
commit f328f6d4a9
2 changed files with 30 additions and 15 deletions

View File

@@ -19,6 +19,12 @@ $GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js';
require './libraries/server_common.inc.php';
if ($GLOBALS['cfg']['AjaxEnable']) {
$conditional_class = 'ajax';
} else {
$conditional_class = '';
}
/**
* Messages are built using the message name
*/
@@ -1346,7 +1352,7 @@ if (isset($_REQUEST['flush_privileges'])) {
/**
* defines some standard links
*/
$link_edit = '<a class="edit_user_anchor" href="server_privileges.php?' . $GLOBALS['url_query']
$link_edit = '<a class="edit_user_anchor ' . $conditional_class . '" href="server_privileges.php?' . $GLOBALS['url_query']
. '&amp;username=%s'
. '&amp;hostname=%s'
. '&amp;dbname=%s'
@@ -1363,7 +1369,7 @@ $link_revoke = '<a href="server_privileges.php?' . $GLOBALS['url_query']
. PMA_getIcon('b_usrdrop.png', __('Revoke'))
. '</a>';
$link_export = '<a class="export_user_anchor" href="server_privileges.php?' . $GLOBALS['url_query']
$link_export = '<a class="export_user_anchor ' . $conditional_class . '" href="server_privileges.php?' . $GLOBALS['url_query']
. '&amp;username=%s'
. '&amp;hostname=%s'
. '&amp;initial=%s'
@@ -1583,7 +1589,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs
uksort($array_initials, "strnatcasecmp");
echo '<table id="initials_table" cellspacing="5"><tr>';
echo '<table id="initials_table" class="' . $conditional_class . '" <cellspacing="5"><tr>';
foreach ($array_initials as $tmp_initial => $initial_was_found) {
if ($initial_was_found) {
echo '<td><a href="server_privileges.php?' . $GLOBALS['url_query'] . '&amp;initial=' . urlencode($tmp_initial) . '">' . $tmp_initial . '</a></td>' . "\n";
@@ -1685,7 +1691,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs
// add/delete user fieldset
echo ' <fieldset id="fieldset_add_user">' . "\n"
. ' <a href="server_privileges.php?' . $GLOBALS['url_query'] . '&amp;adduser=1">' . "\n"
. ' <a href="server_privileges.php?' . $GLOBALS['url_query'] . '&amp;adduser=1" class="' . $conditional_class . '">' . "\n"
. PMA_getIcon('b_usradd.png')
. ' ' . __('Add a new User') . '</a>' . "\n"
. ' </fieldset>' . "\n"
@@ -1702,7 +1708,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs
. ' </label>' . "\n"
. ' </fieldset>' . "\n"
. ' <fieldset id="fieldset_delete_user_footer" class="tblFooters">' . "\n"
. ' <input type="submit" name="delete" value="' . __('Go') . '" id="buttonGo" />' . "\n"
. ' <input type="submit" name="delete" value="' . __('Go') . '" id="buttonGo" class="' . $conditional_class . '"/>' . "\n"
. ' </fieldset>' . "\n"
. '</form>' . "\n";
} else {
@@ -1720,7 +1726,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs
}
$flushnote = new PMA_Message(__('Note: phpMyAdmin gets the users\' privileges directly from MySQL\'s privilege tables. The content of these tables may differ from the privileges the server uses, if they have been changed manually. In this case, you should %sreload the privileges%s before you continue.'), PMA_Message::NOTICE);
$flushnote->addParam('<a href="server_privileges.php?' . $GLOBALS['url_query'] . '&amp;flush_privileges=1" id="reload_privileges_anchor">', false);
$flushnote->addParam('<a href="server_privileges.php?' . $GLOBALS['url_query'] . '&amp;flush_privileges=1" id="reload_privileges_anchor" class="' . $conditional_class . '">', false);
$flushnote->addParam('</a>', false);
$flushnote->display();
}