From 4066ed22149da8d6d156a42a5cdedfcdceb8f932 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Thu, 11 Aug 2005 13:56:35 +0000 Subject: [PATCH] patch #1249528, move table comments to header and enable configuration of header --- ChangeLog | 5 + Documentation.html | 6 +- config.inc.php | 5 +- header.inc.php | 96 +++++++++++-------- libraries/config_import.lib.php | 2 +- tbl_properties_links.php | 14 --- tbl_properties_table_info.php | 11 ++- .../darkblue_orange/css/theme_right.css.php | 41 ++++---- themes/original/css/theme_right.css.php | 43 ++++----- 9 files changed, 109 insertions(+), 114 deletions(-) diff --git a/ChangeLog b/ChangeLog index e1c212ce2..49146cab7 100755 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,11 @@ $Source$ 2005-08-11 Marc Delisle * queryframe.php: shorten the path of db subtree items, thanks to Edward Rudd - urkle + * config.inc.php, header.inc.php, tbl_properties_links.php, + themes/*/css/theme_right.css.php, tbl_properties_table_info.php, + Documentation.html, libraries/config_import.lib.php: patch #1249528, + move table comments to header and enable configuration of header for + TRUE/FALSE/'both', thanks to Sebastian Mendel - cybot_tm 2005-08-09 Marc Delisle * read_dump.php: add unique numbers to $strFileCouldNotBeRead to diff --git a/Documentation.html b/Documentation.html index d099f79a5..bbcb2f32e 100755 --- a/Documentation.html +++ b/Documentation.html @@ -1180,9 +1180,9 @@ Defaults to FALSE (drop-down).


-
$cfg['NavigationBarIconic'] boolean
+
$cfg['NavigationBarIconic'] string
- Defines whether navigation bar buttons contain text or symbols only. + Defines whether navigation bar buttons and the right panel top menu contain text or symbols only. A value of TRUE displays icons, FALSE displays text and 'both' displays both icons and text.

@@ -1847,7 +1847,7 @@ Defaults to FALSE (drop-down).
$cfg['MainPageIconic'] boolean
- Uses icons on main page in lists, on right panel top menu and menu tabs. + Uses icons on main page in lists and menu tabs.

