diff --git a/js/server_privileges.js b/js/server_privileges.js index 7214d74dbe..4e356ba304 100644 --- a/js/server_privileges.js +++ b/js/server_privileges.js @@ -473,6 +473,53 @@ $(document).ready(function() { * @memberOf jQuery * @name export_user_click */ + $("button.mult_submit[value=export]").live('click', function(event) { + event.preventDefault(); + var $msgbox = PMA_ajaxShowMessage(); + var button_options = {}; + button_options[PMA_messages['strClose']] = function() { + $(this).dialog("close"); + }; + $.post($(this.form).prop('action'), + $(this.form).serialize() + '&submit_mult=export&ajax_request=true', + function(data) { + var $ajaxDialog = $('
') + .append(data.message) + .dialog({ + title: data.title, + width: 500, + buttons: button_options, + close: function () { + $(this).remove(); + } + }); + PMA_ajaxRemoveMessage($msgbox); + // Attach syntax highlited editor to export dialog + CodeMirror.fromTextArea( + $ajaxDialog.find('textarea')[0], + { + lineNumbers: true, + matchBrackets: true, + indentUnit: 4, + mode: "text/x-mysql" + } + ); + }); //end $.post + }); + // if exporting non-ajax, highlight anyways + if ($("textarea.export")) + { + CodeMirror.fromTextArea( + $('textarea.export')[0], + { + lineNumbers: true, + matchBrackets: true, + indentUnit: 4, + mode: "text/x-mysql" + } + ); + } + $(".export_user_anchor.ajax").live('click', function(event) { event.preventDefault(); var $msgbox = PMA_ajaxShowMessage(); diff --git a/server_privileges.php b/server_privileges.php index f3bcc41824..14cffd4bfc 100644 --- a/server_privileges.php +++ b/server_privileges.php @@ -1528,14 +1528,15 @@ $link_export_all = '' - . PMA_getIcon('b_tblexport.png', __('Export all')) + . PMA_getIcon('b_tblexport.png', __('Export all')) . ' ' + . __('Export all') . ''; /** * If we are in an Ajax request for Create User/Edit User/Revoke User/ * Flush Privileges, show $message and exit. */ -if ($GLOBALS['is_ajax_request'] && ! isset($_REQUEST['export']) && (! isset($_REQUEST['adduser']) || $_add_user_error) && ! isset($_REQUEST['initial']) && ! isset($_REQUEST['showall']) && ! isset($_REQUEST['edit_user_dialog']) && ! isset($_REQUEST['db_specific'])) { +if ($GLOBALS['is_ajax_request'] && ! isset($_REQUEST['export']) && (! isset($_REQUEST['submit_mult']) || $_REQUEST['submit_mult'] != 'export') && (! isset($_REQUEST['adduser']) || $_add_user_error) && ! isset($_REQUEST['initial']) && ! isset($_REQUEST['showall']) && ! isset($_REQUEST['edit_user_dialog']) && ! isset($_REQUEST['db_specific'])) { if (isset($sql_query)) { $extra_data['sql_query'] = PMA_showMessage(null, $sql_query); @@ -1623,8 +1624,8 @@ if (isset($viewing_mode) && $viewing_mode == 'db') { */ // export user definition -if (isset($_REQUEST['export'])) { - $response = '