Beautified the script
This commit is contained in:
@@ -411,7 +411,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
|
|||||||
global $lang, $server, $db, $table;
|
global $lang, $server, $db, $table;
|
||||||
global $goto;
|
global $goto;
|
||||||
global $sql_query, $num_rows, $pos, $session_max_rows;
|
global $sql_query, $num_rows, $pos, $session_max_rows;
|
||||||
global $verticaldisplay, $disp_direction, $repeat_cells;
|
global $vertical_display, $disp_direction, $repeat_cells;
|
||||||
global $dontlimitchars;
|
global $dontlimitchars;
|
||||||
|
|
||||||
if ($disp_direction == 'horizontal') {
|
if ($disp_direction == 'horizontal') {
|
||||||
@@ -422,8 +422,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
|
|||||||
}
|
}
|
||||||
echo "\n";
|
echo "\n";
|
||||||
|
|
||||||
$verticaldisplay['emptypre'] = 0;
|
$vertical_display['emptypre'] = 0;
|
||||||
$verticaldisplay['emptyafter'] = 0;
|
$vertical_display['emptyafter'] = 0;
|
||||||
|
|
||||||
// 1. Displays the full/partial text button (part 1)...
|
// 1. Displays the full/partial text button (part 1)...
|
||||||
$colspan = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn')
|
$colspan = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn')
|
||||||
@@ -446,7 +446,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
|
|||||||
// ... before the result table
|
// ... before the result table
|
||||||
if (($is_display['edit_lnk'] == 'nn' && $is_display['del_lnk'] == 'nn')
|
if (($is_display['edit_lnk'] == 'nn' && $is_display['del_lnk'] == 'nn')
|
||||||
&& $is_display['text_btn'] == '1') {
|
&& $is_display['text_btn'] == '1') {
|
||||||
$verticaldisplay['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1;
|
$vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1;
|
||||||
|
if ($disp_direction == 'verticalal') {
|
||||||
|
|
||||||
|
?>
|
||||||
if ($disp_direction == 'horizontal') {
|
if ($disp_direction == 'horizontal') {
|
||||||
?>
|
?>
|
||||||
<td colspan="<?php echo $fields_cnt; ?>" align="center">
|
<td colspan="<?php echo $fields_cnt; ?>" align="center">
|
||||||
@@ -463,7 +466,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
|
|||||||
// and required
|
// and required
|
||||||
else if ($GLOBALS['cfgModifyDeleteAtLeft'] && $is_display['text_btn'] == '1') {
|
else if ($GLOBALS['cfgModifyDeleteAtLeft'] && $is_display['text_btn'] == '1') {
|
||||||
echo "\n";
|
echo "\n";
|
||||||
$verticaldisplay['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1;
|
$vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1;
|
||||||
if ($disp_direction == 'horizontal') {
|
if ($disp_direction == 'horizontal') {
|
||||||
?>
|
?>
|
||||||
<td<?php echo $colspan; ?>" align="center">
|
<td<?php echo $colspan; ?>" align="center">
|
||||||
@@ -477,7 +480,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
|
|||||||
else if ($GLOBALS['cfgModifyDeleteAtLeft']
|
else if ($GLOBALS['cfgModifyDeleteAtLeft']
|
||||||
&& ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn')) {
|
&& ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn')) {
|
||||||
echo "\n";
|
echo "\n";
|
||||||
$verticaldisplay['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1;
|
$vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1;
|
||||||
if ($disp_direction == 'horizontal') {
|
if ($disp_direction == 'horizontal') {
|
||||||
?>
|
?>
|
||||||
<td<?php echo $colspan; ?>></td>
|
<td<?php echo $colspan; ?>></td>
|
||||||
@@ -574,10 +577,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
|
|||||||
</th>
|
</th>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
$verticaldisplay['desc'][] = ' <th>' . "\n"
|
$vertical_display['desc'][] = ' <th>' . "\n"
|
||||||
. ' <a href="sql.php3?' . $url_query . '">' . "\n"
|
. ' <a href="sql.php3?' . $url_query . '">' . "\n"
|
||||||
. ' ' . htmlspecialchars($fields_meta[$i]->name) . '</a>' . $order_img . "\n"
|
. ' ' . htmlspecialchars($fields_meta[$i]->name) . '</a>' . $order_img . "\n"
|
||||||
. ' </th>' . "\n";
|
. ' </th>' . "\n";
|
||||||
} // end if (2.1)
|
} // end if (2.1)
|
||||||
|
|
||||||
// 2.2 Results can't be sorted
|
// 2.2 Results can't be sorted
|
||||||
@@ -590,9 +593,9 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
|
|||||||
</th>
|
</th>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
$verticaldisplay['desc'][] = ' <th>' . "\n"
|
$vertical_display['desc'][] = ' <th>' . "\n"
|
||||||
. ' ' . htmlspecialchars($fields_meta[$i]->name) . "\n"
|
. ' ' . htmlspecialchars($fields_meta[$i]->name) . "\n"
|
||||||
. ' </th>';
|
. ' </th>';
|
||||||
} // end else (2.2)
|
} // end else (2.2)
|
||||||
echo "\n";
|
echo "\n";
|
||||||
} // end for
|
} // end for
|
||||||
@@ -603,7 +606,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
|
|||||||
&& ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn')
|
&& ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn')
|
||||||
&& $is_display['text_btn'] == '1') {
|
&& $is_display['text_btn'] == '1') {
|
||||||
echo "\n";
|
echo "\n";
|
||||||
$verticaldisplay['emptyafter'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1;
|
$vertical_display['emptyafter'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1;
|
||||||
if ($disp_direction == 'horizontal') {
|
if ($disp_direction == 'horizontal') {
|
||||||
?>
|
?>
|
||||||
<td<?php echo $colspan; ?>" align="center">
|
<td<?php echo $colspan; ?>" align="center">
|
||||||
@@ -617,7 +620,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
|
|||||||
else if ($GLOBALS['cfgModifyDeleteAtRight']
|
else if ($GLOBALS['cfgModifyDeleteAtRight']
|
||||||
&& ($is_display['edit_lnk'] == 'nn' && $is_display['del_lnk'] == 'nn')) {
|
&& ($is_display['edit_lnk'] == 'nn' && $is_display['del_lnk'] == 'nn')) {
|
||||||
echo "\n" . ' <td' . $colspan . '></td>';
|
echo "\n" . ' <td' . $colspan . '></td>';
|
||||||
$verticaldisplay['emptyafter'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1;
|
$vertical_display['emptyafter'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1;
|
||||||
}
|
}
|
||||||
echo "\n";
|
echo "\n";
|
||||||
|
|
||||||
@@ -669,7 +672,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
|
|||||||
global $lang, $server, $db, $table;
|
global $lang, $server, $db, $table;
|
||||||
global $goto;
|
global $goto;
|
||||||
global $sql_query, $pos, $session_max_rows, $fields_meta, $fields_cnt;
|
global $sql_query, $pos, $session_max_rows, $fields_meta, $fields_cnt;
|
||||||
global $verticaldisplay, $disp_direction, $repeat_cells;
|
global $vertical_display, $disp_direction, $repeat_cells;
|
||||||
global $dontlimitchars;
|
global $dontlimitchars;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -677,10 +680,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
|
|||||||
<?php
|
<?php
|
||||||
echo "\n";
|
echo "\n";
|
||||||
|
|
||||||
$foo = 0;
|
$foo = 0;
|
||||||
$verticaldisplay['edit'] = array();
|
$vertical_display['edit'] = array();
|
||||||
$verticaldisplay['delete'] = array();
|
$vertical_display['delete'] = array();
|
||||||
$verticaldisplay['data'] = array();
|
$vertical_display['data'] = array();
|
||||||
|
|
||||||
// Correction uva 19991216 in the while below
|
// Correction uva 19991216 in the while below
|
||||||
// Previous code assumed that all tables have keys, specifically that
|
// Previous code assumed that all tables have keys, specifically that
|
||||||
@@ -703,16 +706,16 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
|
|||||||
if (($foo != 0) && ($repeat_cells != 0) && !($foo % $repeat_cells) && $disp_direction == 'horizontal') {
|
if (($foo != 0) && ($repeat_cells != 0) && !($foo % $repeat_cells) && $disp_direction == 'horizontal') {
|
||||||
echo '<tr>' . "\n";
|
echo '<tr>' . "\n";
|
||||||
|
|
||||||
for ($foo_i = 0; $foo_i < $verticaldisplay['emptypre']; $foo_i++) {
|
for ($foo_i = 0; $foo_i < $vertical_display['emptypre']; $foo_i++) {
|
||||||
echo ' <td> </td>' . "\n";
|
echo ' <td> </td>' . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
reset($verticaldisplay["desc"]);
|
reset($vertical_display['desc']);
|
||||||
while (list($key, $val) = each($verticaldisplay['desc'])) {
|
while (list($key, $val) = each($vertical_display['desc'])) {
|
||||||
echo ' ' . $val;
|
echo ' ' . $val;
|
||||||
}
|
}
|
||||||
|
|
||||||
for ($foo_i = 0; $foo_i < $verticaldisplay['emptyafter']; $foo_i++) {
|
for ($foo_i = 0; $foo_i < $vertical_display['emptyafter']; $foo_i++) {
|
||||||
echo ' <td> </td>' . "\n";
|
echo ' <td> </td>' . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -731,7 +734,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
|
|||||||
<tr<?php echo $on_mouse; ?>>
|
<tr<?php echo $on_mouse; ?>>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
echo "\n";
|
echo (($disp_direction == 'horizontal') ? "\n" : '');
|
||||||
|
|
||||||
// 1. Prepares the row (gets primary keys to use)
|
// 1. Prepares the row (gets primary keys to use)
|
||||||
if ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn') {
|
if ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn') {
|
||||||
@@ -852,7 +855,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
|
|||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
} // end if (1.3)
|
} // end if (1.3)
|
||||||
echo "\n";
|
echo (($disp_direction == 'horizontal') ? "\n" : '');
|
||||||
} // end if (1)
|
} // end if (1)
|
||||||
|
|
||||||
// 2. Displays the rows' values
|
// 2. Displays the rows' values
|
||||||
@@ -861,11 +864,11 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
|
|||||||
if ($primary->numeric == 1) {
|
if ($primary->numeric == 1) {
|
||||||
if (!isset($row[$primary->name])
|
if (!isset($row[$primary->name])
|
||||||
|| (function_exists('is_null') && is_null($row[$primary->name]))) {
|
|| (function_exists('is_null') && is_null($row[$primary->name]))) {
|
||||||
$verticaldisplay['data'][$foo][$i] = ' <td align="right" valign="top" bgcolor="' . $bgcolor . '"><i>NULL</i></td>' . "\n";
|
$vertical_display['data'][$foo][$i] = ' <td align="right" valign="top" bgcolor="' . $bgcolor . '"><i>NULL</i></td>' . "\n";
|
||||||
} else if ($row[$i] != '') {
|
} else if ($row[$i] != '') {
|
||||||
$verticaldisplay['data'][$foo][$i] = ' <td align="right" valign="top" bgcolor="' . $bgcolor . '">' . $row[$primary->name] . '</td>' . "\n";
|
$vertical_display['data'][$foo][$i] = ' <td align="right" valign="top" bgcolor="' . $bgcolor . '">' . $row[$primary->name] . '</td>' . "\n";
|
||||||
} else {
|
} else {
|
||||||
$verticaldisplay['data'][$foo][$i] = ' <td align="right" valign="top" bgcolor="' . $bgcolor . '"> </td>' . "\n";
|
$vertical_display['data'][$foo][$i] = ' <td align="right" valign="top" bgcolor="' . $bgcolor . '"> </td>' . "\n";
|
||||||
}
|
}
|
||||||
} else if ($GLOBALS['cfgShowBlob'] == FALSE && eregi('BLOB', $primary->type)) {
|
} else if ($GLOBALS['cfgShowBlob'] == FALSE && eregi('BLOB', $primary->type)) {
|
||||||
// loic1 : mysql_fetch_fields returns BLOB in place of TEXT
|
// loic1 : mysql_fetch_fields returns BLOB in place of TEXT
|
||||||
@@ -874,11 +877,11 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
|
|||||||
// fields.
|
// fields.
|
||||||
$field_flags = mysql_field_flags($dt_result, $i);
|
$field_flags = mysql_field_flags($dt_result, $i);
|
||||||
if (eregi('BINARY', $field_flags)) {
|
if (eregi('BINARY', $field_flags)) {
|
||||||
$verticaldisplay['data'][$foo][$i] = ' <td align="center" valign="top" bgcolor="' . $bgcolor . '">[BLOB]</td>' . "\n";
|
$vertical_display['data'][$foo][$i] = ' <td align="center" valign="top" bgcolor="' . $bgcolor . '">[BLOB]</td>' . "\n";
|
||||||
} else {
|
} else {
|
||||||
if (!isset($row[$primary->name])
|
if (!isset($row[$primary->name])
|
||||||
|| (function_exists('is_null') && is_null($row[$primary->name]))) {
|
|| (function_exists('is_null') && is_null($row[$primary->name]))) {
|
||||||
$verticaldisplay['data'][$foo][$i] = ' <td valign="top" bgcolor="' . $bgcolor . '"><i>NULL</i></td>' . "\n";
|
$vertical_display['data'][$foo][$i] = ' <td valign="top" bgcolor="' . $bgcolor . '"><i>NULL</i></td>' . "\n";
|
||||||
} else if ($row[$primary->name] != '') {
|
} else if ($row[$primary->name] != '') {
|
||||||
if (strlen($row[$primary->name]) > $GLOBALS['cfgLimitChars'] && ($dontlimitchars != 1)) {
|
if (strlen($row[$primary->name]) > $GLOBALS['cfgLimitChars'] && ($dontlimitchars != 1)) {
|
||||||
$row[$primary->name] = substr($row[$primary->name], 0, $GLOBALS['cfgLimitChars']) . '...';
|
$row[$primary->name] = substr($row[$primary->name], 0, $GLOBALS['cfgLimitChars']) . '...';
|
||||||
@@ -888,15 +891,15 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
|
|||||||
$row[$primary->name] = htmlspecialchars($row[$primary->name]);
|
$row[$primary->name] = htmlspecialchars($row[$primary->name]);
|
||||||
$row[$primary->name] = str_replace("\011", ' ', str_replace(' ', ' ', $row[$primary->name]));
|
$row[$primary->name] = str_replace("\011", ' ', str_replace(' ', ' ', $row[$primary->name]));
|
||||||
$row[$primary->name] = ereg_replace("((\015\012)|(\015)|(\012))", '<br />', $row[$primary->name]);
|
$row[$primary->name] = ereg_replace("((\015\012)|(\015)|(\012))", '<br />', $row[$primary->name]);
|
||||||
$verticaldisplay['data'][$foo][$i] = ' <td valign="top" bgcolor="' . $bgcolor . '">' . $row[$primary->name] . '</td>' . "\n";
|
$vertical_display['data'][$foo][$i] = ' <td valign="top" bgcolor="' . $bgcolor . '">' . $row[$primary->name] . '</td>' . "\n";
|
||||||
} else {
|
} else {
|
||||||
$verticaldisplay['data'][$foo][$i] = ' <td valign="top" bgcolor="' . $bgcolor . '"> </td>' . "\n";
|
$vertical_display['data'][$foo][$i] = ' <td valign="top" bgcolor="' . $bgcolor . '"> </td>' . "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!isset($row[$primary->name])
|
if (!isset($row[$primary->name])
|
||||||
|| (function_exists('is_null') && is_null($row[$primary->name]))) {
|
|| (function_exists('is_null') && is_null($row[$primary->name]))) {
|
||||||
$verticaldisplay['data'][$foo][$i] = ' <td valign="top" bgcolor="' . $bgcolor . '"><i>NULL</i></td>' . "\n";
|
$vertical_display['data'][$foo][$i] = ' <td valign="top" bgcolor="' . $bgcolor . '"><i>NULL</i></td>' . "\n";
|
||||||
} else if ($row[$primary->name] != '') {
|
} else if ($row[$primary->name] != '') {
|
||||||
// loic1: Cut text/blob fields even if $cfgShowBlob is true
|
// loic1: Cut text/blob fields even if $cfgShowBlob is true
|
||||||
if (eregi('BLOB', $primary->type)) {
|
if (eregi('BLOB', $primary->type)) {
|
||||||
@@ -920,21 +923,21 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
|
|||||||
$row[$primary->name] = str_replace("\011", ' ', str_replace(' ', ' ', $row[$primary->name]));
|
$row[$primary->name] = str_replace("\011", ' ', str_replace(' ', ' ', $row[$primary->name]));
|
||||||
$row[$primary->name] = ereg_replace("((\015\012)|(\015)|(\012))", '<br />', $row[$primary->name]);
|
$row[$primary->name] = ereg_replace("((\015\012)|(\015)|(\012))", '<br />', $row[$primary->name]);
|
||||||
}
|
}
|
||||||
$verticaldisplay['data'][$foo][$i] = ' <td valign="top" bgcolor="' . $bgcolor . '">' . $row[$primary->name] . '</td>' . "\n";
|
$vertical_display['data'][$foo][$i] = ' <td valign="top" bgcolor="' . $bgcolor . '">' . $row[$primary->name] . '</td>' . "\n";
|
||||||
} else {
|
} else {
|
||||||
$verticaldisplay['data'][$foo][$i] = ' <td valign="top" bgcolor="' . $bgcolor . '"> </td>' . "\n";
|
$vertical_display['data'][$foo][$i] = ' <td valign="top" bgcolor="' . $bgcolor . '"> </td>' . "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// lem9: output stored cell
|
// lem9: output stored cell
|
||||||
if ($disp_direction == 'horizontal') {
|
if ($disp_direction == 'horizontal') {
|
||||||
echo $verticaldisplay['data'][$foo][$i];
|
echo $vertical_display['data'][$foo][$i];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($verticaldisplay['rowdata'][$i][$foo])) {
|
if (isset($vertical_display['rowdata'][$i][$foo])) {
|
||||||
$verticaldisplay['rowdata'][$i][$foo] .= $verticaldisplay['data'][$foo][$i];
|
$vertical_display['rowdata'][$i][$foo] .= $vertical_display['data'][$foo][$i];
|
||||||
} else {
|
} else {
|
||||||
$verticaldisplay['rowdata'][$i][$foo] = $verticaldisplay['data'][$foo][$i];
|
$vertical_display['rowdata'][$i][$foo] = $vertical_display['data'][$foo][$i];
|
||||||
}
|
}
|
||||||
} // end for (2)
|
} // end for (2)
|
||||||
|
|
||||||
@@ -970,25 +973,25 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
|
|||||||
|
|
||||||
// 4. Gather links of del_urls and edit_urls in an array for later
|
// 4. Gather links of del_urls and edit_urls in an array for later
|
||||||
// output
|
// output
|
||||||
if (!isset($verticaldisplay['edit'][$foo])) {
|
if (!isset($vertical_display['edit'][$foo])) {
|
||||||
$verticaldisplay['edit'][$foo] = '';
|
$vertical_display['edit'][$foo] = '';
|
||||||
$verticaldisplay['delete'][$foo] = '';
|
$vertical_display['delete'][$foo] = '';
|
||||||
}
|
}
|
||||||
$verticaldisplay['edit'][$foo] .= ' <td bgcolor="' . $bgcolor . '">' . "\n";
|
$vertical_display['edit'][$foo] .= ' <td bgcolor="' . $bgcolor . '">' . "\n"
|
||||||
$verticaldisplay['edit'][$foo] .= ' <a href="' . $edit_url . '">' . "\n";
|
. ' <a href="' . $edit_url . '">' . "\n"
|
||||||
$verticaldisplay['edit'][$foo] .= ' ' . $edit_str . '</a>' . "\n";
|
. ' ' . $edit_str . '</a>' . "\n"
|
||||||
$verticaldisplay['edit'][$foo] .= ' </td>' . "\n";
|
. ' </td>' . "\n";
|
||||||
|
|
||||||
$verticaldisplay['delete'][$foo] .= ' <td bgcolor="' . $bgcolor . '">' . "\n";
|
$vertical_display['delete'][$foo] .= ' <td bgcolor="' . $bgcolor . '">' . "\n"
|
||||||
$verticaldisplay['delete'][$foo] .= ' <a href="' . $del_url . '"';
|
. ' <a href="' . $del_url . '"';
|
||||||
if (isset($js_conf)) {
|
if (isset($js_conf)) {
|
||||||
$verticaldisplay['delete'][$foo] .= 'onclick="return confirmLink(this, \'' . $js_conf . '\')"';
|
$vertical_display['delete'][$foo] .= 'onclick="return confirmLink(this, \'' . $js_conf . '\')"';
|
||||||
}
|
}
|
||||||
$verticaldisplay['delete'][$foo] .= '>' . "\n";
|
$vertical_display['delete'][$foo] .= '>' . "\n"
|
||||||
$verticaldisplay['delete'][$foo] .= ' ' . $del_str . '</a>' . "\n";
|
. ' ' . $del_str . '</a>' . "\n"
|
||||||
$verticaldisplay['delete'][$foo] .= ' </td>' . "\n";
|
. ' </td>' . "\n";
|
||||||
|
|
||||||
echo "\n";
|
echo (($disp_direction == 'horizontal') ? "\n" : '');
|
||||||
$foo++;
|
$foo++;
|
||||||
} // end while
|
} // end while
|
||||||
|
|
||||||
@@ -996,6 +999,115 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
|
|||||||
} // end of the 'PMA_displayTableBody()' function
|
} // end of the 'PMA_displayTableBody()' function
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Do display the result table with the vertical direction mode
|
||||||
|
*
|
||||||
|
* @return boolean always true
|
||||||
|
*
|
||||||
|
* @global array the information to display
|
||||||
|
* @global integer the number of row to display between two table headers
|
||||||
|
*
|
||||||
|
* @access private
|
||||||
|
*
|
||||||
|
* @see PMA_displayTable()
|
||||||
|
*/
|
||||||
|
function PMA_displayVerticalTable()
|
||||||
|
{
|
||||||
|
global $vertical_display, $repeat_cells;
|
||||||
|
|
||||||
|
reset($vertical_display);
|
||||||
|
|
||||||
|
// Displays "edit" link at top if required
|
||||||
|
if ($GLOBALS['cfgModifyDeleteAtLeft'] && is_array($vertical_display['edit'])) {
|
||||||
|
echo '<tr>' . "\n";
|
||||||
|
echo ' <td> </td>' . "\n";
|
||||||
|
reset($vertical_display['edit']);
|
||||||
|
$foo_counter = 0;
|
||||||
|
while (list($key, $val) = each($vertical_display['edit'])) {
|
||||||
|
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
|
||||||
|
echo ' <td> </td>' . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
echo $val;
|
||||||
|
$foo_counter++;
|
||||||
|
} // end while
|
||||||
|
echo '</tr>' . "\n";
|
||||||
|
} // end if
|
||||||
|
|
||||||
|
// Displays "delete" link at top if required
|
||||||
|
if ($GLOBALS['cfgModifyDeleteAtLeft'] && is_array($vertical_display['delete'])) {
|
||||||
|
echo '<tr>' . "\n";
|
||||||
|
echo '<td> </td>' . "\n";
|
||||||
|
reset($vertical_display['delete']);
|
||||||
|
$foo_counter = 0;
|
||||||
|
while (list($key, $val) = each($vertical_display['delete'])) {
|
||||||
|
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
|
||||||
|
echo '<td> </td>' . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
echo $val;
|
||||||
|
$foo_counter++;
|
||||||
|
} // end while
|
||||||
|
echo '</tr>' . "\n";
|
||||||
|
} // end if
|
||||||
|
|
||||||
|
// Displays data
|
||||||
|
reset($vertical_display['desc']);
|
||||||
|
while (list($key, $val) = each($vertical_display['desc'])) {
|
||||||
|
echo '<tr>' . "\n";
|
||||||
|
echo $val;
|
||||||
|
|
||||||
|
$foo_counter = 0;
|
||||||
|
while (list($subkey, $subval) = each($vertical_display['rowdata'][$key])) {
|
||||||
|
if (($foo_counter != 0) && ($repeat_cells != 0) and !($foo_counter % $repeat_cells)) {
|
||||||
|
echo $val;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo $subval;
|
||||||
|
$foo_counter++;
|
||||||
|
} // end while
|
||||||
|
|
||||||
|
echo '</tr>' . "\n";
|
||||||
|
} // end while
|
||||||
|
|
||||||
|
// Displays "edit" link at bottom if required
|
||||||
|
if ($GLOBALS['cfgModifyDeleteAtRight'] && is_array($vertical_display['edit'])) {
|
||||||
|
echo '<tr>' . "\n";
|
||||||
|
echo ' <td> </td>' . "\n";
|
||||||
|
reset($vertical_display['edit']);
|
||||||
|
$foo_counter = 0;
|
||||||
|
while (list($key, $val) = each($vertical_display['edit'])) {
|
||||||
|
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
|
||||||
|
echo '<td> </td>' . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
echo $val;
|
||||||
|
$foo_counter++;
|
||||||
|
} // end while
|
||||||
|
echo '</tr>' . "\n";
|
||||||
|
} // end if
|
||||||
|
|
||||||
|
// Displays "delete" link at bottom if required
|
||||||
|
if ($GLOBALS['cfgModifyDeleteAtRight'] && is_array($vertical_display['delete'])) {
|
||||||
|
echo '<tr>' . "\n";
|
||||||
|
echo '<td> </td>' . "\n";
|
||||||
|
reset($vertical_display['delete']);
|
||||||
|
$foo_counter = 0;
|
||||||
|
while (list($key, $val) = each($vertical_display['delete'])) {
|
||||||
|
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
|
||||||
|
echo '<td> </td>' . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
echo $val;
|
||||||
|
$foo_counter++;
|
||||||
|
} // end while
|
||||||
|
echo '</tr>' . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
} // end of the 'PMA_displayVerticalTable' function
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays a table of results returned by a sql query.
|
* Displays a table of results returned by a sql query.
|
||||||
* This function is called by the "sql.php3" script.
|
* This function is called by the "sql.php3" script.
|
||||||
@@ -1035,7 +1147,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
|
|||||||
global $lang, $server, $db, $table;
|
global $lang, $server, $db, $table;
|
||||||
global $goto;
|
global $goto;
|
||||||
global $sql_query, $num_rows, $unlim_num_rows, $pos, $fields_meta, $fields_cnt;
|
global $sql_query, $num_rows, $unlim_num_rows, $pos, $fields_meta, $fields_cnt;
|
||||||
global $verticaldisplay, $disp_direction, $repeat_cells;
|
global $vertical_display, $disp_direction, $repeat_cells;
|
||||||
global $dontlimitchars;
|
global $dontlimitchars;
|
||||||
|
|
||||||
// 1. ----- Prepares the work -----
|
// 1. ----- Prepares the work -----
|
||||||
@@ -1103,117 +1215,22 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 3. ----- Displays the results table -----
|
// 3. ----- Displays the results table -----
|
||||||
// lem9: horizontal output?
|
?>
|
||||||
if ($disp_direction == 'horizontal') {
|
|
||||||
?>
|
|
||||||
<!-- Results table -->
|
<!-- Results table -->
|
||||||
<table border="<?php echo $GLOBALS['cfgBorder']; ?>" cellpadding="5">
|
<table border="<?php echo $GLOBALS['cfgBorder']; ?>" cellpadding="5">
|
||||||
<?php
|
<?php
|
||||||
echo "\n";
|
echo "\n";
|
||||||
PMA_displayTableHeaders($is_display, $fields_meta, $fields_cnt, $encoded_sql_query);
|
PMA_displayTableHeaders($is_display, $fields_meta, $fields_cnt, $encoded_sql_query);
|
||||||
PMA_displayTableBody($dt_result, $is_display);
|
PMA_displayTableBody($dt_result, $is_display);
|
||||||
?>
|
// lem9: vertical output case
|
||||||
|
if ($disp_direction == 'vertical') {
|
||||||
|
PMA_displayVerticalTable();
|
||||||
|
} // end if
|
||||||
|
unset($vertical_display);
|
||||||
|
?>
|
||||||
</table>
|
</table>
|
||||||
<br />
|
<br />
|
||||||
<?php
|
<?php
|
||||||
}
|
|
||||||
else {
|
|
||||||
echo "\n";
|
|
||||||
?>
|
|
||||||
<!-- Results table -->
|
|
||||||
<table border="<?php echo $GLOBALS['cfgBorder']; ?>" cellpadding="5">
|
|
||||||
<?php
|
|
||||||
echo "\n";
|
|
||||||
PMA_displayTableHeaders($is_display, $fields_meta, $fields_cnt, $encoded_sql_query);
|
|
||||||
PMA_displayTableBody($dt_result, $is_display);
|
|
||||||
reset($verticaldisplay);
|
|
||||||
|
|
||||||
if ($GLOBALS['cfgModifyDeleteAtLeft'] && is_array($verticaldisplay['edit'])) {
|
|
||||||
echo '<tr>' . "\n";
|
|
||||||
echo ' <td> </td>' . "\n";
|
|
||||||
reset($verticaldisplay['edit']);
|
|
||||||
$foo_counter = 0;
|
|
||||||
while (list($key, $val) = each($verticaldisplay['edit'])) {
|
|
||||||
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
|
|
||||||
echo ' <td> </td>' . "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
echo $val;
|
|
||||||
$foo_counter++;
|
|
||||||
} // end while
|
|
||||||
echo '</tr>' . "\n";
|
|
||||||
} // end if
|
|
||||||
|
|
||||||
if ($GLOBALS['cfgModifyDeleteAtLeft'] && is_array($verticaldisplay['delete'])) {
|
|
||||||
echo '<tr>' . "\n";
|
|
||||||
echo '<td> </td>' . "\n";
|
|
||||||
reset($verticaldisplay['delete']);
|
|
||||||
$foo_counter = 0;
|
|
||||||
while (list($key, $val) = each($verticaldisplay['delete'])) {
|
|
||||||
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
|
|
||||||
echo '<td> </td>' . "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
echo $val;
|
|
||||||
$foo_counter++;
|
|
||||||
} // end while
|
|
||||||
echo '</tr>' . "\n";
|
|
||||||
} // end if
|
|
||||||
|
|
||||||
reset($verticaldisplay['desc']);
|
|
||||||
while (list($key, $val) = each($verticaldisplay['desc'])) {
|
|
||||||
echo '<tr>' . "\n";
|
|
||||||
echo $val;
|
|
||||||
|
|
||||||
$foo_counter = 0;
|
|
||||||
while (list($subkey, $subval) = each($verticaldisplay['rowdata'][$key])) {
|
|
||||||
if (($foo_counter != 0) && ($repeat_cells != 0) and !($foo_counter % $repeat_cells)) {
|
|
||||||
echo $val;
|
|
||||||
}
|
|
||||||
|
|
||||||
echo $subval;
|
|
||||||
$foo_counter++;
|
|
||||||
} // end while
|
|
||||||
|
|
||||||
echo '</tr>' . "\n";
|
|
||||||
} // end while
|
|
||||||
|
|
||||||
if ($GLOBALS['cfgModifyDeleteAtRight'] && is_array($verticaldisplay['edit'])) {
|
|
||||||
echo '<tr>' . "\n";
|
|
||||||
echo ' <td> </td>' . "\n";
|
|
||||||
reset($verticaldisplay['edit']);
|
|
||||||
$foo_counter = 0;
|
|
||||||
while (list($key, $val) = each($verticaldisplay['edit'])) {
|
|
||||||
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
|
|
||||||
echo '<td> </td>' . "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
echo $val;
|
|
||||||
$foo_counter++;
|
|
||||||
} // end while
|
|
||||||
echo '</tr>' . "\n";
|
|
||||||
} // end if
|
|
||||||
|
|
||||||
if ($GLOBALS['cfgModifyDeleteAtRight'] && is_array($verticaldisplay['delete'])) {
|
|
||||||
echo '<tr>' . "\n";
|
|
||||||
echo '<td> </td>' . "\n";
|
|
||||||
reset($verticaldisplay['delete']);
|
|
||||||
$foo_counter = 0;
|
|
||||||
while (list($key, $val) = each($verticaldisplay['delete'])) {
|
|
||||||
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
|
|
||||||
echo '<td> </td>' . "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
echo $val;
|
|
||||||
$foo_counter++;
|
|
||||||
} // end while
|
|
||||||
echo '</tr>' . "\n";
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</table>
|
|
||||||
<br />
|
|
||||||
<?php
|
|
||||||
} // end if (check $disp_direction)
|
|
||||||
|
|
||||||
echo "\n";
|
echo "\n";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user