Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorninadsp <ninadsp16289@gmail.com>2010-07-14 00:06:42 +0400
committerninadsp <ninadsp16289@gmail.com>2010-07-14 00:06:42 +0400
commit10a9e6912c9f2011b69a67ba4b9d539c9550509b (patch)
treed3b07a4407a6e6bc84071699c30c41fd6c548ed2 /tbl_create.php
parent98a57e22190f525e1fdcde49e9640763d87752c7 (diff)
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.
Diffstat (limited to 'tbl_create.php')
-rwxr-xr-xtbl_create.php65
1 files changed, 64 insertions, 1 deletions
diff --git a/tbl_create.php b/tbl_create.php
index 169960bb1b..388598ebd2 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 = '<tr>' . "\n";
+ $new_table_string .= '<td align="center"> <input type="checkbox" id="checkbox_tbl_" name="selected_tbl[]" value="'.htmlspecialchars($table).'" /> </td>' . "\n";
+
+ $new_table_string .= '<th>';
+ $new_table_string .= '<a href="sql.php' . PMA_generate_common_url($tbl_url_params) . '">'. $table . '</a>';
+
+ if (PMA_Tracker::isActive()) {
+ $truename = str_replace(' ', '&nbsp;', htmlspecialchars($table));
+ if (PMA_Tracker::isTracked($db, $truename)) {
+ $new_table_string .= '<a href="tbl_tracking.php' . PMA_generate_common_url($tbl_url_params) . '"><img class="icon" width="14" height="14" src="' . $pmaThemeImage . 'eye.png" alt="' . __('Tracking is active.') . '" title="' . __('Tracking is active.') . '" /></a>';
+ } elseif (PMA_Tracker::getVersion($db, $truename) > 0) {
+ $new_table_string .= '<a href="tbl_tracking.php' . PMA_generate_common_url($tbl_url_params) . '"><img class="icon" width="14" height="14" src="' . $pmaThemeImage . 'eye_grey.png" alt="' . __('Tracking is not active.') . '" title="' . __('Tracking is not active.') . '" /></a>';
+ }
+ unset($truename);
+ }
+ $new_table_string .= '</th>' . "\n";
+
+ $new_table_string .= '<td> <img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'bd_browse.png" alt="' . __('Browse') . '" title="' . __('Browse') . '" /> </td>' . "\n";
+
+ $new_table_string .= '<td> <a href="tbl_structure.php' . PMA_generate_common_url($tbl_url_params) . '"> ';
+ $new_table_string .= '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'b_props.png" alt="' . __('Structure') . '" title="' . __('Structure') . '" />';
+ $new_table_string .= '</a> </td>' . "\n";
+
+ $new_table_string .= '<td> <img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'bd_select.png" alt="' . __('Search') . '" title="' . __('Search') . '" /> </td>' . "\n";
+
+ $new_table_string .= '<td> <a href="tbl_change.php' . PMA_generate_common_url($tbl_url_params) . '"> ';
+ $new_table_string .= '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'b_insrow.png" alt="' . __('Insert') . '" title="' . __('Insert') . '" />';
+ $new_table_string .= '</a> </td>' . "\n";
+
+ $new_table_string .= '<td> <img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'bd_empty.png" alt="' . __('Empty') . '" title="' . __('Empty') . '" /> </td>' . "\n";
+
+ $new_table_string .= '<td> <a class="drop_table_anchor" href="sql.php' . PMA_generate_common_url($tbl_url_params) . '&amp;sql_query=';
+ $new_table_string .= urlencode('DROP TABLE ' . PMA_backquote($table));
+ $new_table_string .= '">';
+ $new_table_string .= '<img class="icon" width="16" height="16" src="' .$pmaThemeImage . 'b_drop.png" alt="' . __('Drop') . '" title="' . __('Drop') . '" />';
+ $new_table_string .= '</a> </td>' . "\n";
+
+ $new_table_string .= '<td class="value">0</td>' . "\n"; //In a newly created table, number of rows has to be zero.
+
+ $new_table_string .= '<td nowrap="nowrap">' . $_REQUEST['tbl_type'] . '</td>' . "\n";
+
+ $new_table_string .= '<td> <dfn title="' . PMA_getCollationDescr($_REQUEST['tbl_collation']) . '">'. $_REQUEST['tbl_collation'] .'</dfn></td>' . "\n";
+
+ if($is_show_stats) {
+ $new_table_string .= '<td class="value"> <a href="tbl_structure.php' . PMA_generate_common_url($tbl_url_params) . '#showusage" > Size </a> </td>' . "\n" ;
+ $new_table_string .= '<td class="value">-</td>' . "\n" ;
+ }
+
+ $new_table_string .= '</tr>' . "\n";
+
+ $extra_data['new_table_string'] = $new_table_string;
+
+ PMA_ajaxResponse($message, $message->isSuccess(), $extra_data);
+ }
$display_query = $sql_query;
$sql_query = '';