Merge remote branch 'origin/master'

This commit is contained in:
Pootle server
2011-02-05 14:40:24 +01:00
4 changed files with 58 additions and 26 deletions

View File

@@ -148,11 +148,12 @@ $(document).ready(function() {
*
* @see PMA_ajaxShowMessage()
* @see appendNewUser()
* @see $cfg['AjaxEnable']
* @memberOf jQuery
* @name add_user_click
*
*/
$("#fieldset_add_user a").live("click", function(event) {
$("#fieldset_add_user a.ajax").live("click", function(event) {
/** @lends jQuery */
event.preventDefault();
@@ -225,10 +226,11 @@ $(document).ready(function() {
* Ajax event handler for 'Reload Privileges' anchor
*
* @see PMA_ajaxShowMessage()
* @see $cfg['AjaxEnable']
* @memberOf jQuery
* @name reload_privileges_click
*/
$("#reload_privileges_anchor").live("click", function(event) {
$("#reload_privileges_anchor.ajax").live("click", function(event) {
event.preventDefault();
PMA_ajaxShowMessage(PMA_messages['strReloadingPrivileges']);
@@ -248,20 +250,23 @@ $(document).ready(function() {
* AJAX handler for 'Revoke User'
*
* @see PMA_ajaxShowMessage()
* @see $cfg['AjaxEnable']
* @memberOf jQuery
* @name revoke_user_click
*/
$("#fieldset_delete_user_footer #buttonGo").live('click', function(event) {
$("#fieldset_delete_user_footer #buttonGo.ajax").live('click', function(event) {
event.preventDefault();
PMA_ajaxShowMessage(PMA_messages['strRemovingSelectedUsers']);
$form = $("#usersForm");
$.post($("#usersForm").attr('action'), $("#usersForm").serialize() + "&delete=" + $(this).attr('value') + "&ajax_request=true", function(data) {
$.post($form.attr('action'), $form.serialize() + "&delete=" + $(this).attr('value') + "&ajax_request=true", function(data) {
if(data.success == true) {
PMA_ajaxShowMessage(data.message);
//Remove the revoked user from the users list
$("#usersForm").find("input:checkbox:checked").parents("tr").slideUp("medium", function() {
$form.find("input:checkbox:checked").parents("tr").slideUp("medium", function() {
var this_user_initial = $(this).find('input:checkbox').val().charAt(0).toUpperCase();
$(this).remove();
@@ -271,7 +276,7 @@ $(document).ready(function() {
}
//Re-check the classes of each row
$("#usersForm")
$form
.find('tbody').find('tr:odd')
.removeClass('even').addClass('odd')
.end()
@@ -296,8 +301,9 @@ $(document).ready(function() {
* Step 1: Load Edit User Dialog
* @memberOf jQuery
* @name edit_user_click
* @see $cfg['AjaxEnable']
*/
$(".edit_user_anchor").live('click', function(event) {
$(".edit_user_anchor.ajax").live('click', function(event) {
/** @lends jQuery */
event.preventDefault();
@@ -326,6 +332,7 @@ $(document).ready(function() {
* Step 2: Submit the Edit User Dialog
*
* @see PMA_ajaxShowMessage()
* @see $cfg['AjaxEnable']
* @memberOf jQuery
* @name edit_user_submit
*/
@@ -395,10 +402,11 @@ $(document).ready(function() {
* AJAX handler for 'Export Privileges'
*
* @see PMA_ajaxShowMessage()
* @see $cfg['AjaxEnable']
* @memberOf jQuery
* @name export_user_click
*/
$(".export_user_anchor").live('click', function(event) {
$(".export_user_anchor.ajax").live('click', function(event) {
/** @lends jQuery */
event.preventDefault();
@@ -424,10 +432,11 @@ $(document).ready(function() {
* AJAX handler to Paginate the Users Table
*
* @see PMA_ajaxShowMessage()
* @see $cfg['AjaxEnable']
* @name paginate_users_table_click
* @memberOf jQuery
*/
$("#initials_table").find("a").live('click', function(event) {
$("#initials_table.ajax").find("a").live('click', function(event) {
event.preventDefault();
PMA_ajaxShowMessage();

View File

@@ -269,6 +269,7 @@ $(document).ready(function() {
* @memberOf jQuery
* @name paginate_nav_button_click
* @uses PMA_ajaxShowMessage()
* @see $cfg['AjaxEnable']
*/
$("input[name=navig].ajax").live('click', function(event) {
/** @lends jQuery */
@@ -293,11 +294,11 @@ $(document).ready(function() {
* Paginate results with Page Selector dropdown
* @memberOf jQuery
* @name paginate_dropdown_change
* @see $cfg['AjaxEnable']
*/
$("#pageselector").live('change', function(event) {
var $the_form = $(this).parent("form");
// see $cfg['AjaxEnable']
if ($(this).hasClass('ajax')) {
event.preventDefault();
@@ -317,15 +318,19 @@ $(document).ready(function() {
* Ajax Event handler for sorting the results table
* @memberOf jQuery
* @name table_results_sort_click
* @see $cfg['AjaxEnable']
*/
$("#table_results").find("a[title=Sort]").live('click', function(event) {
$("#table_results.ajax").find("a[title=Sort]").live('click', function(event) {
event.preventDefault();
PMA_ajaxShowMessage();
$.get($(this).attr('href'), $(this).serialize() + '&ajax_request=true', function(data) {
$("#sqlqueryresults").html(data);
$("#sqlqueryresults").trigger('appendAnchor');
$anchor = $(this);
$.get($anchor.attr('href'), $anchor.serialize() + '&ajax_request=true', function(data) {
$("#sqlqueryresults")
.html(data)
.trigger('appendAnchor');
}) // end $.get()
})//end Sort results table
@@ -333,13 +338,17 @@ $(document).ready(function() {
* Ajax Event handler for the display options
* @memberOf jQuery
* @name displayOptionsForm_submit
* @see $cfg['AjaxEnable']
*/
$("#displayOptionsForm").live('submit', function(event) {
$("#displayOptionsForm.ajax").live('submit', function(event) {
event.preventDefault();
$.post($(this).attr('action'), $(this).serialize() + '&ajax_request=true' , function(data) {
$("#sqlqueryresults").html(data);
$("#sqlqueryresults").trigger('appendAnchor');
$form = $(this);
$.post($form.attr('action'), $form.serialize() + '&ajax_request=true' , function(data) {
$("#sqlqueryresults")
.html(data)
.trigger('appendAnchor');
}) // end $.post()
})
//end displayOptionsForm handler

View File

@@ -540,7 +540,11 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
// Display options (if we are not in print view)
if (! (isset($GLOBALS['printview']) && $GLOBALS['printview'] == '1')) {
echo '<form method="post" action="sql.php" name="displayOptionsForm" id="displayOptionsForm">';
echo '<form method="post" action="sql.php" name="displayOptionsForm" id="displayOptionsForm"';
if ($GLOBALS['cfg']['AjaxEnable']) {
echo ' class="ajax" ';
}
echo '>';
$url_params = array(
'db' => $db,
'table' => $table,
@@ -623,7 +627,11 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
echo '<input type="hidden" name="goto" value="sql.php" />' . "\n";
}
echo '<table id="table_results" class="data">' . "\n";
echo '<table id="table_results" class="data';
if ($GLOBALS['cfg']['AjaxEnable']) {
echo ' ajax';
}
echo '">' . "\n";
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
echo '<thead><tr>' . "\n";

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();
}