From 41f8199ae9f40d81fc2904a9e74c6b32831969ea Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Thu, 27 Oct 2005 08:14:08 +0000 Subject: [PATCH] - added browser icon for each field (count unique values) - removed styling - make use of global row highlighting/marking - display 'print table' and row stats for views - no actions for info_schema tables --- ChangeLog | 6 + tbl_properties_structure.php | 781 +++++++++++++++++------------------ 2 files changed, 388 insertions(+), 399 deletions(-) diff --git a/ChangeLog b/ChangeLog index 67851d6fe..e33d177c9 100755 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,12 @@ $Source$ - preserve selected db - make use of PMA_DBI_select_db() - documentation + * tbl_properties_structure.php: + - added browser icon for each field (count unique values) + - removed styling + - make use of global row highlighting/marking + - display 'print table' and row stats for views + - no actions for info_schema tables 2005-10-26 Marc Delisle * lang/french* updates diff --git a/tbl_properties_structure.php b/tbl_properties_structure.php index 70267ec43..3166bcc74 100644 --- a/tbl_properties_structure.php +++ b/tbl_properties_structure.php @@ -94,35 +94,102 @@ $show_create_table = PMA_DBI_fetch_value( 0, 1 ); $analyzed_sql = PMA_SQP_analyze( PMA_SQP_parse( $show_create_table ) ); +/** + * prepare table infos + */ +// action titles (image or string) +$titles = array(); +if ( $cfg['PropertiesIconic'] == true ) { + if ( $cfg['PropertiesIconic'] === 'both' ) { + $iconic_spacer = '
'; + } else { + $iconic_spacer = ''; + } + + // images replaced 2004-05-08 by mkkeck + $titles['Change'] = $iconic_spacer . '' . $strChange . ''; + $titles['Drop'] = $iconic_spacer . '' . $strDrop . ''; + $titles['NoDrop'] = $iconic_spacer . '' . $strDrop . ''; + $titles['Primary'] = $iconic_spacer . '' . $strPrimary . ''; + $titles['Index'] = $iconic_spacer . '' . $strIndex . ''; + $titles['Unique'] = $iconic_spacer . '' . $strUnique . ''; + $titles['IdxFulltext'] = $iconic_spacer . '' . $strIdxFulltext . ''; + $titles['NoPrimary'] = $iconic_spacer . '' . $strPrimary . ''; + $titles['NoIndex'] = $iconic_spacer . '' . $strIndex . ''; + $titles['NoUnique'] = $iconic_spacer . '' . $strUnique . ''; + $titles['NoIdxFulltext'] = $iconic_spacer . '' . $strIdxFulltext . ''; + $titles['Browse'] = $iconic_spacer . '' . $strBrowse . ''; + + if ( $cfg['PropertiesIconic'] === 'both' ) { + $titles['Change'] .= $strChange . '
'; + $titles['Drop'] .= $strDrop . ''; + $titles['NoDrop'] .= $strDrop . ''; + $titles['Primary'] .= $strPrimary . ''; + $titles['Index'] .= $strIndex . ''; + $titles['Unique'] .= $strUnique . ''; + $titles['IdxFulltext' ] .= $strIdxFulltext . ''; + $titles['NoPrimary'] .= $strPrimary . ''; + $titles['NoIndex'] .= $strIndex . ''; + $titles['NoUnique'] .= $strUnique . ''; + $titles['NoIdxFulltext'] .= $strIdxFulltext . ''; + $titles['Browse'] .= $strBrowse . ''; + } +} else { + $titles['Change'] = $strChange; + $titles['Drop'] = $strDrop; + $titles['NoDrop'] = $strDrop; + $titles['Primary'] = $strPrimary; + $titles['Index'] = $strIndex; + $titles['Unique'] = $strUnique; + $titles['IdxFulltext'] = $strIdxFulltext; + $titles['NoPrimary'] = $strPrimary; + $titles['NoIndex'] = $strIndex; + $titles['NoUnique'] = $strUnique; + $titles['NoIdxFulltext'] = $strIdxFulltext; + $titles['Browse'] = $strBrowse; +} + +if ( PMA_MYSQL_INT_VERSION >= 50002 && $db === 'information_schema' ) { + $db_is_information_schema = true; +} else { + $db_is_information_schema = false; +} + /** * Displays the table structure ('show table' works correct since 3.23.03) */ - +/* TABLE INFORMATION */ +// table header $i = 0; - ?> - - -
- +
- ' . "\n"; ?> - + + = 40100 ? ' ' . "\n" : ''; ?> -' . $strAction . '' . "\n"; ?> + + + + +' . $field_name . ''; } echo "\n"; - - $titles = array(); - if ($cfg['PropertiesIconic'] == true) { - // We need to copy the value or else the == 'both' check will always return true - $propicon = (string)$cfg['PropertiesIconic']; - - if ($propicon == 'both') { - $iconic_spacer = '
'; - } else { - $iconic_spacer = ''; - } - - // images replaced 2004-05-08 by mkkeck - $titles['Change'] = $iconic_spacer . '' . $strChange . ''; - $titles['Drop'] = $iconic_spacer . '' . $strDrop . ''; - $titles['NoDrop'] = $iconic_spacer . '' . $strDrop . ''; - $titles['Primary'] = $iconic_spacer . '' . $strPrimary . ''; - $titles['Index'] = $iconic_spacer . '' . $strIndex . ''; - $titles['Unique'] = $iconic_spacer . '' . $strUnique . ''; - $titles['IdxFulltext'] = $iconic_spacer . '' . $strIdxFulltext . ''; - $titles['NoPrimary'] = $iconic_spacer . '' . $strPrimary . ''; - $titles['NoIndex'] = $iconic_spacer . '' . $strIndex . ''; - $titles['NoUnique'] = $iconic_spacer . '' . $strUnique . ''; - $titles['NoIdxFulltext'] = $iconic_spacer . '' . $strIdxFulltext . ''; - - if ($propicon == 'both') { - $titles['Change'] .= ' ' . $strChange . '
'; - $titles['Drop'] .= ' ' . $strDrop . ''; - $titles['NoDrop'] .= ' ' . $strDrop . ''; - $titles['Primary'] .= ' ' . $strPrimary . ''; - $titles['Index'] .= ' ' . $strIndex . ''; - $titles['Unique'] .= ' ' . $strUnique . ''; - $titles['IdxFulltext' ] .= ' ' . $strIdxFulltext . ''; - $titles['NoPrimary'] .= ' ' . $strPrimary . ''; - $titles['NoIndex'] .= ' ' . $strIndex . ''; - $titles['NoUnique'] .= ' ' . $strUnique . ''; - $titles['NoIdxFulltext'] .= ' ' . $strIdxFulltext . ''; - } - } else { - $titles['Change'] = $strChange; - $titles['Drop'] = $strDrop; - $titles['NoDrop'] = $strDrop; - $titles['Primary'] = $strPrimary; - $titles['Index'] = $strIndex; - $titles['Unique'] = $strUnique; - $titles['IdxFulltext'] = $strIdxFulltext; - $titles['NoPrimary'] = $strPrimary; - $titles['NoIndex'] = $strIndex; - $titles['NoUnique'] = $strUnique; - $titles['NoIdxFulltext'] = $strIdxFulltext; - } - ?> -> - - + - - - -= 40100 ? ' ' . "\n" : '' ?> - - - - - - + > += 40100 ? ' ' . "\n" : '' ?> + + + + + + + - - - - @@ -431,13 +428,13 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) { } else { echo "\n"; ?> - ' . "\n" .'
   ' . $strCollation . '
