diff --git a/ChangeLog b/ChangeLog index 52668ca0bb..ab14f7aeec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -37,6 +37,7 @@ phpMyAdmin - ChangeLog + rfe #1192 ON DUPLICATE KEY UPDATE for loading CSV - bug Cannot execute command from console (multi-server installation) + rfe #1208 linking from information_schema ++ rfe #1235 Relation view: move to main "Structure" page 4.3.10.0 (not yet released) - bug Undefined index navwork diff --git a/js/indexes.js b/js/indexes.js index 6a7e8e7d85..009b940d13 100644 --- a/js/indexes.js +++ b/js/indexes.js @@ -575,7 +575,7 @@ AJAX.registerOnload('indexes.js', function () { if (data.sql_query) { $('
') .html(data.sql_query) - .prependTo('#page_content'); + .prependTo('#structure_content'); PMA_highlightSQL($('#page_content')); } PMA_commonActions.refreshMain(false, function () { diff --git a/js/tbl_structure.js b/js/tbl_structure.js index 7b4c1dd49d..73ba55e7b1 100644 --- a/js/tbl_structure.js +++ b/js/tbl_structure.js @@ -129,7 +129,6 @@ AJAX.registerOnload('tbl_structure.js', function () { $("#page_content") .empty() .append(data.message) - .append(data.sql_query) .show(); PMA_highlightSQL($('#page_content')); $(".result_query .notice").remove(); @@ -183,7 +182,7 @@ AJAX.registerOnload('tbl_structure.js', function () { if (data.sql_query) { $('') .html(data.sql_query) - .prependTo('#page_content'); + .prependTo('#structure_content'); PMA_highlightSQL($('#page_content')); } toggleRowColors($curr_row.next()); diff --git a/libraries/structure.lib.php b/libraries/structure.lib.php index d6666d457f..adf8b3569e 100644 --- a/libraries/structure.lib.php +++ b/libraries/structure.lib.php @@ -1625,18 +1625,6 @@ function PMA_getHtmlForOptionalActionLinks($url_query, $tbl_is_view, . ''; if (! $tbl_is_view && ! $db_is_system_schema) { - // if internal relations are available, or foreign keys are supported - // ($tbl_storage_engine comes from libraries/tbl_info.inc.php - - if ($cfgRelation['relwork'] - || PMA_Util::isForeignKeySupported($tbl_storage_engine) - ) { - $html_output .= '' - . PMA_Util::getIcon( - 'b_relations.png', __('Relation view'), true - ) - . ''; - } if (!PMA_DRIZZLE) { $html_output .= ''; + foreach (PMA_getStructureSubTabs() as $tab) { + $html_output .= PMA_Util::getHtmlTab($tab, $url_params); + } + $html_output .= ''; + $html_output .= ''; + } + return $html_output; +} + +/** + * Returns an array with necessary configurations to create + * sub-tabs in the Structure page at table level + * + * @return array Array containing configuration (icon, text, link, id) + * of sub-tabs + */ +function PMA_getStructureSubTabs() +{ + $subtabs = array(); + + $subtabs['structure']['icon'] = 'b_props'; + $subtabs['structure']['link'] = 'tbl_structure.php'; + $subtabs['structure']['text'] = __('Table Structure'); + $subtabs['structure']['id'] = 'table_strucuture_id'; + + $subtabs['relation']['icon'] = 'b_relations'; + $subtabs['relation']['link'] = 'tbl_relation.php'; + $subtabs['relation']['text'] = __('Relation View'); + $subtabs['relation']['id'] = 'table_relation_id'; + + return $subtabs; +} ?> diff --git a/libraries/tbl_indexes.lib.php b/libraries/tbl_indexes.lib.php index b7db2d99af..5724b10617 100644 --- a/libraries/tbl_indexes.lib.php +++ b/libraries/tbl_indexes.lib.php @@ -64,12 +64,10 @@ function PMA_handleCreateOrEditIndex($db, $table, $index) if ($GLOBALS['is_ajax_request'] == true) { $response = PMA_Response::getInstance(); - $response->addJSON('message', $message); - $response->addJSON('index_table', PMA_Index::getView($table, $db)); $response->addJSON( - 'sql_query', - PMA_Util::getMessage(null, $sql_query) + 'message', PMA_Util::getMessage($message, $sql_query, 'success') ); + $response->addJSON('index_table', PMA_Index::getView($table, $db)); } else { include 'tbl_structure.php'; } diff --git a/libraries/tbl_relation.lib.php b/libraries/tbl_relation.lib.php index a4dd46b6c1..a666b72f92 100644 --- a/libraries/tbl_relation.lib.php +++ b/libraries/tbl_relation.lib.php @@ -182,8 +182,6 @@ function PMA_getHtmlForCommonForm($db, $table, $columns, $cfgRelation, $tbl_storage_engine, $existrel, $existrel_foreign, $options_array ) { $html_output = PMA_getHtmlForCommonFormHeader($db, $table); - $html_output .= ''; - if ($cfgRelation['displaywork']) { $html_output .= PMA_getHtmlForDisplayFieldInfos( $db, $table, @@ -823,7 +819,7 @@ function PMA_handleUpdateForDisplayField($disp, $display_field, $db, $table, PMA_queryAsControlUser($upd_query); $html_output = PMA_Util::getMessage( __('Display column was successfully updated.'), - null, 'success' + '', 'success' ); } return $html_output; @@ -907,7 +903,7 @@ function PMA_handleUpdatesForInternalRelations($destination_db, if ($updated) { $html_output = PMA_Util::getMessage( __('Internal relations were successfully updated.'), - null, 'success' + '', 'success' ); } return $html_output; diff --git a/tbl_addfield.php b/tbl_addfield.php index 209f07bf2e..0c7aa1da2f 100644 --- a/tbl_addfield.php +++ b/tbl_addfield.php @@ -92,10 +92,8 @@ if (isset($_REQUEST['do_save_data'])) { __('Table %1$s has been altered successfully.') ); $message->addParam($table); - $response->addJSON('message', $message); $response->addJSON( - 'sql_query', - PMA_Util::getMessage(null, $sql_query) + 'message', PMA_Util::getMessage($message, $sql_query, 'success') ); exit; } else { diff --git a/tbl_relation.php b/tbl_relation.php index 44fa1b68e5..974105d153 100644 --- a/tbl_relation.php +++ b/tbl_relation.php @@ -20,6 +20,7 @@ require_once 'libraries/common.inc.php'; require_once 'libraries/index.lib.php'; require_once 'libraries/tbl_relation.lib.php'; +require_once 'libraries/structure.lib.php'; $response = PMA_Response::getInstance(); @@ -124,6 +125,11 @@ if ($cfgRelation['displaywork']) { } +// display secondary level tabs if necessary +$engine = PMA_Table::sGetStatusInfo($db, $table, 'ENGINE'); +$response->addHTML(PMA_getStructureSecondaryTabs($engine)); +$response->addHTML('