diff --git a/ChangeLog b/ChangeLog index ab2b9fcbe..617f24837 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,12 @@ phpMyAdmin - Changelog $Id$ $Source$ +2002-03-03 Loïc Chapeaux + * libraries/display_tbl.lib.php3: + - feature request #503015 - No "xxxtext" button on vertical mode; + - extended the "relation" feature to PHP3. + * Documentation.html, line 557: extended the "relation" feature to PHP3. + 2002-03-01 Olivier Müller * created the phpmyadmin-cvs mailing list, following the instructions under http://sourceforge.net/docman/display_doc.php?docid=772&group_id=1 : diff --git a/Documentation.html b/Documentation.html index 90078bb96..3f75a184d 100755 --- a/Documentation.html +++ b/Documentation.html @@ -554,7 +554,7 @@ clickable the data values that point to another table.

- Currently, the keys must be numeric, and you must be running PHP 4. + Currently, the keys must be numeric.

To use this functionality you have to: diff --git a/libraries/display_tbl.lib.php3 b/libraries/display_tbl.lib.php3 index 110563eb2..9754bac68 100644 --- a/libraries/display_tbl.lib.php3 +++ b/libraries/display_tbl.lib.php3 @@ -418,16 +418,23 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ + + + + <?php echo (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']); ?> + + + align="center"> <?php echo (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']); ?> ' . "\n" + . ' ' . "\n" + . ' ' . (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']) . '' . "\n" + . ' ' . "\n"; + } // end vertical mode } + // ... else if no button, displays empty(ies) col(s) if required else if ($GLOBALS['cfgModifyDeleteAtLeft'] && ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn')) { - echo "\n"; $vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1; if ($disp_direction == 'horizontal') { + echo "\n"; ?> > ' . "\n"; + } // end vertical mode } - echo "\n"; // 2. Displays the fields' name // 2.0 If sorting links should be used, checks if the query is a "JOIN" @@ -566,6 +595,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ // 2.1.5 Displays the sorting url if ($disp_direction == 'horizontal') { + echo "\n"; ?> @@ -581,8 +611,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ // 2.2 Results can't be sorted else { - echo "\n"; if ($disp_direction == 'horizontal') { + echo "\n"; ?> name) . "\n"; ?> @@ -593,7 +623,6 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ . ' ' . htmlspecialchars($fields_meta[$i]->name) . "\n" . ' '; } // end else (2.2) - echo "\n"; } // end for // 3. Displays the full/partial text button (part 2) at the right @@ -601,26 +630,41 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ if ($GLOBALS['cfgModifyDeleteAtRight'] && ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn') && $is_display['text_btn'] == '1') { - echo "\n"; $vertical_display['emptyafter'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1; if ($disp_direction == 'horizontal') { + echo "\n"; ?> align="center"> <?php echo (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']); ?> ' . "\n" + . ' ' . "\n" + . ' ' . (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']) . '' . "\n" + . ' ' . "\n"; + } // end vertical mode } + // ... else if no button, displays empty cols if required else if ($GLOBALS['cfgModifyDeleteAtRight'] && ($is_display['edit_lnk'] == 'nn' && $is_display['del_lnk'] == 'nn')) { - echo "\n" . ' '; $vertical_display['emptyafter'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1; + if ($disp_direction == 'horizontal') { + echo "\n"; + ?> + > + ' . "\n"; + } // end vertical mode } - echo "\n"; if ($disp_direction == 'horizontal') { + echo "\n"; ?> ' . "\n"; - echo '  ' . "\n"; + echo $vertical_display['textbtn']; reset($vertical_display['edit']); $foo_counter = 0; while (list($key, $val) = each($vertical_display['edit'])) { @@ -1065,7 +1109,9 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ // Displays "delete" link at top if required if ($GLOBALS['cfgModifyDeleteAtLeft'] && is_array($vertical_display['delete'])) { echo '' . "\n"; - echo ' ' . "\n"; + if (!is_array($vertical_display['edit'])) { + echo $vertical_display['textbtn']; + } reset($vertical_display['delete']); $foo_counter = 0; while (list($key, $val) = each($vertical_display['delete'])) { @@ -1101,7 +1147,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ // Displays "edit" link at bottom if required if ($GLOBALS['cfgModifyDeleteAtRight'] && is_array($vertical_display['edit'])) { echo '' . "\n"; - echo '  ' . "\n"; + echo $vertical_display['textbtn']; reset($vertical_display['edit']); $foo_counter = 0; while (list($key, $val) = each($vertical_display['edit'])) { @@ -1118,7 +1164,9 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ // Displays "delete" link at bottom if required if ($GLOBALS['cfgModifyDeleteAtRight'] && is_array($vertical_display['delete'])) { echo '' . "\n"; - echo ' ' . "\n"; + if (!is_array($vertical_display['edit'])) { + echo $vertical_display['textbtn']; + } reset($vertical_display['delete']); $foo_counter = 0; while (list($key, $val) = each($vertical_display['delete'])) { @@ -1245,17 +1293,18 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ // 2b ----- Get field references from Database ----- // (see the 'relation' config variable) - // (currently not available for PHP3 due to spliti() ) + // loic1, 2002-03-02: extended to php3 // init map $map = array(); - if (PMA_PHP_INT_VERSION >= 40000 - && isset($cfgServer['relation']) - && !empty($cfgServer['relation'])) { + if (!empty($cfgServer['relation'])) { // find tables - $tabs = '(\'' . join('\',\'', spliti('`? *((on [^,]+)?,|(NATURAL )?(inner|left|right)( outer)? join) *`?', - eregi_replace('^.*FROM +`?|`? *(on [^,]+)?(WHERE.*)?$', '', $sql_query))) . '\')'; +// $tabs = '(\'' . join('\',\'', spliti('`? *((on [^,]+)?,|(NATURAL )?(inner|left|right)( outer)? join) *`?', +// eregi_replace('^.*FROM +`?|`? *(on [^,]+)?(WHERE.*)?$', '', $sql_query))) . '\')'; + $pattern = '`?[[:space:]]+(((ON|on)[[:space:]]+[^,]+)?,|((NATURAL|natural)[[:space:]]+)?(INNER|inner|LEFT|left|RIGHT|right)([[:space:]]+(OUTER|outer))?[[:space:]]+(JOIN|join))[[:space:]]*`?'; + $target = eregi_replace('^.*[[:space:]]+FROM[[:space:]]+`?|`?[[:space:]]+(ON[[:space:]]+[^,]+)?(WHERE[[:space:]]+.*)?$', '', $sql_query); + $tabs = '(\'' . join('\',\'', split($pattern, $target)) . '\')'; $local_query = 'SELECT src_column, dest_table, dest_column' . ' FROM ' . $cfgServer['relation']