From f7076ab686fa39ff942dd26d9b7c5ed09a1331c0 Mon Sep 17 00:00:00 2001 From: ninadsp Date: Wed, 21 Jul 2010 00:11:54 +0530 Subject: [PATCH] Added classes and hidden input fields for inline edit --- libraries/display_tbl.lib.php | 27 +++++++++++++++++++++++++++ libraries/display_tbl_links.lib.php | 3 +++ 2 files changed, 30 insertions(+) diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index e34e2dc40..55f6c4475 100755 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -1117,6 +1117,9 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) { $edit_str = PMA_getIcon('b_edit.png', __('Edit'), true); $edit_anchor_class = "edit_row_anchor"; + if( $clause_is_unique == 0) { + $edit_anchor_class .= ' nonunique'; + } } // end if (1.2.1) if (isset($GLOBALS['cfg']['Bookmark']['table']) && isset($GLOBALS['cfg']['Bookmark']['db']) && $table == $GLOBALS['cfg']['Bookmark']['table'] && $db == $GLOBALS['cfg']['Bookmark']['db'] && isset($row[1]) && isset($row[0])) { @@ -1444,6 +1447,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) { $vertical_display['edit'][$row_no] = ''; $vertical_display['delete'][$row_no] = ''; $vertical_display['row_delete'][$row_no] = ''; + $vertical_display['where_clause'][$row_no] = ''; } $column_style_vertical = ''; @@ -1483,6 +1487,13 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) { unset($vertical_display['delete'][$row_no]); } + if( !empty($where_clause) ) { + $vertical_display['where_clause'][$row_no] = ''; + } + else { + unset($vertical_display['where_clause'][$row_no]); + } + echo (($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal' || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') ? "\n" : ''); $row_no++; } // end while @@ -1562,6 +1573,22 @@ function PMA_displayVerticalTable() echo '' . "\n"; } // end if + // Generates the 'where_clause' hidden input field for inline ajax edit if required + if ( is_array($vertical_display['delete']) && (count($vertical_display['delete']) > 0 ) ) { + echo '' . "\n"; + + $foo_counter = 0; + foreach ($vertical_display['where_clause'] as $val) { + if (($foo_counter != 0) && ($_SESSION['tmp_user_values']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['tmp_user_values']['repeat_cells'])) { + echo '' . "\n"; + } + + echo $val; + $foo_counter++; + } // end while + echo '' . "\n"; + } // end if + // Displays data foreach ($vertical_display['desc'] AS $key => $val) { diff --git a/libraries/display_tbl_links.lib.php b/libraries/display_tbl_links.lib.php index 5ae71a3e0..adf38b3c6 100755 --- a/libraries/display_tbl_links.lib.php +++ b/libraries/display_tbl_links.lib.php @@ -57,4 +57,7 @@ if ($doWriteModifyAt == 'left') { . ' ' . "\n"; } } +if( !empty($where_clause)) { + echo ''; +} ?>