getFooter()->setMinimal(); $header = $response->getHeader(); $header->disableMenu(); $header->setBodyId('body_browse_foreigners'); /** * Displays the frame */ $cfgRelation = PMA_getRelationsParam(); $foreigners = ($cfgRelation['relwork'] ? PMA_getForeigners($db, $table) : false); $override_total = true; if (! isset($pos)) { $pos = 0; } $foreign_limit = 'LIMIT ' . $pos . ', ' . $GLOBALS['cfg']['MaxRows'] . ' '; if (isset($foreign_navig) && $foreign_navig == __('Show all')) { unset($foreign_limit); } $foreignData = PMA_getForeignData( $foreigners, $field, $override_total, isset($foreign_filter) ? $foreign_filter : '', $foreign_limit ); if (isset($rownumber)) { $rownumber_param = '&rownumber=' . urlencode($rownumber); } else { $rownumber_param = ''; } $gotopage = ''; $showall = ''; if (is_array($foreignData['disp_row'])) { if ($cfg['ShowAll'] && ($foreignData['the_total'] > $GLOBALS['cfg']['MaxRows']) ) { $showall = ''; } $session_max_rows = $GLOBALS['cfg']['MaxRows']; $pageNow = @floor($pos / $session_max_rows) + 1; $nbTotalPage = @ceil($foreignData['the_total'] / $session_max_rows); if ($foreignData['the_total'] > $GLOBALS['cfg']['MaxRows']) { $gotopage = PMA_Util::pageselector( $session_max_rows, $pageNow, $nbTotalPage, 200, 5, 5, 20, 10, __('Page number:') ); } } if (isset($rownumber)) { $element_name = " var element_name = field + '[multi_edit][" . htmlspecialchars($rownumber) . "][' + fieldmd5 + ']';\n" . " var null_name = field_null + '[multi_edit][" . htmlspecialchars($rownumber) . "][' + fieldmd5 + ']';\n"; } else { $element_name = "var element_name = field + '[]'"; } $error = PMA_jsFormat( __( 'The target browser window could not be updated. ' . 'Maybe you have closed the parent window, or ' . 'your browser\'s security settings are ' . 'configured to block cross-window updates.' ) ); if (! isset($fieldkey) || ! is_numeric($fieldkey)) { $fieldkey = 0; } $code = <<getScripts()->addCode($code); // HTML output $output = '
' . '
' . PMA_generate_common_hidden_inputs($db, $table) . '' . ''; if (isset($rownumber)) { $output .= ''; } $output .= '' . '' . '' . '' . '' . '' . $gotopage . '' . '' . $showall . '' . '
' . '
'; $output .= ''; if (is_array($foreignData['disp_row'])) { $header = ''; $output .= '' . $header . '' . "\n" . '' . $header . '' . "\n" . '' . "\n"; $values = array(); $keys = array(); foreach ($foreignData['disp_row'] as $relrow) { if ($foreignData['foreign_display'] != false) { $values[] = $relrow[$foreignData['foreign_display']]; } else { $values[] = ''; } $keys[] = $relrow[$foreignData['foreign_field']]; } asort($keys); $hcount = 0; $odd_row = true; $val_ordered_current_row = 0; $val_ordered_current_equals_data = false; $key_ordered_current_equals_data = false; foreach ($keys as $key_ordered_current_row => $value) { $hcount++; if ($cfg['RepeatCells'] > 0 && $hcount > $cfg['RepeatCells']) { $output .= $header; $hcount = 0; $odd_row = true; } $key_ordered_current_key = $keys[$key_ordered_current_row]; $key_ordered_current_val = $values[$key_ordered_current_row]; $val_ordered_current_key = $keys[$val_ordered_current_row]; $val_ordered_current_val = $values[$val_ordered_current_row]; $val_ordered_current_row++; if (PMA_strlen($val_ordered_current_val) <= $cfg['LimitChars']) { $val_ordered_current_val = htmlspecialchars( $val_ordered_current_val ); $val_ordered_current_val_title = ''; } else { $val_ordered_current_val_title = htmlspecialchars( $val_ordered_current_val ); $val_ordered_current_val = htmlspecialchars( PMA_substr($val_ordered_current_val, 0, $cfg['LimitChars']) . '...' ); } if (PMA_strlen($key_ordered_current_val) <= $cfg['LimitChars']) { $key_ordered_current_val = htmlspecialchars( $key_ordered_current_val ); $key_ordered_current_val_title = ''; } else { $key_ordered_current_val_title = htmlspecialchars( $key_ordered_current_val ); $key_ordered_current_val = htmlspecialchars( PMA_substr( $key_ordered_current_val, 0, $cfg['LimitChars'] ) . '...' ); } if (! empty($data)) { $val_ordered_current_equals_data = $val_ordered_current_key == $data; $key_ordered_current_equals_data = $key_ordered_current_key == $data; } $output .= ''; $odd_row = ! $odd_row; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; } // end while } $output .= '' . '
' . __('Keyname') . ' ' . __('Description') . ' ' . __('Description') . ' ' . __('Keyname') . '
' . ($key_ordered_current_equals_data ? '' : '') . '' . htmlspecialchars($key_ordered_current_key) . '' . ($key_ordered_current_equals_data ? '' : '') . '' . ($key_ordered_current_equals_data ? '' : '') . '' . $key_ordered_current_val . '' . ($key_ordered_current_equals_data ? '' : '') . '' . '' . ($val_ordered_current_equals_data ? '' : '') . '' . $val_ordered_current_val . '' . ($val_ordered_current_equals_data ? '' : '') . '' . ($val_ordered_current_equals_data ? '' : '') . '' . htmlspecialchars($val_ordered_current_key) . '' . ($val_ordered_current_equals_data ? '' : '') . '
'; $response->addHtml($output); ?>