diff --git a/db_create.php b/db_create.php index debf68aea..db4f090ac 100755 --- a/db_create.php +++ b/db_create.php @@ -54,7 +54,45 @@ if (! $result) { $GLOBALS['db'] = $new_db; if($GLOBALS['is_ajax_request'] == true) { - PMA_ajaxResponse($message, true); + + $extra_data['sql_query'] = PMA_showMessage(NULL, $sql_query, 'success'); + + //Construct the html for the new database, so that it can be appended to the list of databases on server_databases.php + + $db_url_params['db'] = $new_db; + + $is_superuser = PMA_isSuperuser(); + + $new_db_string = ''; + + if ($is_superuser || $cfg['AllowUserDropDatabase']) { + $new_db_string .= ''; + $new_db_string .= ''; + $new_db_string .=''; + } + + $new_db_string .= ''; + $new_db_string .= ''; + $new_db_string .= $new_db . ''; + $new_db_string .= ''; + + if($is_superuser) { + + $db_url_params['checkprivs'] = $new_db; + + $new_db_string .= ''; + $new_db_string .= ''; + $new_db_string .= ($cfg['PropertiesIconic'] + ? ' ' . __('Check Privileges') . ' ' + : __('Check Privileges')) . ''; + $new_db_string .= ''; + } + + $new_db_string .= ''; + + $extra_data['new_db_string'] = $new_db_string; + + PMA_ajaxResponse($message, true, $extra_data); } require_once './libraries/header.inc.php'; diff --git a/js/functions.js b/js/functions.js index de95793b3..9c6383b28 100755 --- a/js/functions.js +++ b/js/functions.js @@ -2090,9 +2090,10 @@ $(document).ready(function() { $("#tabledatabases") .find('tbody') .append(data.new_db_string) - .PMA_sort_table('.name'); - - //PMA_sort_table($("#tabledatabases tbody"), '.name'); + .PMA_sort_table('.name') + .find('#db_summary_row') + .appendTo('#tabledatabases tbody') + .removeClass('odd even'); } else { PMA_ajaxShowMessage(data.error); diff --git a/server_databases.php b/server_databases.php index 7aeee672c..20fe11433 100755 --- a/server_databases.php +++ b/server_databases.php @@ -295,7 +295,7 @@ if ($databases_count > 0) { } // end foreach ($databases as $key => $current) unset($current, $odd_row); - echo '' . "\n"; + echo '' . "\n"; if ($is_superuser || $cfg['AllowUserDropDatabase']) { echo ' ' . "\n"; }