diff --git a/db_create.php b/db_create.php index 69e12153d..debf68aea 100755 --- a/db_create.php +++ b/db_create.php @@ -41,6 +41,11 @@ if (! $result) { // avoid displaying the not-created db name in header or navi panel $GLOBALS['db'] = ''; $GLOBALS['table'] = ''; + + if($GLOBALS['is_ajax_request'] == true) { + PMA_ajaxResponse($message, FALSE); + } + require_once './libraries/header.inc.php'; require_once './main.php'; } else { @@ -48,6 +53,10 @@ if (! $result) { $message->addParam($new_db); $GLOBALS['db'] = $new_db; + if($GLOBALS['is_ajax_request'] == true) { + PMA_ajaxResponse($message, true); + } + require_once './libraries/header.inc.php'; require_once './' . $cfg['DefaultTabDatabase']; } diff --git a/js/functions.js b/js/functions.js index 2bfdf64b6..1bcac63d4 100755 --- a/js/functions.js +++ b/js/functions.js @@ -2049,4 +2049,27 @@ $(document).ready(function() { }) }); }); //end of Drop Database Ajax action +}) + +/** + * jQuery coding for 'Create Database'. Used wherever libraries/ + * display_create_database.lib.php is used, ie main.php and server_databases.php + */ +$(document).ready(function() { + + $('#create_database_form').live('submit', function(event) { + event.preventDefault(); + + PMA_ajaxShowMessage(PMA_messages['strProcessingRequest']); + $(this).append(''); + + $.post($(this).attr('action'), $(this).serialize(), function(data) { + if(data.success == true) { + PMA_ajaxShowMessage(data.message); + } + else { + PMA_ajaxShowMessage(data.error); + } + }) + }) }) \ No newline at end of file diff --git a/libraries/display_create_database.lib.php b/libraries/display_create_database.lib.php index f348f3ca7..e6caec5ca 100755 --- a/libraries/display_create_database.lib.php +++ b/libraries/display_create_database.lib.php @@ -17,7 +17,7 @@ require_once './libraries/check_user_privileges.lib.php'; if ($is_create_db_priv) { // The user is allowed to create a db ?> -