diff --git a/tbl_printview.php b/tbl_printview.php index f6473d2018..78bb961015 100644 --- a/tbl_printview.php +++ b/tbl_printview.php @@ -143,8 +143,8 @@ foreach ($the_tables as $key => $table) { echo ''; foreach ($columns as $row) { $extracted_columnspec = PMA_Util::extractColumnSpec($row['Type']); - $type = $extracted_columnspec['print_type']; - $attribute = $extracted_columnspec['attribute']; + $type = $extracted_columnspec['print_type']; + $attribute = $extracted_columnspec['attribute']; if (! isset($row['Default'])) { if ($row['Null'] != '' && $row['Null'] != 'NO') { @@ -164,7 +164,7 @@ foreach ($the_tables as $key => $table) { * but based on SHOW CREATE TABLE because information_schema * cannot be trusted in this case (MySQL bug) */ - if (!empty($analyzed_sql[0]['create_table_fields'][$field_name]['type']) + if (! empty($analyzed_sql[0]['create_table_fields'][$field_name]['type']) && $analyzed_sql[0]['create_table_fields'][$field_name]['type'] == 'TIMESTAMP' && $analyzed_sql[0]['create_table_fields'][$field_name]['timestamp_not_null'] ) { diff --git a/tbl_relation.php b/tbl_relation.php index 477c30180a..1256fda790 100644 --- a/tbl_relation.php +++ b/tbl_relation.php @@ -69,8 +69,9 @@ $options_array = array( * * @access public */ -function PMA_generate_dropdown($dropdown_question, $select_name, $choices, $selected_value) -{ +function PMA_generate_dropdown( + $dropdown_question, $select_name, $choices, $selected_value +) { echo htmlspecialchars($dropdown_question) . '  '; echo ' - - '; + $odd_row = ! $odd_row; + echo ''; + echo '' . $myfield_html . ''; + echo ''; + echo ''; + if ($cfgRelation['relwork']) { - ?> - '; // PMA internal relations if (isset($existrel[$myfield])) { $foreign_field = $existrel[$myfield]['foreign_db'] . '.' @@ -460,8 +462,7 @@ if (count($columns) > 0) { } $seen_key = false; foreach ($selectboxall as $value) { - echo ' ' - . ''. "\n"; + echo ''. "\n"; } - ?> - - - '; + echo ''; } // end if (internal relations) if (PMA_Util::isForeignKeySupported($tbl_storage_engine)) { echo ''; if (!empty($save_row[$i]['Key'])) { - ?> - - '; if (isset($existrel_foreign[$myfield])) { // need to PMA_Util::backquote to support a dot character inside // an element - $foreign_field = PMA_Util::backquote($existrel_foreign[$myfield]['foreign_db']) . '.' - . PMA_Util::backquote($existrel_foreign[$myfield]['foreign_table']) . '.' - . PMA_Util::backquote($existrel_foreign[$myfield]['foreign_field']); + $foreign_field = PMA_Util::backquote($existrel_foreign[$myfield]['foreign_db']) . '.' + . PMA_Util::backquote($existrel_foreign[$myfield]['foreign_table']) . '.' + . PMA_Util::backquote($existrel_foreign[$myfield]['foreign_field']); } else { $foreign_field = false; } $found_foreign_field = false; foreach ($selectboxall_foreign as $value) { - echo ' ' - . '' . "\n"; } + echo ''; + echo ''; - ?> - - - - '; // For ON DELETE and ON UPDATE, the default action // is RESTRICT as per MySQL doc; however, a SHOW CREATE TABLE // won't display the clause if it's set as RESTRICT. + $on_delete = isset($existrel_foreign[$myfield]['on_delete']) + ? $existrel_foreign[$myfield]['on_delete'] : 'RESTRICT'; PMA_generate_dropdown( 'ON DELETE', 'on_delete[' . $myfield_md5 . ']', $options_array, - isset($existrel_foreign[$myfield]['on_delete']) ? $existrel_foreign[$myfield]['on_delete']: 'RESTRICT' + $on_delete ); + echo '' . "\n"; - echo '' . "\n" - .'' . "\n"; - + echo '' . "\n"; + $on_update = isset($existrel_foreign[$myfield]['on_update']) + ? $existrel_foreign[$myfield]['on_update'] : 'RESTRICT'; PMA_generate_dropdown( 'ON UPDATE', 'on_update[' . $myfield_md5 . ']', $options_array, - isset($existrel_foreign[$myfield]['on_update']) ? $existrel_foreign[$myfield]['on_update']: 'RESTRICT' + $on_update ); echo '' . "\n"; } else { echo __('No index defined!'); } // end if (a key exists) - echo ' '; + echo ''; } // end if (InnoDB) - ?> - - '; } // end for unset( $myfield, $myfield_md5, $myfield_html); - - echo ' ' . "\n"; + echo '' . "\n"; echo '' . "\n"; if ($cfgRelation['displaywork']) { // Get "display_field" infos $disp = PMA_getDisplayField($db, $table); - ?> -
- - '; + echo ''; + foreach ($save_row AS $row) { - echo ' '. "\n"; } // end while - ?> - -
- '; + echo ''; } // end if (displayworks) - ?> -
- -
- - '; + echo ''; + echo ''; + echo ''; } // end if (we have columns in this table) ?>