diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index 4b9358dd0a..4a10773fc2 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -34,7 +34,7 @@ require_once './libraries/Index.class.php'; * @param string &$the_disp_mode the synthetic value for display_mode (see a few * lines above for explanations) * @param integer &$the_total the total number of rows returned by the SQL query - * without any programmatically appended "LIMIT" clause + * without any programmatically appended LIMIT clause * (just a copy of $unlim_num_rows if it exists, else * computed inside this function) * @@ -107,8 +107,12 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total) * 2.2.1 * @todo defines edit/delete links depending on show statement */ - $tmp = preg_match('@^SHOW[[:space:]]+(VARIABLES|(FULL[[:space:]]+)?PROCESSLIST|STATUS|TABLE|GRANTS|CREATE|LOGS|DATABASES|FIELDS)@i', $GLOBALS['sql_query'], $which); - if (isset($which[1]) && strpos(' ' . strtoupper($which[1]), 'PROCESSLIST') > 0) { + $tmp = preg_match( + '@^SHOW[[:space:]]+(VARIABLES|(FULL[[:space:]]+)?' + . 'PROCESSLIST|STATUS|TABLE|GRANTS|CREATE|LOGS|DATABASES|FIELDS)@i', + $GLOBALS['sql_query'], $which); + if (isset($which[1]) + && strpos(' ' . strtoupper($which[1]), 'PROCESSLIST') > 0) { $do_display['edit_lnk'] = 'nn'; // no edit link $do_display['del_lnk'] = 'kp'; // "kill process" type edit link } else { @@ -136,12 +140,14 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total) || $do_display['ins_row'] != '0'); // 2.3.2 Displays edit/delete/sort/insert links? if ($is_link - && ($fields_meta[$i]->table == '' || $fields_meta[$i]->table != $prev_table) + && ($fields_meta[$i]->table == '' + || $fields_meta[$i]->table != $prev_table) ) { $do_display['edit_lnk'] = 'nn'; // don't display links $do_display['del_lnk'] = 'nn'; /** - * @todo May be problematic with same fields names in two joined table. + * @todo May be problematic with same field names + * in two joined table. */ // $do_display['sort_lnk'] = (string) '0'; $do_display['ins_row'] = (string) '0'; @@ -173,7 +179,9 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total) // - For a VIEW we (probably) did not count the number of rows // so don't test this number here, it would remove the possibility // of sorting VIEW results. - if (isset($unlim_num_rows) && $unlim_num_rows < 2 && ! PMA_Table::isView($db, $table)) { + if (isset($unlim_num_rows) + && $unlim_num_rows < 2 + && ! PMA_Table::isView($db, $table)) { // force display of navbar for vertical/horizontal display-choice. // $do_display['nav_bar'] = (string) '0'; $do_display['sort_lnk'] = (string) '0'; @@ -227,7 +235,8 @@ function PMA_isSelect() * * @see PMA_displayTableNavigation() */ -function PMA_displayTableNavigationOneButton($caption, $title, $pos, $html_sql_query, $onsubmit = '', $input_for_real_end = '', $onclick = '') +function PMA_displayTableNavigationOneButton($caption, $title, $pos, $html_sql_query, + $onsubmit = '', $input_for_real_end = '', $onclick = '') { global $db, $table, $goto; @@ -238,7 +247,8 @@ function PMA_displayTableNavigationOneButton($caption, $title, $pos, $html_sql_q $caption_output .= $caption; } // for false or 'both' - if (false === $GLOBALS['cfg']['NavigationBarIconic'] || 'both' === $GLOBALS['cfg']['NavigationBarIconic']) { + if (false === $GLOBALS['cfg']['NavigationBarIconic'] + || 'both' === $GLOBALS['cfg']['NavigationBarIconic']) { $caption_output .= ' ' . $title; } $title_output = ' title="' . $title . '"'; @@ -246,11 +256,15 @@ function PMA_displayTableNavigationOneButton($caption, $title, $pos, $html_sql_q