updates the // display mode if ($the_disp_mode != 'nnnn000000') { // 2.0 Print view -> set all elements to FALSE! if (isset($GLOBALS['printview']) && $GLOBALS['printview'] == '1') { $do_display['edit_lnk'] = 'nn'; // no edit link $do_display['del_lnk'] = 'nn'; // no delete link $do_display['sort_lnk'] = (string) '0'; $do_display['nav_bar'] = (string) '0'; $do_display['ins_row'] = (string) '0'; $do_display['bkm_form'] = (string) '0'; $do_display['text_btn'] = (string) '0'; $do_display['pview_lnk'] = (string) '0'; } // 2.1 Statement is a "SELECT COUNT", a // "CHECK/ANALYZE/REPAIR/OPTIMIZE", an "EXPLAIN" one or // contains a "PROC ANALYSE" part else if ($GLOBALS['is_count'] || $GLOBALS['is_analyse'] || $GLOBALS['is_maint'] || $GLOBALS['is_explain']) { $do_display['edit_lnk'] = 'nn'; // no edit link $do_display['del_lnk'] = 'nn'; // no delete link $do_display['sort_lnk'] = (string) '0'; $do_display['nav_bar'] = (string) '0'; $do_display['ins_row'] = (string) '0'; $do_display['bkm_form'] = (string) '1'; if ($GLOBALS['is_analyse']) { $do_display['text_btn'] = (string) '1'; } else { $do_display['text_btn'] = (string) '0'; } $do_display['pview_lnk'] = (string) '1'; } // 2.2 Statement is a "SHOW..." else if ($GLOBALS['is_show']) { // 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 = array() ); 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 { // Default case -> no links $do_display['edit_lnk'] = 'nn'; // no edit link $do_display['del_lnk'] = 'nn'; // no delete link } // 2.2.2 Other settings $do_display['sort_lnk'] = (string) '0'; $do_display['nav_bar'] = (string) '0'; $do_display['ins_row'] = (string) '0'; $do_display['bkm_form'] = (string) '1'; $do_display['text_btn'] = (string) '1'; $do_display['pview_lnk'] = (string) '1'; } // 2.3 Other statements (ie "SELECT" ones) -> updates // $do_display['edit_lnk'], $do_display['del_lnk'] and // $do_display['text_btn'] (keeps other default values) else { $prev_table = $fields_meta[0]->table; $do_display['text_btn'] = (string) '1'; for ($i = 0; $i < $GLOBALS['fields_cnt']; $i++) { $is_link = ($do_display['edit_lnk'] != 'nn' || $do_display['del_lnk'] != 'nn' || $do_display['sort_lnk'] != '0' || $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)) { $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. // $do_display['sort_lnk'] = (string) '0'; $do_display['ins_row'] = (string) '0'; if ($do_display['text_btn'] == '1') { break; } } // end if (2.3.2) // 2.3.3 Always display print view link $do_display['pview_lnk'] = (string) '1'; $prev_table = $fields_meta[$i]->table; } // end for } // end if..elseif...else (2.1 -> 2.3) } // end if (2) // 3. Gets the total number of rows if it is unknown if (isset($unlim_num_rows) && $unlim_num_rows != '') { $the_total = $unlim_num_rows; } else if (($do_display['nav_bar'] == '1' || $do_display['sort_lnk'] == '1') && (!empty($db) && !empty($table))) { $the_total = PMA_countRecords($db, $table, TRUE); } // 4. If navigation bar or sorting fields names urls should be // displayed but there is only one row, change these settings to // false if ($do_display['nav_bar'] == '1' || $do_display['sort_lnk'] == '1') { if (isset($unlim_num_rows) && $unlim_num_rows < 2) { // garvin: force display of navbar for vertical/horizontal display-choice. // $do_display['nav_bar'] = (string) '0'; $do_display['sort_lnk'] = (string) '0'; } } // end if (3) // 5. Updates the synthetic var $the_disp_mode = join('', $do_display); return $do_display; } // end of the 'PMA_setDisplayMode()' function /** * Displays a navigation bar to browse among the results of a sql query * * @param integer the offset for the "next" page * @param integer the offset for the "previous" page * @param string the url-encoded query * * @global string $db the database name * @global string $table the table name * @global string $goto the url to go back in case of errors * @global boolean $dontlimitchars whether to limit the number of displayed * characters of text type fields or not * @global integer $num_rows the total number of rows returned by the * sql query * @global integer $unlim_num_rows the total number of rows returned by the * sql any programmatically appended "LIMIT" clause * @global integer $pos the current position in results * @global mixed $session_max_rows the maximum number of rows per page * ('all' = no limit) * @global string $disp_direction the display mode * (horizontal / vertical / horizontalflipped) * @global integer $repeat_cells the number of row to display between two * table headers * @global boolean $is_innodb whether its InnoDB or not * @global array $showtable table definitions * * @access private * * @see PMA_displayTable() */ function PMA_displayTableNavigation($pos_next, $pos_prev, $encoded_query) { global $db, $table, $goto, $dontlimitchars; global $num_rows, $unlim_num_rows, $pos, $session_max_rows; global $disp_direction, $repeat_cells; global $is_innodb; global $showtable; // FIXME: move this to a central place // FIXME: for other future table types $is_innodb = (isset($showtable['Type']) && $showtable['Type'] == 'InnoDB'); ?>
= $session_max_rows && $session_max_rows != 'all') { // loic1: patch #474210 from Gosha Sakovich - part 2 if ($GLOBALS['cfg']['NavigationBarIconic']) { $caption3 = ' > '; $caption4 = '>>'; $title3 = ' title="' . $GLOBALS['strNext'] . '"'; $title4 = ' title="' . $GLOBALS['strEnd'] . '"'; } else { $caption3 = '> ' . $GLOBALS['strNext']; $caption4 = '>> ' . $GLOBALS['strEnd']; $title3 = ''; $title4 = ''; } // end if... else... echo "\n"; ?> | 1){ //if1 ?> | for keep the form alignment of button < and << ?> |