From 6d5746b7bb8b0b320ece9d83366f49e447cf305f Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Thu, 8 Dec 2005 09:25:22 +0000 Subject: [PATCH] moved table related output after possible table changes (bug #1375752?, partly discussion of #1373804) --- libraries/tbl_properties_links.inc.php | 28 +++++++++++++++++++++++--- tbl_properties_common.php | 20 ------------------ 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/libraries/tbl_properties_links.inc.php b/libraries/tbl_properties_links.inc.php index d504892c0..dd31ea383 100644 --- a/libraries/tbl_properties_links.inc.php +++ b/libraries/tbl_properties_links.inc.php @@ -13,6 +13,28 @@ PMA_checkParameters(array('db', 'table')); */ require_once('./libraries/bookmark.lib.php'); + +/** + * Set parameters for links + */ +$url_query = PMA_generate_common_url($db, $table); +$url_params = array( + 'db' => $db, + 'table' => $table, +); + +/** + * Defines the urls to return to in case of error in a sql statement + */ +$err_url_0 = $cfg['DefaultTabDatabase'] . PMA_generate_common_url( array( 'db' => $db, ) ); +$err_url = $cfg['DefaultTabTable'] . PMA_generate_common_url( $url_params ); + +/** + * Displays headers + */ +$js_to_run = 'functions.js'; +require_once('./libraries/header.inc.php'); + /** * Displays links */ @@ -42,7 +64,7 @@ $tabs['export']['icon'] = 'b_tblexport.png'; $tabs['export']['link'] = 'tbl_properties_export.php'; $tabs['export']['args']['single_table'] = 'true'; $tabs['export']['text'] = $strExport; - + /** * Don't display , "Import", "Operations" and "Empty" * for views and information_schema @@ -51,11 +73,11 @@ if ( ! $tbl_is_view && ! (isset($db_is_information_schema) && $db_is_information $tabs['import']['icon'] = 'b_tblimport.png'; $tabs['import']['link'] = 'tbl_import.php'; $tabs['import']['text'] = $strImport; - + $tabs['operation']['icon'] = 'b_tblops.png'; $tabs['operation']['link'] = 'tbl_properties_operations.php'; $tabs['operation']['text'] = $strOperations; - + if ($table_info_num_rows > 0) { $ln8_stt = (PMA_MYSQL_INT_VERSION >= 40000) ? 'TRUNCATE TABLE ' diff --git a/tbl_properties_common.php b/tbl_properties_common.php index 87329fade..bad3f00a4 100644 --- a/tbl_properties_common.php +++ b/tbl_properties_common.php @@ -18,29 +18,9 @@ if ( PMA_MYSQL_INT_VERSION >= 50002 && $db === 'information_schema' ) { $db_is_information_schema = false; } -/** - * Defines the urls to return to in case of error in a sql statement - */ -$err_url_0 = $cfg['DefaultTabDatabase'] . '?' . PMA_generate_common_url($db); -$err_url = $cfg['DefaultTabTable'] . '?' . PMA_generate_common_url($db, $table); - - /** * Ensures the database and the table exist (else move to the "parent" script) */ require_once('./libraries/db_table_exists.lib.php'); - -/** - * Displays headers - */ -$js_to_run = 'functions.js'; -require_once('./libraries/header.inc.php'); - - -/** - * Set parameters for links - */ -$url_query = PMA_generate_common_url($db, $table); - ?>