diff --git a/config.inc.php b/config.inc.php index 4d5e7669e..660d826de 100644 --- a/config.inc.php +++ b/config.inc.php @@ -256,7 +256,8 @@ $cfg['SuggestDBName'] = TRUE; // suggest a new DB name if possible (fa // In browse mode... $cfg['ShowBlob'] = FALSE; // display blob field contents -$cfg['NavigationBarIconic'] = TRUE; // do not display text inside navigation bar buttons +$cfg['NavigationBarIconic'] = 'both'; // Use icons instead of text for the navigation bar buttons + // and on right panel top menu (server db table) (TRUE|FALSE|'both') $cfg['ShowAll'] = FALSE; // allows to display all the rows $cfg['MaxRows'] = 30; // maximum number of rows to display $cfg['Order'] = 'ASC'; // default for 'ORDER BY' clause (valid @@ -566,7 +567,7 @@ $cfg['SetHttpHostTitle'] = ''; // if ShowHttpHostTitle=true, ple // If not set (or empty), the PMA will get your real Host-Adress. $cfg['ErrorIconic'] = TRUE; // show some icons for warning, error and information messages (true|false)? -$cfg['MainPageIconic'] = TRUE; // show icons in list on main page, on right panel top menu (server db table) and on menu tabs (true|false)? +$cfg['MainPageIconic'] = TRUE; // show icons in list on main page and on menu tabs (true|false)? $cfg['ReplaceHelpImg'] = TRUE; // show help button instead of strDocumentation (true|false)? // theme manager diff --git a/header.inc.php b/header.inc.php index 61fa4a6e8..99c5a32d2 100644 --- a/header.inc.php +++ b/header.inc.php @@ -159,54 +159,68 @@ if (empty($GLOBALS['is_header_sent'])) { */ if (PMA_DISPLAY_HEADING) { - echo '' . "\n" - . ' ' . "\n"; - $header_url_qry = '?' . PMA_generate_common_url(); - $server_info = (!empty($cfg['Server']['verbose']) - ? $cfg['Server']['verbose'] - : $server_info = $cfg['Server']['host'] . (empty($cfg['Server']['port']) - ? '' - : ':' . $cfg['Server']['port'] - ) + $server_info = (!empty($GLOBALS['cfg']['Server']['verbose']) + ? $GLOBALS['cfg']['Server']['verbose'] + : $GLOBALS['cfg']['Server']['host'] . (empty($GLOBALS['cfg']['Server']['port']) + ? '' + : ':' . $GLOBALS['cfg']['Server']['port'] + ) ); - echo ' ' - . '' . "\n\n"; + if ( $GLOBALS['cfg']['NavigationBarIconic'] !== true ) { + $item .= '%4$s: '; + } + $item .= '%3$s' . "\n"; + + echo '
' . "\n"; + printf( $item, + $GLOBALS['cfg']['DefaultTabServer'], + PMA_generate_common_url(), + htmlspecialchars($server_info), + $GLOBALS['strServer'], + 's_host.png' ); + if (!empty($GLOBALS['db'])) { - echo ' ' - . '
' . "\n" . ' ' - . '' . "\n\n"; - + + echo $separator; + printf( $item, + $GLOBALS['cfg']['DefaultTabDatabase'], + PMA_generate_common_url($GLOBALS['db']), + htmlspecialchars($GLOBALS['db']), + $GLOBALS['strDatabase'], + 's_db.png' ); + if (!empty($GLOBALS['table'])) { - if (PMA_MYSQL_INT_VERSION >= 50000) { - require_once('./tbl_properties_table_info.php'); - } else { - $tbl_is_view = FALSE; - } - echo ' ' - . '' . "\n" . ' ' - . '' . "\n\n"; + require_once('./tbl_properties_table_info.php'); + + echo $separator; + printf( $item, + $GLOBALS['cfg']['DefaultTabTable'], + PMA_generate_common_url($GLOBALS['db'], $GLOBALS['table']), + htmlspecialchars($GLOBALS['table']), + (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ? $GLOBALS['strView'] : $GLOBALS['strTable']), + (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ? 'b_views' : 's_tbl') . '.png' ); + + /** + * Displays table comment + * @uses $show_comment from tbl_properties_table_info.php + * @uses $GLOBALS['avoid_show_comment'] from tbl_relation.php + */ + if (!empty($show_comment) && !isset($GLOBALS['avoid_show_comment'])) { + echo '' . "\n" + . '"' . htmlspecialchars($show_comment) . '"' . "\n"; + } // end if } } - echo ' ' . "\n" . '
' . $GLOBALS['strServer'] . ': ' - . ''; - if ($GLOBALS['cfg']['MainPageIconic']) { - echo '' . htmlspecialchars($server_info) . ''; + $item = ''; + if ( $GLOBALS['cfg']['NavigationBarIconic'] ) { + $separator = ' -' . "\n"; + $item .= ' ' . "\n"; + } else { + $separator = ' - ' . "\n"; } - echo htmlspecialchars($server_info) . '' . "\n" - . '
' . $GLOBALS['strDatabase'] . ': ' - . ''; - if ($GLOBALS['cfg']['MainPageIconic']) { - echo '' . htmlspecialchars($GLOBALS['db']) . ''; - } - echo htmlspecialchars($GLOBALS['db']) . '' . "\n" - . '
' . (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ? $GLOBALS['strView'] : $GLOBALS['strTable']) . ': ' - . ''; - if ($GLOBALS['cfg']['MainPageIconic']) { - echo '' . htmlspecialchars($GLOBALS['table']) . ''; - } - echo htmlspecialchars($GLOBALS['table']) . '' . "\n" - . '
'; + echo ''; + } /** * Sets a variable to remember headers have been sent diff --git a/libraries/config_import.lib.php b/libraries/config_import.lib.php index 4beead360..a982abdb4 100644 --- a/libraries/config_import.lib.php +++ b/libraries/config_import.lib.php @@ -423,7 +423,7 @@ if (!isset($cfg['NavigationBarIconic'])) { $cfg['NavigationBarIconic'] = $cfgNavigationBarIconic; unset($cfgNavigationBarIconic); } else { - $cfg['NavigationBarIconic'] = TRUE; + $cfg['NavigationBarIconic'] = 'both'; } } diff --git a/tbl_properties_links.php b/tbl_properties_links.php index 786dd4fd5..0423fa5e7 100644 --- a/tbl_properties_links.php +++ b/tbl_properties_links.php @@ -104,20 +104,6 @@ if (!$cfg['LightTabs']) { echo '
'; } -/** - * Displays table comment - */ -if (!empty($show_comment) && !isset($avoid_show_comment)) { - ?> - -

