diff --git a/libraries/config.default.php b/libraries/config.default.php index d980c228a4..d49d593dc5 100644 --- a/libraries/config.default.php +++ b/libraries/config.default.php @@ -1129,6 +1129,13 @@ $cfg['ShowDbStructureLastCheck'] = false; */ $cfg['HideStructureActions'] = true; +/** + * Show column comments in table structure view (true|false)? + * + * @global boolean $cfg['ShowColumnComments'] + */ +$cfg['ShowColumnComments'] = true; + /******************************************************************************* * In browse mode... diff --git a/libraries/config/messages.inc.php b/libraries/config/messages.inc.php index 9f5b512d59..8023557d4b 100644 --- a/libraries/config/messages.inc.php +++ b/libraries/config/messages.inc.php @@ -114,6 +114,9 @@ $strConfigEnableAutocompleteForTablesAndColumns_name = __( ); $strConfigHideStructureActions_desc = __('Whether the table structure actions should be hidden.'); +$strConfigShowColumnComments_name = __('Show column comments'); +$strConfigShowColumnComments_desc + = __('Whether column comments should be shown in table structure view'); $strConfigHideStructureActions_name = __('Hide table structure actions'); $strConfigDisplayServersList_desc = __('Show server listing as a list instead of a drop down.'); diff --git a/libraries/config/setup.forms.php b/libraries/config/setup.forms.php index e337ab1491..72b5591e1f 100644 --- a/libraries/config/setup.forms.php +++ b/libraries/config/setup.forms.php @@ -215,7 +215,8 @@ $forms['Main_panel']['DbStructure'] = array( 'ShowDbStructureLastUpdate', 'ShowDbStructureLastCheck'); $forms['Main_panel']['TableStructure'] = array( - 'HideStructureActions'); + 'HideStructureActions', + 'ShowColumnComments'); $forms['Main_panel']['Browse'] = array( 'TableNavigationLinksMode', 'ShowAll', diff --git a/libraries/config/user_preferences.forms.php b/libraries/config/user_preferences.forms.php index 07f3072052..e403da654d 100644 --- a/libraries/config/user_preferences.forms.php +++ b/libraries/config/user_preferences.forms.php @@ -119,7 +119,8 @@ $forms['Main_panel']['DbStructure'] = array( 'ShowDbStructureLastUpdate', 'ShowDbStructureLastCheck'); $forms['Main_panel']['TableStructure'] = array( - 'HideStructureActions'); + 'HideStructureActions', + 'ShowColumnComments'); $forms['Main_panel']['Browse'] = array( 'TableNavigationLinksMode', 'ActionLinksMode', diff --git a/templates/table/structure/display_structure.phtml b/templates/table/structure/display_structure.phtml index 719f2c05dc..7a8c0848ef 100644 --- a/templates/table/structure/display_structure.phtml +++ b/templates/table/structure/display_structure.phtml @@ -66,13 +66,14 @@ $rownum = 0; $odd_row = true; ?> $field_name = htmlspecialchars($row['Field']); $displayed_field_name = $field_name; - + $comments = ''; //For column comments // underline commented fields and display a hover-title (CSS only) if (isset($comments_map[$row['Field']])) { $displayed_field_name = '' . $field_name . ''; + $comments = htmlspecialchars($comments_map[$row['Field']]); } if ($primary && $primary->hasColumn($field_name)) { @@ -103,7 +104,8 @@ $rownum = 0; $odd_row = true; ?> 'titles' => $titles, 'table' => $table, 'tbl_storage_engine' => $tbl_storage_engine, - 'field_charset' => $field_charset + 'field_charset' => $field_charset, + 'comments' => $comments ) ); ?> diff --git a/templates/table/structure/display_table_stats.phtml b/templates/table/structure/display_table_stats.phtml index b93111b668..bbde9635b4 100644 --- a/templates/table/structure/display_table_stats.phtml +++ b/templates/table/structure/display_table_stats.phtml @@ -2,6 +2,7 @@
+

diff --git a/templates/table/structure/table_structure_header.phtml b/templates/table/structure/table_structure_header.phtml index 372319839b..455a03e01e 100644 --- a/templates/table/structure/table_structure_header.phtml +++ b/templates/table/structure/table_structure_header.phtml @@ -10,6 +10,9 @@ + + + diff --git a/templates/table/structure/table_structure_row.phtml b/templates/table/structure/table_structure_row.phtml index 4f1cba3ad3..40d368498d 100644 --- a/templates/table/structure/table_structure_row.phtml +++ b/templates/table/structure/table_structure_row.phtml @@ -33,6 +33,11 @@ + + + + +