- /> +
+ /> bgcolor="" nowrap="nowrap">   bgcolor="">' . (empty($field_charset) ? ' ' : '' . $field_charset . '') . ' bgcolor="" nowrap="nowrap" style="font-size: "> bgcolor="">  bgcolor="" nowrap="nowrap">  bgcolor="" nowrap="nowrap">  + ' . (empty($field_charset) ? '' : '' . $field_charset . '') . ' + + + + 1) { @@ -375,7 +372,7 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) { echo "\n"; ?> + + + - + +
' . "\n"; -if (!$tbl_is_view) { +$checkall_url = 'tbl_properties_structure.php?' . PMA_generate_common_url($db,$table); +?> - $checkall_url = 'tbl_properties_structure.php?' . PMA_generate_common_url($db,$table); - ?> +<?php echo $strWithChecked; ?> + + +/ + + - <?php echo $strWithChecked; ?> - - -  /  - - -     -    - +' . "\n"; +} +if ( ! $tbl_is_view && ! $db_is_information_schema ) { if ($cfg['PropertiesIconic']) { - PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_browse', $strBrowse, 'b_browse.png'); 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) { @@ -476,96 +479,86 @@ if (!$tbl_is_view) { 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" + echo '' . $strOr . '' . "\n" . '' . "\n"; } - echo ' ' . $strOr . ' ' . "\n" + echo '' . $strOr . '' . "\n" . '' . "\n"; - echo ' ' . $strOr . ' ' . "\n" + echo '' . $strOr . '' . "\n" . '' . "\n"; - echo ' ' . $strOr . ' ' . "\n" + echo '' . $strOr . '' . "\n" . '' . "\n"; if ((!empty($tbl_type) && $tbl_type == 'MYISAM')) { - echo ' ' . $strOr . ' ' . "\n" + echo '' . $strOr . '' . "\n" . '' . "\n"; } } } ?>
-
+ +'; +} +echo $strPrintView; +?> - - -'; - } - echo $strPrintView; - ?>    - - - '; - } - echo $strRelationView; -?>    + if ($cfg['PropertiesIconic']) { + echo '' . $strRelationView . ''; + } + echo $strRelationView; + ?> - '; + echo '' . $strStructPropose . ''; } echo $strStructPropose; -?>
- + ?>
'; - } - echo sprintf($strAddFields, ''); + echo PMA_generate_common_hidden_inputs($db, $table); + if ($cfg['PropertiesIconic']) { + echo '' . $strAddNewField . ''; + } + echo sprintf($strAddFields, ''); ?> - - -