diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index cb2b80fa11..8ce09460ee 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -215,9 +215,9 @@ function PMA_isSelect() global $analyzed_sql; return ! ($is_count || $is_export || $is_func || $is_analyse) - && count($analyzed_sql[0]['select_expr']) == 0 + && (count($analyzed_sql[0]['select_expr']) == 0) && isset($analyzed_sql[0]['queryflags']['select_from']) - && count($analyzed_sql[0]['table_ref']) == 1; + && (count($analyzed_sql[0]['table_ref']) == 1); } @@ -277,6 +277,7 @@ function PMA_getTableNavigationButton($caption, $title, $pos, $html_sql_query, } // end function PMA_getTableNavigationButton() + /** * Get a navigation bar to browse among the results of a SQL query * @@ -507,10 +508,11 @@ function PMA_getTableNavigation($pos_next, $pos_prev, $sql_query, // Display mode (horizontal/vertical and repeat headers) $table_navigation_html .= __('Mode') . ': ' . "\n"; $choices = array( - 'horizontal' => __('horizontal'), - 'horizontalflipped' => __('horizontal (rotated headers)'), - 'vertical' => __('vertical') - ); + 'horizontal' => __('horizontal'), + 'horizontalflipped' => __('horizontal (rotated headers)'), + 'vertical' => __('vertical') + ); + $table_navigation_html .= PMA_getDropdown( 'disp_direction', $choices, $_SESSION['tmp_user_values']['disp_direction'], @@ -587,6 +589,9 @@ function PMA_getTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, if ($analyzed_sql == '') { $analyzed_sql = array(); } + + $directionCondition = ($direction == 'horizontal') + || ($direction == 'horizontalflipped'); // can the result be sorted? if ($is_display['sort_lnk'] == '1') { @@ -616,21 +621,23 @@ function PMA_getTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, // do we have any index? if ($indexes) { - if (($direction == 'horizontal') - || ($direction == 'horizontalflipped') - ) { + if ($directionCondition) { + $span = $fields_cnt; if ($is_display['edit_lnk'] != 'nn') { $span++; } + if ($is_display['del_lnk'] != 'nn') { $span++; } - if ($is_display['del_lnk'] != 'kp' - && $is_display['del_lnk'] != 'nn' + + if (($is_display['del_lnk'] != 'kp') + && ($is_display['del_lnk'] != 'nn') ) { $span++; } + } else { $span = $num_rows + floor( $num_rows / $_SESSION['tmp_user_values']['repeat_cells'] @@ -879,7 +886,7 @@ function PMA_getTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, // Start of form for multi-rows edit/delete/export - if ($is_display['del_lnk'] == 'dr' || $is_display['del_lnk'] == 'kp') { + if (($is_display['del_lnk'] == 'dr') || ($is_display['del_lnk'] == 'kp')) { $table_headers_html .= '