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 elseif ($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_maint']) { $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..." elseif ($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); 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; } elseif (($do_display['nav_bar'] == '1' || $do_display['sort_lnk'] == '1') && (strlen($db) && !empty($table))) { $the_total = PMA_Table::countRecords($db, $table); } // 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') { // - Do not display sort links if less than 2 rows. // - 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)) { // 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 button * * @uses $GLOBALS['cfg']['NavigationBarIconic'] * @uses PMA_generate_common_hidden_inputs() * * @param string iconic caption for button * @param string text for button * @param integer position for next query * @param string query ready for display * @param string optional onsubmit clause * @param string optional hidden field for special treatment * @param string optional onclick clause * * @global string $db the database name * @global string $table the table name * @global string $goto the URL to go back in case of errors * * @access private * * @see PMA_displayTableNavigation() */ function PMA_displayTableNavigationOneButton($caption, $title, $pos, $html_sql_query, $onsubmit = '', $input_for_real_end = '', $onclick = '') { global $db, $table, $goto; $caption_output = ''; // for true or 'both' if ($GLOBALS['cfg']['NavigationBarIconic']) { $caption_output .= $caption; } // for false or 'both' if (false === $GLOBALS['cfg']['NavigationBarIconic'] || 'both' === $GLOBALS['cfg']['NavigationBarIconic']) { $caption_output .= ' ' . $title; } $title_output = ' title="' . $title . '"'; ?>
= $_SESSION['tmp_user_values']['max_rows'] && $_SESSION['tmp_user_values']['max_rows'] != 'all') { // display the Next button PMA_displayTableNavigationOneButton('>', $GLOBALS['strNext'], $pos_next, $html_sql_query); // prepare some options for the End button if ($is_innodb && $unlim_num_rows > $GLOBALS['cfg']['MaxExactCount']) { $input_for_real_end = ''; // no backquote around this message $onclick = ' onclick="return confirmAction(\'' . PMA_jsFormat($GLOBALS['strLongOperation'], false) . '\')"'; } else { $input_for_real_end = $onclick = ''; } // display the End button PMA_displayTableNavigationOneButton('>>', $GLOBALS['strEnd'], @((ceil($unlim_num_rows / $_SESSION['tmp_user_values']['max_rows'])- 1) * $_SESSION['tmp_user_values']['max_rows']), $html_sql_query, 'onsubmit="return ' . (($_SESSION['tmp_user_values']['pos'] + $_SESSION['tmp_user_values']['max_rows'] < $unlim_num_rows && $num_rows >= $_SESSION['tmp_user_values']['max_rows']) ? 'true' : 'false') . '"', $input_for_real_end, $onclick ); } // end move toward //page redirection // (unless we are showing all records) if ('all' != $_SESSION['tmp_user_values']['max_rows']) { //if1 $pageNow = @floor($_SESSION['tmp_user_values']['pos'] / $_SESSION['tmp_user_values']['max_rows']) + 1; $nbTotalPage = @ceil($unlim_num_rows / $_SESSION['tmp_user_values']['max_rows']); if ($nbTotalPage > 1){ //if2 ?> | for keep the form alignment of button < and << ?> |
[->' . $dispval . ']
';
} else {
if ('K' == $_SESSION['tmp_user_values']['relational_display']) {
// user chose "relational key" in the display options, so
// the title contains the display field
$title = (! empty($dispval))? ' title="' . htmlspecialchars($dispval) . '"' : '';
} else {
$title = ' title="' . htmlspecialchars($data) . '"';
}
$_url_params = array(
'db' => $map[$meta->name][3],
'table' => $map[$meta->name][0],
'pos' => '0',
'sql_query' => 'SELECT * FROM '
. PMA_backquote($map[$meta->name][3]) . '.' . PMA_backquote($map[$meta->name][0])
. ' WHERE ' . PMA_backquote($map[$meta->name][1])
. $where_comparison,
);
$result .= '';
if ($transform_function != $default_function) {
// always apply a transformation on the real data,
// not on the display field
$result .= $transform_function($data, $transform_options, $meta);
} else {
if ('D' == $_SESSION['tmp_user_values']['relational_display']) {
// user chose "relational display field" in the
// display options, so show display field in the cell
$result .= $transform_function($dispval, array(), $meta);
} else {
// otherwise display data in the cell
$result .= $transform_function($data, array(), $meta);
}
}
$result .= '';
}
} else {
$result .= ($transform_function != $default_function ? $transform_function($data, $transform_options, $meta) : $transform_function($data, array(), $meta));
}
$result .= '