- -

- 0) { } else { $tbl_is_view = FALSE; $tbl_type = isset($showtable['Type']) ? strtoupper($showtable['Type']) : ''; - $show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : ''); + // a new comment could be coming from tbl_properties_operations.php + // and we want to show it in the header + if (isset($submitcomment) && isset($comment)) { + $show_comment = $comment; + } else { + $show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : ''); + } } $tbl_collation = empty($showtable['Collation']) ? '' : $showtable['Collation']; $table_info_num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0); diff --git a/themes/darkblue_orange/css/theme_right.css.php b/themes/darkblue_orange/css/theme_right.css.php index 7d569cba3..62495ecb4 100644 --- a/themes/darkblue_orange/css/theme_right.css.php +++ b/themes/darkblue_orange/css/theme_right.css.php @@ -387,34 +387,25 @@ div.warnhead { /* Heading for server links*/ -.serverinfo { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 12px; - font-weight: normal; - padding: 0px 0px 10px 0px; - margin: 0px; - white-space: nowrap; - vertical-align: middle; -} - -.serverinfo a:link, .serverinfo a:active, .serverinfo a:visited { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 12px; - font-weight: bolder; -} -.serverinfo a img{ - vertical-align: middle; - margin: 0px 1px 0px 1px; +#serverinfo { + font-weight: bold; + margin-bottom: 0.5em; } -.serverinfo div{ - background-image: url(../themes/darkblue_orange/img/item_ltr.png); - background-repeat: no-repeat; - background-position: 50% 50%; - width: 20px; - height: 16px; +#serverinfo .item { + white-space: nowrap; } - + +#span_table_comment { + font-weight: normal; + font-style: italic; + white-space: nowrap; +} + +#serverinfo img { + margin: 0 0.1em 0 0.1em; +} + hr{ color: #666699; background-color: #6666cc; border: 0; height: 1px; } diff --git a/themes/original/css/theme_right.css.php b/themes/original/css/theme_right.css.php index 4016334e6..86ef42261 100644 --- a/themes/original/css/theme_right.css.php +++ b/themes/original/css/theme_right.css.php @@ -245,37 +245,30 @@ div.tblWarn { /* Heading */ -.serverinfo { - font-family: ; - font-size: ; - font-weight: normal; - white-space: nowrap; - vertical-align: middle; - padding: 0px 0px 10px 0px; -} - img, input, select, button { vertical-align: middle; } - -.serverinfo a:link, .serverinfo a:active, .serverinfo a:visited { - font-family: ; - font-size: ; - font-weight: bolder; -} -.serverinfo a img{ - vertical-align: middle; - margin: 0px 1px 0px 2px; -} -.serverinfo div{ - background-image: url(../themes/original/img/item_ltr.png); - background-repeat: no-repeat; - background-position: 50% 50%; - width: 20px; - height: 16px; +#serverinfo { + font-weight: bold; + margin-bottom: 0.5em; } +#serverinfo .item { + white-space: nowrap; +} + +#span_table_comment { + font-weight: normal; + font-style: italic; + white-space: nowrap; +} + +#serverinfo img { + margin: 0 0.1em 0 0.2em; +} + + /* disabled text */ .disabled, .disabled a:link, disabled a:active, .disabled a:visited { font-family: ;