From 10a9e6912c9f2011b69a67ba4b9d539c9550509b Mon Sep 17 00:00:00 2001 From: ninadsp Date: Wed, 14 Jul 2010 01:36:42 +0530 Subject: [PATCH] A newly added table will now be appended to the tablesForm if it exists. tbl_create.php generates the necessary output for it. Need to figure out how to calculate the size and overhead, when stats are shown. --- tbl_create.php | 65 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/tbl_create.php b/tbl_create.php index 169960bb1..388598ebd 100755 --- a/tbl_create.php +++ b/tbl_create.php @@ -40,6 +40,7 @@ */ require_once './libraries/common.inc.php'; require_once './libraries/Table.class.php'; +require_once './libraries/mysql_charsets.lib.php'; $GLOBALS['js_include'][] = 'functions.js'; $action = 'tbl_create.php'; @@ -249,7 +250,69 @@ if (isset($_REQUEST['do_save_data'])) { $message = PMA_Message::success(__('Table %1$s has been created.')); $message->addParam(PMA_backquote($db) . '.' . PMA_backquote($table)); - PMA_ajaxResponse($message, $message->isSuccess()); + if($GLOBALS['is_ajax_request'] == true) { + + //construct the html for the newly created table's row to be appended + + $tbl_url_params = array(); + $tbl_url_params['db'] = $db; + $tbl_url_params['table'] = $table; + $is_show_stats = $cfg['ShowStats']; + + $new_table_string = '' . "\n"; + $new_table_string .= ' ' . "\n"; + + $new_table_string .= ''; + $new_table_string .= ''. $table . ''; + + if (PMA_Tracker::isActive()) { + $truename = str_replace(' ', ' ', htmlspecialchars($table)); + if (PMA_Tracker::isTracked($db, $truename)) { + $new_table_string .= '' . __('Tracking is active.') . ''; + } elseif (PMA_Tracker::getVersion($db, $truename) > 0) { + $new_table_string .= '' . __('Tracking is not active.') . ''; + } + unset($truename); + } + $new_table_string .= '' . "\n"; + + $new_table_string .= ' ' . __('Browse') . ' ' . "\n"; + + $new_table_string .= ' '; + $new_table_string .= '' . __('Structure') . ''; + $new_table_string .= ' ' . "\n"; + + $new_table_string .= ' ' . __('Search') . ' ' . "\n"; + + $new_table_string .= ' '; + $new_table_string .= '' . __('Insert') . ''; + $new_table_string .= ' ' . "\n"; + + $new_table_string .= ' ' . __('Empty') . ' ' . "\n"; + + $new_table_string .= ' '; + $new_table_string .= '' . __('Drop') . ''; + $new_table_string .= ' ' . "\n"; + + $new_table_string .= '0' . "\n"; //In a newly created table, number of rows has to be zero. + + $new_table_string .= '' . $_REQUEST['tbl_type'] . '' . "\n"; + + $new_table_string .= ' '. $_REQUEST['tbl_collation'] .'' . "\n"; + + if($is_show_stats) { + $new_table_string .= ' Size ' . "\n" ; + $new_table_string .= '-' . "\n" ; + } + + $new_table_string .= '' . "\n"; + + $extra_data['new_table_string'] = $new_table_string; + + PMA_ajaxResponse($message, $message->isSuccess(), $extra_data); + } $display_query = $sql_query; $sql_query = '';