From 2df5509bb7fbaf03a254289d15f4931284d53257 Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Fri, 25 Jul 2003 13:59:47 +0000 Subject: [PATCH] Image-stuff, multi-column display --- ChangeLog | 11 ++ Documentation.html | 17 +++ config.inc.php3 | 2 +- db_details_structure.php3 | 236 ++++++++++++++++++++------------- left.php3 | 8 +- libraries/common.lib.php3 | 10 +- libraries/display_tbl.lib.php3 | 48 +++++-- tbl_properties_structure.php3 | 86 +++++++++--- 8 files changed, 294 insertions(+), 124 deletions(-) diff --git a/ChangeLog b/ChangeLog index 27b6ccc27..26c8a5585 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,17 @@ phpMyAdmin - Changelog $Id$ $Source$ +2003-07-25 Garvin Hicking + * images/*, config.inc.php3, db_details_structure.php3, + libraries/common.lib.php3, table_details_structure.php3, + libraries/display_tbl.lib.php3, Documentation.html, + left.php3: + Even more new images on more places: DB properties, Table + properties, Table Display (LinkOrButton unified as well), + Left frame. + Multi-column mode also works for MySQL < 3.23.03 (does anybody even + care?) + 2003-07-25 Marc Delisle * header.inc.php3: XHTML compatibility * libraries/sqlparser.lib.php3, /relation.lib.php3: bug 776789, diff --git a/Documentation.html b/Documentation.html index 6a2278ca9..b02a6a1f2 100755 --- a/Documentation.html +++ b/Documentation.html @@ -1249,6 +1249,23 @@ $cfg['PmaAbsoluteUri'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://'

+
$cfg['PropertiesIconic'] string
+
+ If set to True, will display icons instead of text for db and table properties links (like 'Browse', 'Select', 'Insert', ...).
+ Can be set to 'both' if you want icons AND text.
+ When set to False, will only show text. +

+
+ +
$cfg['PropertiesNumColumns'] integer
+
+ How many columns will be utilized to display the tables on the database property view? + Default is 1 column. When setting this to a value larger than 1, the type of the database will be + omitted for more display space. +

+
+ +
$cfg['DefaultTabServer'] string
Defines the tab displayed by default on server view. Possible diff --git a/config.inc.php3 b/config.inc.php3 index dec75361c..ef9859bd4 100755 --- a/config.inc.php3 +++ b/config.inc.php3 @@ -255,7 +255,7 @@ $cfg['BZipDump'] = TRUE; // dump files // Tabs display settings $cfg['LightTabs'] = FALSE; // use graphically less intense menu tabs -$cfg['PropertiesIconic'] = TRUE; // Use icons instead of text for the table display of a database +$cfg['PropertiesIconic'] = TRUE; // Use icons instead of text for the table display of a database (TRUE|FALSE|'both') $cfg['PropertiesNumColumns'] = 1; // How many columns should be used for table display of a database? // (a value larger than 1 results in some information being hidden) diff --git a/db_details_structure.php3 b/db_details_structure.php3 index 0ae253735..87ab1ae45 100644 --- a/db_details_structure.php3 +++ b/db_details_structure.php3 @@ -40,7 +40,18 @@ if (empty($is_info)) { } // Display function -function pma_TableHeader() { +function pma_TableHeader($alternate = FALSE) { + if ($alternate) { +?> + + + + + + + +
  
@@ -63,6 +74,7 @@ function pma_TableHeader() { ?> '; + } else { + $iconic_spacer = ''; + } + + $titles['Browse'] = $iconic_spacer . '' . $strBrowse . ''; + $titles['Select'] = $iconic_spacer . '' . $strSelect . ''; + $titles['NoBrowse'] = $iconic_spacer . '' . $strBrowse . ''; + $titles['NoSelect'] = $iconic_spacer . '' . $strSelect . ''; + $titles['Insert'] = $iconic_spacer . '' . $strInsert . ''; + $titles['Properties'] = $iconic_spacer . '' . $strProperties . ''; + $titles['Drop'] = $iconic_spacer . '' . $strDrop . ''; + $titles['Empty'] = $iconic_spacer . '' . $strEmpty . ''; + $titles['NoEmpty'] = $iconic_spacer . '' . $strEmpty . ''; + + if ($propicon == 'both') { + $titles['Browse'] .= ' ' . $strBrowse . ''; + $titles['Select'] .= ' ' . $strSelect . ''; + $titles['NoBrowse'] .= ' ' . $strBrowse . ''; + $titles['NoSelect'] .= ' ' . $strSelect . ''; + $titles['Insert'] .= ' ' . $strInsert . ''; + $titles['Properties'] .= ' ' . $strProperties . ''; + $titles['Drop'] .= ' ' . $strDrop . ''; + $titles['Empty'] .= ' ' . $strEmpty . ''; + $titles['NoEmpty'] .= ' ' . $strEmpty . ''; + } +} else { + $titles['Browse'] = $strBrowse; + $titles['Select'] = $strSelect; + $titles['NoBrowse'] = $strBrowse; + $titles['NoSelect'] = $strSelect; + $titles['Insert'] = $strInsert; + $titles['Properties'] = $strProperties; + $titles['Drop'] = $strDrop; + $titles['Empty'] = $strEmpty; + $titles['NoEmpty'] = $strEmpty; +} + // 1. No tables if ($num_tables == 0) { echo $strNoTablesFound . "\n"; } - // 2. Shows table informations on mysql >= 3.23.03 - staybyte - 11 June 2001 else if (PMA_MYSQL_INT_VERSION >= 32303) { - // Get additional information about tables for tooltip if ($cfg['ShowTooltip']) { $tooltip_truename = array(); @@ -192,35 +246,11 @@ else if (PMA_MYSQL_INT_VERSION >= 32303) { - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - + + + + + + + +
    + '; - $titles['Select'] = '' . $strSelect . ''; - $titles['NoBrowse'] = '' . $strBrowse . ''; - $titles['NoSelect'] = '' . $strSelect . ''; - $titles['Insert'] = '' . $strInsert . ''; - $titles['Properties'] = '' . $strProperties . ''; - $titles['Drop'] = '' . $strDrop . ''; - $titles['Empty'] = '' . $strEmpty . ''; - $titles['NoEmpty'] = '' . $strEmpty . ''; - } else { - $titles['Browse'] = $strBrowse; - $titles['Select'] = $strSelect; - $titles['NoBrowse'] = $strBrowse; - $titles['NoSelect'] = $strSelect; - $titles['Insert'] = $strInsert; - $titles['Properties'] = $strProperties; - $titles['Drop'] = $strDrop; - $titles['Empty'] = $strEmpty; - $titles['NoEmpty'] = $strEmpty; - } - if (!empty($sts_data['Rows'])) { echo '"> + + + +
- + - - - - - - - - 1) { +?> +
  
+ + - +
+ 1 ? (ceil($num_tables / $cfg['PropertiesNumColumns']) + 1) : 0); + $row_count = 0; while ($i < $num_tables) { $table = $tables[$i]; $table_encoded = urlencode($table); @@ -514,36 +549,49 @@ else { $tbl_url_query = $url_query . '&table=' . $table_encoded; $bgcolor = ($i % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; echo "\n"; + $row_count++; + if($num_columns > 0 && $num_tables > $num_columns && (($row_count % ($num_columns)) == 0)) { + $bgcolor = $cfg['BgcolorTwo']; + $row_count = 1; ?> -
- /> +
-    - - - - - - - - - - - - - - -
+ +
+ /> + +    + + + + + + + + + + + + + + +
- <?php echo $strWithChecked; ?> - - -  /  - - -
- -    - -    - -
+ <?php echo $strWithChecked; ?> + + +  /  + + +
+ +    + +    + +
+ 1) { +?> + + - + 1) { $book_sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], '\'' . PMA_sqlAddslashes($table) . '\'', 'label'); $list_item = ''; - $list_item .= '' . $strBrowse . ': ' . $url_title . ''; + $list_item .= '' . $strBrowse . ': ' . $url_title . ''; $list_item .= ' ' . "\n"; $list_item .= ''; $list_item .= ($alias != '' && $cfg['ShowTooltipAliasTB'] ? $alias : htmlspecialchars($table)) . '
' . "\n"; @@ -533,7 +533,7 @@ if ($num_dbs > 1) { $book_sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], '\'' . PMA_sqlAddslashes($table) . '\'', 'label'); $table_list .= ' ' . "\n"; - $table_list .= ' ' . $strBrowse . ': ' . $url_title . ' ' . "\n"; + $table_list .= ' ' . $strBrowse . ': ' . $url_title . ' ' . "\n"; if (PMA_USR_BROWSER_AGENT == 'IE') { $table_list .= ' ' . ($alias != '' && $cfg['ShowTooltipAliasTB'] ? $alias : htmlspecialchars($table)) . '
' . "\n"; } else { @@ -697,13 +697,13 @@ else if ($num_dbs == 1) { echo "\n"; ?> - <?php echo $strBrowse . ': ' . $url_title; ?>  + <?php echo $strBrowse . ': ' . $url_title; ?> 
'; - $list_item .= '' . $strBrowse . ': ' . $url_title . ''; + $list_item .= '' . $strBrowse . ': ' . $url_title . ''; $list_item .= ' ' . "\n"; $list_item .= ''; $list_item .= ($alias != '' && $cfg['ShowTooltipAliasTB'] ? $alias : htmlspecialchars($table)) . '
'; diff --git a/libraries/common.lib.php3 b/libraries/common.lib.php3 index d861cb73f..b740b9d4b 100644 --- a/libraries/common.lib.php3 +++ b/libraries/common.lib.php3 @@ -1775,8 +1775,14 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold} list($eachvar, $eachval) = explode('=', $query_pair); $link_or_button .= ' ' . "\n"; } // end while - $link_or_button .= ' ' . "\n" . '' . "\n"; + + if (stristr($message, '' . "\n" . '' . "\n"; + } else { + $link_or_button .= ' ' . "\n" . '' . "\n"; + } } // end if... else... return $link_or_button; diff --git a/libraries/display_tbl.lib.php3 b/libraries/display_tbl.lib.php3 index 4e3a12561..055f1a6de 100644 --- a/libraries/display_tbl.lib.php3 +++ b/libraries/display_tbl.lib.php3 @@ -993,6 +993,15 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) { . '&repeat_cells=' . $repeat_cells . '&dontlimitchars=' . $dontlimitchars; + // We need to copy the value or else the == 'both' check will always return true + $propicon = (string)$GLOBALS['cfg']['PropertiesIconic']; + + if ($propicon == 'both') { + $iconic_spacer = ''; + } else { + $iconic_spacer = ''; + } + // 1.2.1 Modify link(s) if ($is_display['edit_lnk'] == 'ur') { // update row case // $lnk_goto = 'sql.php3' @@ -1007,7 +1016,14 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) { . '&primary_key=' . $uva_condition . '&sql_query=' . urlencode($sql_query) . '&goto=' . urlencode($lnk_goto); - $edit_str = $GLOBALS['strEdit']; + if ($GLOBALS['cfg']['PropertiesIconic'] == FALSE) { + $edit_str = $GLOBALS['strEdit']; + } else { + $edit_str = $iconic_spacer . '' . $GLOBALS['strEdit'] . ''; + if ($propicon == 'both') { + $edit_str .= ' ' . $GLOBALS['strEdit'] . ''; + } + } } // end if (1.2.1) if ($table == $GLOBALS['cfg']['Bookmark']['table'] && $db == $GLOBALS['cfg']['Bookmark']['db']) { @@ -1036,7 +1052,14 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) { $js_conf = 'DELETE FROM ' . PMA_jsFormat($table) . ' WHERE ' . trim(PMA_jsFormat(urldecode($uva_condition), FALSE)) . ((PMA_MYSQL_INT_VERSION >= 32207) ? ' LIMIT 1' : ''); - $del_str = $GLOBALS['strDelete']; + if ($GLOBALS['cfg']['PropertiesIconic'] == FALSE) { + $del_str = $GLOBALS['strDelete']; + } else { + $del_str = $iconic_spacer . '' . $GLOBALS['strDelete'] . ''; + if ($propicon == 'both') { + $del_str .= ' ' . $GLOBALS['strDelete'] . ''; + } + } } else if ($is_display['del_lnk'] == 'kp') { // kill process case $lnk_goto = 'sql.php3' . '?' . str_replace('&', '&', $url_query) @@ -1047,20 +1070,27 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) { . '&sql_query=' . urlencode('KILL ' . $row['Id']) . '&goto=' . urlencode($lnk_goto); $js_conf = 'KILL ' . $row['Id']; - $del_str = $GLOBALS['strKill']; + if ($GLOBALS['cfg']['PropertiesIconic'] == FALSE) { + $del_str = $GLOBALS['strKill']; + } else { + $del_str = $iconic_spacer . '' . $GLOBALS['strKill'] . ''; + if ($propicon == 'both') { + $del_str .= ' ' . $GLOBALS['strKill'] . ''; + } + } } // end if (1.2.2) // 1.3 Displays the links at left if required if ($GLOBALS['cfg']['ModifyDeleteAtLeft'] && ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped')) { if (!empty($edit_url)) { - echo ' ' . "\n"; + echo ' ' . "\n"; echo PMA_linkOrButton($edit_url, $edit_str, ''); echo $bookmark_go; echo ' ' . "\n"; } if (!empty($del_url)) { - echo ' ' . "\n"; + echo ' ' . "\n"; echo PMA_linkOrButton($del_url, $del_str, (isset($js_conf) ? $js_conf : '')); echo ' ' . "\n"; } @@ -1319,13 +1349,13 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) { if ($GLOBALS['cfg']['ModifyDeleteAtRight'] && ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped')) { if (!empty($edit_url)) { - echo ' ' . "\n"; + echo ' ' . "\n"; echo PMA_linkOrButton($edit_url, $edit_str, ''); echo $bookmark_go; echo ' ' . "\n"; } if (!empty($del_url)) { - echo ' ' . "\n"; + echo ' ' . "\n"; echo PMA_linkOrButton($del_url, $del_str, (isset($js_conf) ? $js_conf : '')); echo ' ' . "\n"; } @@ -1346,14 +1376,14 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) { } if (isset($edit_url)) { - $vertical_display['edit'][$row_no] .= ' ' . "\n" + $vertical_display['edit'][$row_no] .= ' ' . "\n" . PMA_linkOrButton($edit_url, $edit_str, '') . $bookmark_go . ' ' . "\n"; } if (isset($del_url)) { - $vertical_display['delete'][$row_no] .= ' ' . "\n" + $vertical_display['delete'][$row_no] .= ' ' . "\n" . PMA_linkOrButton($del_url, $del_str, (isset($js_conf) ? $js_conf : '')) . ' ' . "\n"; } diff --git a/tbl_properties_structure.php3 b/tbl_properties_structure.php3 index 13709529f..5662d7471 100755 --- a/tbl_properties_structure.php3 +++ b/tbl_properties_structure.php3 @@ -205,6 +205,56 @@ while ($row = PMA_mysql_fetch_array($fields_rs)) { } 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 = ''; + } + + $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'] = $strNoDrop; + $titles['Primary'] = $strPrimary; + $titles['Index'] = $strIndex; + $titles['Unique'] = $strUnique; + $titles['IdxFulltext'] = $strIdxFulltext; + $titles['NoPrimary'] = $strPrimary; + $titles['NoIndex'] = $strIndex; + $titles['NoUnique'] = $strUnique; + $titles['NoIdxFulltext'] = $strIdxFulltext; + } + ?> @@ -217,11 +267,11 @@ while ($row = PMA_mysql_fetch_array($fields_rs)) {       - + - + - + 1) { @@ -229,52 +279,52 @@ while ($row = PMA_mysql_fetch_array($fields_rs)) { ?> - + - + - + - + - + - + - + - + - + - - + +