diff --git a/ChangeLog b/ChangeLog index 0875eaf72..0059377f8 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,11 @@ phpMyAdmin - Changelog $Id$ $Source$ +2005-01-12 Alexander M. Turek + * tbl_properties_table_info.inc.php: Basic view detection. + * tbl_properties_structure.php: Disabled table-specific interface elements + for views. + 2005-01-11 Alexander M. Turek * libraries/relation.lib.php: - Removed redundant code; diff --git a/tbl_properties_structure.php b/tbl_properties_structure.php index f6dcb26bb..7a0947609 100644 --- a/tbl_properties_structure.php +++ b/tbl_properties_structure.php @@ -95,7 +95,7 @@ $i = 0; - + ' . "\n"; ?> = 40100 ? ' ' . "\n" : ''; ?> @@ -103,7 +103,7 @@ $i = 0; - +' . $strAction . '' . "\n"; ?> > + + = 40100 ? ' ' . "\n" : '' ?> @@ -312,6 +318,9 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) { + +if (!$tbl_is_view) { + + $checkall_url = 'tbl_properties_structure.php?' . PMA_generate_common_url($db,$table); + ?>
    ' . $strCollation . '
/> bgcolor="" nowrap="nowrap">   bgcolor=""> ' . (empty($field_charset) ? ' ' : '' . $field_charset . '') . ' bgcolor="">  bgcolor="" nowrap="nowrap">  bgcolor="" nowrap="nowrap">  @@ -393,7 +402,8 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
@@ -422,43 +434,46 @@ $checkall_url = 'tbl_properties_structure.php?' . PMA_generate_common_url($db,$t 1) { - PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_drop', $strDrop, 'b_drop.png'); - } - PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_primary', $strPrimary, 'b_primary.png'); - PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_index', $strIndex, 'b_index.png'); - PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_unique', $strUnique, 'b_unique.png'); - if ((!empty($tbl_type) && $tbl_type == 'MYISAM')) { - PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_fulltext', $strIdxFulltext, 'b_ftext.png'); - } -} else { - echo '' . "\n"; - // Drop button if there is at least two fields - if ($fields_cnt > 1) { + if ($cfg['PropertiesIconic']) { + PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_change', $strChange, 'b_edit.png'); + // Drop button if there is at least two fields + if ($fields_cnt > 1) { + PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_drop', $strDrop, 'b_drop.png'); + } + PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_primary', $strPrimary, 'b_primary.png'); + PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_index', $strIndex, 'b_index.png'); + PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_unique', $strUnique, 'b_unique.png'); + if ((!empty($tbl_type) && $tbl_type == 'MYISAM')) { + PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_fulltext', $strIdxFulltext, 'b_ftext.png'); + } + } else { + echo '' . "\n"; + // Drop button if there is at least two fields + if ($fields_cnt > 1) { + echo ' ' . $strOr . ' ' . "\n" + . '' . "\n"; + } echo ' ' . $strOr . ' ' . "\n" - . '' . "\n"; - } - echo ' ' . $strOr . ' ' . "\n" - . '' . "\n"; - echo ' ' . $strOr . ' ' . "\n" - . '' . "\n"; - echo ' ' . $strOr . ' ' . "\n" - . '' . "\n"; - if ((!empty($tbl_type) && $tbl_type == 'MYISAM')) { + . '' . "\n"; echo ' ' . $strOr . ' ' . "\n" - . '' . "\n"; + . '' . "\n"; + echo ' ' . $strOr . ' ' . "\n" + . '' . "\n"; + if ((!empty($tbl_type) && $tbl_type == 'MYISAM')) { + echo ' ' . $strOr . ' ' . "\n" + . '' . "\n"; + } } -} -?> + ?>
+ @@ -466,10 +481,11 @@ if ($cfg['PropertiesIconic']) { +if (!$tbl_is_view) { + /** + * Work on the table + */ + ?>     - + if ($cfg['Server']['relation'] || $tbl_type=="INNODB") { + ?>     - + - 20) { echo "\n\n"; -/** - * Displays indexes - */ -?> +if (!$tbl_is_view) { + /** + * Displays indexes + */ + ?> - to get valid -// statistics whatever is the table type -if ($cfg['ShowStats']) { - $nonisam = FALSE; - $is_innodb = (isset($showtable['Type']) && $showtable['Type'] == 'InnoDB'); - if (isset($showtable['Type']) && !preg_match('@ISAM|HEAP@i', $showtable['Type'])) { - $nonisam = TRUE; - } - if ($nonisam == FALSE || $is_innodb) { - // Gets some sizes - $mergetable = FALSE; - if (isset($showtable['Type']) && $showtable['Type'] == 'MRG_MyISAM') { - $mergetable = TRUE; - } - list($data_size, $data_unit) = PMA_formatByteDown($showtable['Data_length']); - if ($mergetable == FALSE) { - list($index_size, $index_unit) = PMA_formatByteDown($showtable['Index_length']); - } - if (isset($showtable['Data_free']) && $showtable['Data_free'] > 0) { - list($free_size, $free_unit) = PMA_formatByteDown($showtable['Data_free']); - list($effect_size, $effect_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length'] - $showtable['Data_free']); - } else { - list($effect_size, $effect_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length']); - } - list($tot_size, $tot_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length']); - if ($table_info_num_rows > 0) { - list($avg_size, $avg_unit) = PMA_formatByteDown(($showtable['Data_length'] + $showtable['Index_length']) / $showtable['Rows'], 6, 1); + to get valid + // statistics whatever is the table type + if ($cfg['ShowStats']) { + $nonisam = FALSE; + $is_innodb = (isset($showtable['Type']) && $showtable['Type'] == 'InnoDB'); + if (isset($showtable['Type']) && !preg_match('@ISAM|HEAP@i', $showtable['Type'])) { + $nonisam = TRUE; } + if ($nonisam == FALSE || $is_innodb) { + // Gets some sizes + $mergetable = FALSE; + if (isset($showtable['Type']) && $showtable['Type'] == 'MRG_MyISAM') { + $mergetable = TRUE; + } + list($data_size, $data_unit) = PMA_formatByteDown($showtable['Data_length']); + if ($mergetable == FALSE) { + list($index_size, $index_unit) = PMA_formatByteDown($showtable['Index_length']); + } + if (isset($showtable['Data_free']) && $showtable['Data_free'] > 0) { + list($free_size, $free_unit) = PMA_formatByteDown($showtable['Data_free']); + list($effect_size, $effect_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length'] - $showtable['Data_free']); + } else { + list($effect_size, $effect_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length']); + } + list($tot_size, $tot_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length']); + if ($table_info_num_rows > 0) { + list($avg_size, $avg_unit) = PMA_formatByteDown(($showtable['Data_length'] + $showtable['Index_length']) / $showtable['Rows'], 6, 1); + } - // Displays them - ?> + // Displays them + ?> @@ -612,20 +631,20 @@ if ($cfg['ShowStats']) { - + - + @@ -636,22 +655,22 @@ if ($cfg['ShowStats']) { - + - + - +
- +  
@@ -678,99 +697,99 @@ if ($cfg['ShowStats']) { - + - + - = 40100) { - $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']); - ?> + = 40100 && !empty($tbl_collation)) { + $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']); + ?> - ' . $tbl_collation . ''; - ?> + ' . $tbl_collation . ''; + ?> - + - 0) { - $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']); - echo "\n"; - ?> + 0) { + $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']); + echo "\n"; + ?>  ø - 0 && $mergetable == FALSE) { - $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']); - echo "\n"; - ?> + 0 && $mergetable == FALSE) { + $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']); + echo "\n"; + ?>  ø - +  Autoindex - + + if (isset($showtable['Create_time'])) { + $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']); + echo "\n"; + ?> align="right" bgcolor="" nowrap="nowrap"> @@ -778,13 +797,13 @@ if ($cfg['ShowStats']) { + + if (isset($showtable['Update_time'])) { + $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']); + echo "\n"; + ?> align="right" bgcolor="" nowrap="nowrap"> @@ -792,35 +811,37 @@ if ($cfg['ShowStats']) { + + if (isset($showtable['Check_time'])) { + $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']); + echo "\n"; + ?> align="right" bgcolor="" nowrap="nowrap"> - + - + // END - Calc Table Space + echo "\n"; + ?>
-= 50000 && !isset($showtable['Type']) && isset($showtable['Comment']) && $showtable['Comment'] == 'view') { + $tbl_is_view = TRUE; + $tbl_type = $strView; + $show_comment = NULL; +} else { + $tbl_is_view = FALSE; + $tbl_type = isset($showtable['Type']) ? strtoupper($showtable['Type']) : ''; + $show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : ''); +} +$tbl_collation = empty($showtable['Collation']) ? '' : $showtable['Collation']; $table_info_num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0); -$show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : ''); $auto_increment = (isset($showtable['Auto_increment']) ? $showtable['Auto_increment'] : ''); $tmp = isset($showtable['Create_options']) ? explode(' ', $showtable['Create_options']) : array(); @@ -34,6 +41,6 @@ for ($i = 0; $i < $tmp_cnt; $i++) { $$tmp1[0] = $tmp1[1]; } } // end for -unset($tmp1, $tmp); PMA_DBI_free_result($table_info_result); +unset($tmp1, $tmp, $table_info_result); ?>