diff --git a/db_operations.php b/db_operations.php index 29e7b662b..5a01d2682 100644 --- a/db_operations.php +++ b/db_operations.php @@ -30,12 +30,15 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) { $move = false; } + $_msg_type = 'success'; + if (!isset($newname) || !strlen($newname)) { - $message = $strDatabaseEmpty; + $_message = $strDatabaseEmpty; + $_msg_type = 'error'; } else { $sql_query = ''; // in case target db exists if ($move || - (isset($create_database_before_copying) && $create_database_before_copying)) { + (isset($create_database_before_copying) && $create_database_before_copying)) { /** * @todo activate this with the correct version of MySQL * when they fix the problem when the db contains a VIEW @@ -85,9 +88,6 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) { // value of $what for this table only $this_what = $what; - if (!isset($tables_full[$each_table]['Engine'])) { - $tables_full[$each_table]['Engine'] = $tables_full[$each_table]['Type']; - } // do not copy the data from a Merge table // note: on the calling FORM, 'data' means 'structure and data' if ($tables_full[$each_table]['Engine'] == 'MRG_MyISAM') { @@ -107,7 +107,7 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) { unset($GLOBALS['sql_constraints_query']); } } - + // $sql_query is filled by PMA_Table::moveCopy() $sql_query = $back . $sql_query; } // end (foreach) unset($each_table); @@ -154,10 +154,10 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) { $sql_query .= "\n" . $local_query; PMA_DBI_query($local_query); } - $message = sprintf($strRenameDatabaseOK, htmlspecialchars($db), + $_message = sprintf($strRenameDatabaseOK, htmlspecialchars($db), htmlspecialchars($newname)); } else { - $message = sprintf($strCopyDatabaseOK, htmlspecialchars($db), + $_message = sprintf($strCopyDatabaseOK, htmlspecialchars($db), htmlspecialchars($newname)); } $reload = true; @@ -202,6 +202,11 @@ if (empty($is_info)) { $sub_part = '_structure'; require './libraries/db_info.inc.php'; echo "\n"; + + if (iseet($_message)) { + PMA_showMessage($_message, $sql_query, $_msg_type); + unset($_message, $_msg_type); + } } $db_collation = PMA_getDbCollation($db); diff --git a/import.php b/import.php index 1bc2e28f6..46acb2b23 100644 --- a/import.php +++ b/import.php @@ -50,8 +50,8 @@ if (!empty($sql_query)) { // upload limit has been reached, let's assume the second possibility. if ($_POST == array() && $_GET == array()) { require_once './libraries/header.inc.php'; - $show_error_header = TRUE; - PMA_showMessage(sprintf($strUploadLimit, '[a@./Documentation.html#faq1_16@_blank]', '[/a]')); + PMA_showMessage(sprintf($strUploadLimit, '[a@./Documentation.html#faq1_16@_blank]', '[/a]'), + null, 'error'); require './libraries/footer.inc.php'; } diff --git a/libraries/display_export.lib.php b/libraries/display_export.lib.php index 4265770df..2d86ae4c4 100644 --- a/libraries/display_export.lib.php +++ b/libraries/display_export.lib.php @@ -35,9 +35,7 @@ $export_list = PMA_getPlugins('./libraries/export/', array('export_type' => $exp /* Fail if we didn't find any plugin */ if (empty($export_list)) { - $GLOBALS['show_error_header'] = TRUE; - PMA_showMessage($strCanNotLoadExportPlugins); - unset($GLOBALS['show_error_header']); + PMA_showMessage($strCanNotLoadExportPlugins, null, 'error'); require './libraries/footer.inc.php'; } ?> diff --git a/libraries/display_import.lib.php b/libraries/display_import.lib.php index 6d22d7ef2..d753d31e3 100644 --- a/libraries/display_import.lib.php +++ b/libraries/display_import.lib.php @@ -16,9 +16,7 @@ $import_list = PMA_getPlugins('./libraries/import/', $import_type); /* Fail if we didn't find any plugin */ if (empty($import_list)) { - $GLOBALS['show_error_header'] = TRUE; - PMA_showMessage($strCanNotLoadImportPlugins); - unset($GLOBALS['show_error_header']); + PMA_showMessage($strCanNotLoadImportPlugins, null, 'error'); require './libraries/footer.inc.php'; } ?> diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index 6757abfe8..047b2f460 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -1868,7 +1868,13 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql) $last_shown_rec = ($_SESSION['userconf']['max_rows'] == 'all' || $pos_next > $total) ? $total - 1 : $pos_next - 1; - PMA_showMessage($GLOBALS['strShowingRecords'] . ' ' . $_SESSION['userconf']['pos'] . ' - ' . $last_shown_rec . ' (' . $pre_count . PMA_formatNumber($total, 0) . $after_count . ' ' . $GLOBALS['strTotal'] . $selectstring . ', ' . sprintf($GLOBALS['strQueryTime'], $GLOBALS['querytime']) . ')'); + PMA_showMessage($GLOBALS['strShowingRecords'] . ' ' + . $_SESSION['userconf']['pos'] . ' - ' . $last_shown_rec + . ' (' . $pre_count . PMA_formatNumber($total, 0) . $after_count + . ' ' . $GLOBALS['strTotal'] . $selectstring . ', ' + . sprintf($GLOBALS['strQueryTime'], $GLOBALS['querytime']) . ')', + $sql_query, + 'success'); if (PMA_Table::isView($db, $table) && $total == $GLOBALS['cfg']['MaxExactCount']) { echo '