- added class icon to images

- fixed select all rows/row maker
- removed arrow_ltr/rtl.png for vertical display
- cleaned up php code and html output
This commit is contained in:
Sebastian Mendel
2005-11-14 15:01:20 +00:00
parent eb4e941137
commit 7e04ee2467
3 changed files with 144 additions and 177 deletions

View File

@@ -17,6 +17,11 @@ $Source$
- undefined variable docY - undefined variable docY
* libraries/left_header.inc.php * libraries/left_header.inc.php
- added class icon - added class icon
* display_tbl.lib.php, libraries/display_tbl_links.lib.php:
- added class icon to images
- fixed select all rows
- removed arrow_ltr/rtl.png for vertical display
- cleaned up php code and html output
2005-11-13 Michal Čihař <michal@cihar.com> 2005-11-13 Michal Čihař <michal@cihar.com>
* Documentation.html, config.default.php, main.php, server_links.inc.php, * Documentation.html, config.default.php, main.php, server_links.inc.php,

View File

@@ -227,7 +227,7 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $encoded_query)
// loic1: patch #474210 from Gosha Sakovich - part 1 // loic1: patch #474210 from Gosha Sakovich - part 1
if ($GLOBALS['cfg']['NavigationBarIconic']) { if ($GLOBALS['cfg']['NavigationBarIconic']) {
$caption1 = '&lt;&lt;'; $caption1 = '&lt;&lt;';
$caption2 = '&nbsp;&lt;&nbsp;'; $caption2 = ' &lt; ';
$title1 = ' title="' . $GLOBALS['strPos1'] . '"'; $title1 = ' title="' . $GLOBALS['strPos1'] . '"';
$title2 = ' title="' . $GLOBALS['strPrevious'] . '"'; $title2 = ' title="' . $GLOBALS['strPrevious'] . '"';
} else { } else {
@@ -265,7 +265,6 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $encoded_query)
</td> </td>
<?php <?php
} // end move back } // end move back
echo "\n";
?> ?>
<td> <td>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
@@ -305,7 +304,7 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $encoded_query)
&& $session_max_rows != 'all') { && $session_max_rows != 'all') {
// loic1: patch #474210 from Gosha Sakovich - part 2 // loic1: patch #474210 from Gosha Sakovich - part 2
if ($GLOBALS['cfg']['NavigationBarIconic']) { if ($GLOBALS['cfg']['NavigationBarIconic']) {
$caption3 = '&nbsp;&gt;&nbsp;'; $caption3 = ' &gt; ';
$caption4 = '&gt;&gt;'; $caption4 = '&gt;&gt;';
$title3 = ' title="' . $GLOBALS['strNext'] . '"'; $title3 = ' title="' . $GLOBALS['strNext'] . '"';
$title4 = ' title="' . $GLOBALS['strEnd'] . '"'; $title4 = ' title="' . $GLOBALS['strEnd'] . '"';
@@ -554,12 +553,10 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
} }
echo '<option value="' . htmlspecialchars($unsorted_sql_query) . '"' . ($used_index ? '' : ' selected="selected"' ) . '>' . $GLOBALS['strNone'] . '</option>'; echo '<option value="' . htmlspecialchars($unsorted_sql_query) . '"' . ($used_index ? '' : ' selected="selected"' ) . '>' . $GLOBALS['strNone'] . '</option>';
echo "\n"; echo "\n";
echo '</select>&nbsp;'; echo '</select>' . "\n";
echo "\n";
echo '<input type="submit" value="' . $GLOBALS['strGo'] . '" />'; echo '<input type="submit" value="' . $GLOBALS['strGo'] . '" />';
echo "\n"; echo "\n";
echo '</form>'; echo '</form>' . "\n";
echo "\n";
} }
} }
} }
@@ -583,19 +580,9 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
echo '<input type="hidden" name="goto" value="sql.php" />' . "\n"; echo '<input type="hidden" name="goto" value="sql.php" />' . "\n";
} }
echo '<!-- Results table -->' . "\n" echo '<table id="table_results" class="data">' . "\n";
. '<table id="table_results" class="data" ';
if (isset($GLOBALS['printview']) && $GLOBALS['printview'] == '1') {
echo 'border="1" cellpadding="2" cellspacing="0"';
} else {
echo 'border="' . $GLOBALS['cfg']['Border'] . '" cellpadding="2" cellspacing="1"';
}
echo '>' . "\n";
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') { if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
?> echo '<thead><tr>' . "\n";
<!-- Results table headers -->
<tr>
<?php
} }
// 1. Displays the full/partial text button (part 1)... // 1. Displays the full/partial text button (part 1)...
@@ -617,7 +604,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
. '&amp;repeat_cells=' . $repeat_cells . '&amp;repeat_cells=' . $repeat_cells
. '&amp;goto=' . $goto . '&amp;goto=' . $goto
. '&amp;dontlimitchars=' . (($dontlimitchars) ? 0 : 1); . '&amp;dontlimitchars=' . (($dontlimitchars) ? 0 : 1);
$text_message = '<img src="' . $GLOBALS['pmaThemeImage'] . 's_'.($dontlimitchars ? 'partialtext' : 'fulltext') . '.png" border="0" width="50" height="20" alt="' . ($dontlimitchars ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']) . '" title="' . ($dontlimitchars ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']) . '" />'; $text_message = '<img class="fulltext" src="' . $GLOBALS['pmaThemeImage'] . 's_'.($dontlimitchars ? 'partialtext' : 'fulltext') . '.png" width="50" height="20" alt="' . ($dontlimitchars ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']) . '" title="' . ($dontlimitchars ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']) . '" />';
$text_link = PMA_linkOrButton( $text_url, $text_message, array(), false ); $text_link = PMA_linkOrButton( $text_url, $text_message, array(), false );
// ... before the result table // ... before the result table
@@ -626,21 +613,16 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
$vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 3 : 0; $vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 3 : 0;
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') { if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
?> ?>
<th class="td" colspan="<?php echo $fields_cnt; ?>" align="center"> <th colspan="<?php echo $fields_cnt; ?>"><?php echo $text_link; ?></th>
<?php echo $text_link; ?>
</th>
</tr> </tr>
<tr> <tr>
<?php <?php
} // end horizontal/horizontalflipped mode } // end horizontal/horizontalflipped mode
else { else {
echo "\n";
?> ?>
<tr> <tr>
<th class="td" colspan="<?php echo $num_rows + floor($num_rows/$repeat_cells) + 1; ?>" align="center"> <th colspan="<?php echo $num_rows + floor($num_rows/$repeat_cells) + 1; ?>">
<?php echo $text_link; ?> <?php echo $text_link; ?></th>
</th>
</tr> </tr>
<?php <?php
} // end vertical mode } // end vertical mode
@@ -648,33 +630,28 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
// ... at the left column of the result table header if possible // ... at the left column of the result table header if possible
// and required // and required
else if ($GLOBALS['cfg']['ModifyDeleteAtLeft'] && $is_display['text_btn'] == '1') { elseif ($GLOBALS['cfg']['ModifyDeleteAtLeft'] && $is_display['text_btn'] == '1') {
$vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 3 : 0; $vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 3 : 0;
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') { if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
echo "\n";
?> ?>
<th class="td" <?php echo $colspan; ?> align="center"> <th <?php echo $colspan; ?>><?php echo $text_link; ?></th>
<?php echo $text_link; ?>
</th>
<?php <?php
} // end horizontal/horizontalflipped mode } // end horizontal/horizontalflipped mode
else { else {
$vertical_display['textbtn'] = ' <th class="td" ' . $rowspan . ' align="center" valign="middle">' . "\n" $vertical_display['textbtn'] = ' <th ' . $rowspan . ' valign="middle">' . "\n"
. ' ' . $text_link . "\n" . ' ' . $text_link . "\n"
. ' </th>' . "\n"; . ' </th>' . "\n";
} // end vertical mode } // end vertical mode
} }
// ... else if no button, displays empty(ies) col(s) if required // ... else if no button, displays empty(ies) col(s) if required
else if ($GLOBALS['cfg']['ModifyDeleteAtLeft'] elseif ($GLOBALS['cfg']['ModifyDeleteAtLeft']
&& ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn')) { && ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn')) {
$vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 3 : 0; $vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 3 : 0;
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') { if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
echo "\n";
?> ?>
<td<?php echo $colspan; ?>></td> <td<?php echo $colspan; ?>></td>
<?php <?php
echo "\n";
} // end horizontal/horizontalfipped mode } // end horizontal/horizontalfipped mode
else { else {
$vertical_display['textbtn'] = ' <td' . $rowspan . '></td>' . "\n"; $vertical_display['textbtn'] = ' <td' . $rowspan . '></td>' . "\n";
@@ -793,17 +770,15 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
} }
$sort_order .= $GLOBALS['cfg']['Order']; $sort_order .= $GLOBALS['cfg']['Order'];
$order_img = ''; $order_img = '';
} } elseif (preg_match('@[[:space:]]ASC$@i', $sort_expression)) {
else if (preg_match('@[[:space:]]ASC$@i', $sort_expression)) {
$sort_order .= ' DESC'; $sort_order .= ' DESC';
$order_img = ' <img src="' . $GLOBALS['pmaThemeImage'] . 's_asc.png" border="0" width="11" height="9" alt="'. $GLOBALS['strAscending'] . '" title="'. $GLOBALS['strAscending'] . '" id="soimg' . $i . '" />'; $order_img = ' <img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 's_asc.png" width="11" height="9" alt="'. $GLOBALS['strAscending'] . '" title="'. $GLOBALS['strAscending'] . '" id="soimg' . $i . '" />';
} } elseif (preg_match('@[[:space:]]DESC$@i', $sort_expression)) {
else if (preg_match('@[[:space:]]DESC$@i', $sort_expression)) {
$sort_order .= ' ASC'; $sort_order .= ' ASC';
$order_img = ' <img src="' . $GLOBALS['pmaThemeImage'] . 's_desc.png" border="0" width="11" height="9" alt="'. $GLOBALS['strDescending'] . '" title="'. $GLOBALS['strDescending'] . '" id="soimg' . $i . '" />'; $order_img = ' <img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 's_desc.png" width="11" height="9" alt="'. $GLOBALS['strDescending'] . '" title="'. $GLOBALS['strDescending'] . '" id="soimg' . $i . '" />';
} else { } else {
$sort_order .= ' DESC'; $sort_order .= ' DESC';
$order_img = ' <img src="' . $GLOBALS['pmaThemeImage'] . 's_asc.png" border="0" width="11" height="9" alt="'. $GLOBALS['strAscending'] . '" title="'. $GLOBALS['strAscending'] . '" id="soimg' . $i . '" />'; $order_img = ' <img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 's_asc.png" width="11" height="9" alt="'. $GLOBALS['strAscending'] . '" title="'. $GLOBALS['strAscending'] . '" id="soimg' . $i . '" />';
} }
if (preg_match('@(.*)([[:space:]](LIMIT (.*)|PROCEDURE (.*)|FOR UPDATE|LOCK IN SHARE MODE))@i', $unsorted_sql_query, $regs3 = array())) { if (preg_match('@(.*)([[:space:]](LIMIT (.*)|PROCEDURE (.*)|FOR UPDATE|LOCK IN SHARE MODE))@i', $unsorted_sql_query, $regs3 = array())) {
@@ -842,7 +817,6 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
$order_link = PMA_linkOrButton( $order_url, $order_link_content . $order_img, $order_link_params, false, true ); $order_link = PMA_linkOrButton( $order_url, $order_link_content . $order_img, $order_link_params, false, true );
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') { if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
echo "\n";
?> ?>
<th <?php echo $column_style; ?> <?php if ($disp_direction == 'horizontalflipped') echo 'valign="bottom"'; ?>> <th <?php echo $column_style; ?> <?php if ($disp_direction == 'horizontalflipped') echo 'valign="bottom"'; ?>>
<?php echo $order_link; ?> <?php echo $order_link; ?>
@@ -859,7 +833,6 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
// 2.2 Results can't be sorted // 2.2 Results can't be sorted
else { else {
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') { if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
echo "\n";
?> ?>
<th <?php echo $column_style; ?> <?php if ($disp_direction == 'horizontalflipped') echo 'valign="bottom"'; ?> <?php echo ($disp_direction == 'horizontalflipped' && $GLOBALS['cfg']['HeaderFlipType'] == 'css' ? 'style="direction: ltr; writing-mode: tb-rl;"' : ''); ?>> <th <?php echo $column_style; ?> <?php if ($disp_direction == 'horizontalflipped') echo 'valign="bottom"'; ?> <?php echo ($disp_direction == 'horizontalflipped' && $GLOBALS['cfg']['HeaderFlipType'] == 'css' ? 'style="direction: ltr; writing-mode: tb-rl;"' : ''); ?>>
<?php echo ($disp_direction == 'horizontalflipped' && $GLOBALS['cfg']['HeaderFlipType'] == 'fake'? PMA_flipstring(htmlspecialchars($fields_meta[$i]->name), "<br />\n") : htmlspecialchars($fields_meta[$i]->name)) . "\n"; ?> <?php echo ($disp_direction == 'horizontalflipped' && $GLOBALS['cfg']['HeaderFlipType'] == 'fake'? PMA_flipstring(htmlspecialchars($fields_meta[$i]->name), "<br />\n") : htmlspecialchars($fields_meta[$i]->name)) . "\n"; ?>
@@ -883,13 +856,13 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') { if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
echo "\n"; echo "\n";
?> ?>
<th class="td" <?php echo $colspan; ?> align="center"> <th <?php echo $colspan; ?>>
<?php echo $text_link; ?> <?php echo $text_link; ?>
</th> </th>
<?php <?php
} // end horizontal/horizontalflipped mode } // end horizontal/horizontalflipped mode
else { else {
$vertical_display['textbtn'] = ' <th class="td" ' . $rowspan . ' align="center" valign="middle">' . "\n" $vertical_display['textbtn'] = ' <th ' . $rowspan . ' valign="middle">' . "\n"
. ' ' . $text_link . "\n" . ' ' . $text_link . "\n"
. ' </th>' . "\n"; . ' </th>' . "\n";
} // end vertical mode } // end vertical mode
@@ -913,12 +886,11 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
} }
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') { if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
echo "\n";
?> ?>
</tr> </tr>
</thead>
<?php <?php
} }
echo "\n";
return TRUE; return TRUE;
} // end of the 'PMA_displayTableHeaders()' function } // end of the 'PMA_displayTableHeaders()' function
@@ -960,8 +932,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
* *
* @see PMA_displayTable() * @see PMA_displayTable()
*/ */
function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
{
global $db, $table, $goto, $dontlimitchars; global $db, $table, $goto, $dontlimitchars;
global $sql_query, $pos, $session_max_rows, $fields_meta, $fields_cnt; global $sql_query, $pos, $session_max_rows, $fields_meta, $fields_cnt;
global $vertical_display, $disp_direction, $repeat_cells, $highlight_columns; global $vertical_display, $disp_direction, $repeat_cells, $highlight_columns;
@@ -989,11 +960,6 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
if (!is_array($map)) { if (!is_array($map)) {
$map = array(); $map = array();
} }
?>
<!-- Results table body -->
<?php
echo "\n";
$row_no = 0; $row_no = 0;
$vertical_display['edit'] = array(); $vertical_display['edit'] = array();
$vertical_display['delete'] = array(); $vertical_display['delete'] = array();
@@ -1021,52 +987,42 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
// ne0x: Use function PMA_DBI_fetch_array() due to mysqli // ne0x: Use function PMA_DBI_fetch_array() due to mysqli
// compatibility. Now this function is wrapped. // compatibility. Now this function is wrapped.
$odd_row = true;
while ($row = PMA_DBI_fetch_row($dt_result)) { while ($row = PMA_DBI_fetch_row($dt_result)) {
// lem9: "vertical display" mode stuff // lem9: "vertical display" mode stuff
if (($row_no != 0) && ($repeat_cells != 0) && !($row_no % $repeat_cells) && ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped')) { if ( $row_no != 0 && $repeat_cells != 0 && !($row_no % $repeat_cells)
&& ( $disp_direction == 'horizontal'
|| $disp_direction == 'horizontalflipped') )
{
echo '<tr>' . "\n"; echo '<tr>' . "\n";
if ( $vertical_display['emptypre'] > 0 ) {
for ($foo_i = 0; $foo_i < $vertical_display['emptypre']; $foo_i++) { echo ' <th colspan="' . $vertical_display['emptypre'] . '">' . "\n"
echo ' <th class="td">&nbsp;</th>' . "\n"; .' &nbsp;</th>' . "\n";
} }
foreach ($vertical_display['desc'] AS $key => $val) { foreach ( $vertical_display['desc'] as $val ) {
echo $val; echo $val;
} }
for ($foo_i = 0; $foo_i < $vertical_display['emptyafter']; $foo_i++) { if ( $vertical_display['emptyafter'] > 0 ) {
echo ' <th class="td">&nbsp;</th>' . "\n"; echo ' <th colspan="' . $vertical_display['emptyafter'] . '">' . "\n"
.' &nbsp;</th>' . "\n";
} }
echo '</tr>' . "\n"; echo '</tr>' . "\n";
} // end if } // end if
if (isset($GLOBALS['printview']) && ($GLOBALS['printview'] == '1')) {
$bgcolor = '#ffffff';
} else {
$bgcolor = ($row_no % 2) ? $GLOBALS['cfg']['BgcolorOne'] : $GLOBALS['cfg']['BgcolorTwo'];
}
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') { if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
// loic1: pointer code part // loic1: pointer code part
$on_mouse = ''; echo ' <tr class="' . ( $odd_row ? 'odd' : 'even' ) . '">' . "\n";
if (!isset($GLOBALS['printview']) || ($GLOBALS['printview'] != '1')) { $odd_row = ! $odd_row;
if ($GLOBALS['cfg']['BrowsePointerEnable'] == TRUE) { $bgcolor = '';
$on_mouse = ' onmouseover="setPointer(this, ' . $row_no . ', \'over\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');"' } elseif (isset($GLOBALS['printview']) && ($GLOBALS['printview'] == '1')) {
. ' onmouseout="setPointer(this, ' . $row_no . ', \'out\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');"'; $bgcolor = ' bgcolor="#ffffff" ';
} else { } else {
$on_mouse = ''; $bgcolor = ' bgcolor="' . ($row_no % 2 ? $GLOBALS['cfg']['BgcolorOne'] : $GLOBALS['cfg']['BgcolorTwo'] ) . '" ';
}
if ($GLOBALS['cfg']['BrowseMarkerEnable'] == TRUE) {
$on_mouse .= ' onmousedown="setPointer(this, ' . $row_no . ', \'click\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');"';
}
} // end if
?>
<tr<?php echo $on_mouse; ?>>
<?php
echo "\n";
} }
// 1. Prepares the row (gets primary keys to use) // 1. Prepares the row (gets primary keys to use)
// 1.1 Results from a "SELECT" statement -> builds the // 1.1 Results from a "SELECT" statement -> builds the
// "primary" key to use in links // "primary" key to use in links
@@ -1082,9 +1038,8 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
if ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn') { if ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn') {
// We need to copy the value or else the == 'both' check will always return true // We need to copy the value or else the == 'both' check will always return true
$propicon = (string)$GLOBALS['cfg']['PropertiesIconic'];
if ($propicon == 'both') { if ($GLOBALS['cfg']['PropertiesIconic'] === 'both') {
$iconic_spacer = '<div class="nowrap">'; $iconic_spacer = '<div class="nowrap">';
} else { } else {
$iconic_spacer = ''; $iconic_spacer = '';
@@ -1099,12 +1054,12 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
. '&amp;primary_key=' . $uva_condition . '&amp;primary_key=' . $uva_condition
. '&amp;sql_query=' . urlencode($url_sql_query) . '&amp;sql_query=' . urlencode($url_sql_query)
. '&amp;goto=' . urlencode($lnk_goto); . '&amp;goto=' . urlencode($lnk_goto);
if ($GLOBALS['cfg']['PropertiesIconic'] == FALSE) { if ($GLOBALS['cfg']['PropertiesIconic'] === FALSE) {
$edit_str = $GLOBALS['strEdit']; $edit_str = $GLOBALS['strEdit'];
} else { } else {
$edit_str = $iconic_spacer . '<img width="16" height="16" src="' . $GLOBALS['pmaThemeImage'] . 'b_edit.png" alt="' . $GLOBALS['strEdit'] . '" title="' . $GLOBALS['strEdit'] . '" border="0" />'; $edit_str = $iconic_spacer . '<img class="icon" width="16" height="16" src="' . $GLOBALS['pmaThemeImage'] . 'b_edit.png" alt="' . $GLOBALS['strEdit'] . '" title="' . $GLOBALS['strEdit'] . '" />';
if ($propicon == 'both') { if ($GLOBALS['cfg']['PropertiesIconic'] === 'both') {
$edit_str .= '&nbsp;' . $GLOBALS['strEdit'] . '</div>'; $edit_str .= ' ' . $GLOBALS['strEdit'] . '</div>';
} }
} }
} // end if (1.2.1) } // end if (1.2.1)
@@ -1118,12 +1073,12 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
. '&amp;SQL=' . $GLOBALS['strExecuteBookmarked'] . '&amp;SQL=' . $GLOBALS['strExecuteBookmarked']
.' " title="' . $GLOBALS['strExecuteBookmarked'] . '">'; .' " title="' . $GLOBALS['strExecuteBookmarked'] . '">';
if ($GLOBALS['cfg']['PropertiesIconic'] == FALSE) { if ($GLOBALS['cfg']['PropertiesIconic'] === FALSE) {
$bookmark_go .= $GLOBALS['strExecuteBookmarked']; $bookmark_go .= $GLOBALS['strExecuteBookmarked'];
} else { } else {
$bookmark_go .= $iconic_spacer . '<img width="16" height="16" src="' . $GLOBALS['pmaThemeImage'] . 'b_bookmark.png" alt="' . $GLOBALS['strExecuteBookmarked'] . '" title="' . $GLOBALS['strExecuteBookmarked'] . '" border="0" />'; $bookmark_go .= $iconic_spacer . '<img class="icon" width="16" height="16" src="' . $GLOBALS['pmaThemeImage'] . 'b_bookmark.png" alt="' . $GLOBALS['strExecuteBookmarked'] . '" title="' . $GLOBALS['strExecuteBookmarked'] . '" />';
if ($propicon == 'both') { if ($GLOBALS['cfg']['PropertiesIconic'] === 'both') {
$bookmark_go .= '&nbsp;' . $GLOBALS['strExecuteBookmarked'] . '</div>'; $bookmark_go .= ' ' . $GLOBALS['strExecuteBookmarked'] . '</div>';
} }
} }
@@ -1148,12 +1103,12 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
$js_conf = 'DELETE FROM ' . PMA_jsFormat($table) $js_conf = 'DELETE FROM ' . PMA_jsFormat($table)
. ' WHERE ' . trim(PMA_jsFormat(urldecode($uva_condition), FALSE)) . ' WHERE ' . trim(PMA_jsFormat(urldecode($uva_condition), FALSE))
. ' LIMIT 1'; . ' LIMIT 1';
if ($GLOBALS['cfg']['PropertiesIconic'] == FALSE) { if ($GLOBALS['cfg']['PropertiesIconic'] === FALSE) {
$del_str = $GLOBALS['strDelete']; $del_str = $GLOBALS['strDelete'];
} else { } else {
$del_str = $iconic_spacer . '<img width="16" height="16" src="' . $GLOBALS['pmaThemeImage'] . 'b_drop.png" alt="' . $GLOBALS['strDelete'] . '" title="' . $GLOBALS['strDelete'] . '" border="0" />'; $del_str = $iconic_spacer . '<img class="icon" width="16" height="16" src="' . $GLOBALS['pmaThemeImage'] . 'b_drop.png" alt="' . $GLOBALS['strDelete'] . '" title="' . $GLOBALS['strDelete'] . '" />';
if ($propicon == 'both') { if ($GLOBALS['cfg']['PropertiesIconic'] === 'both') {
$del_str .= '&nbsp;' . $GLOBALS['strDelete'] . '</div>'; $del_str .= ' ' . $GLOBALS['strDelete'] . '</div>';
} }
} }
} else if ($is_display['del_lnk'] == 'kp') { // kill process case } else if ($is_display['del_lnk'] == 'kp') { // kill process case
@@ -1167,12 +1122,12 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
. '&amp;goto=' . urlencode($lnk_goto); . '&amp;goto=' . urlencode($lnk_goto);
$del_query = urlencode('KILL ' . $row[0]); $del_query = urlencode('KILL ' . $row[0]);
$js_conf = 'KILL ' . $row[0]; $js_conf = 'KILL ' . $row[0];
if ($GLOBALS['cfg']['PropertiesIconic'] == FALSE) { if ($GLOBALS['cfg']['PropertiesIconic'] === FALSE) {
$del_str = $GLOBALS['strKill']; $del_str = $GLOBALS['strKill'];
} else { } else {
$del_str = $iconic_spacer . '<img width="16" height="16" src="' . $GLOBALS['pmaThemeImage'] . 'b_drop.png" alt="' . $GLOBALS['strKill'] . '" title="' . $GLOBALS['strKill'] . '" border="0" />'; $del_str = $iconic_spacer . '<img class="icon" width="16" height="16" src="' . $GLOBALS['pmaThemeImage'] . 'b_drop.png" alt="' . $GLOBALS['strKill'] . '" title="' . $GLOBALS['strKill'] . '" />';
if ($propicon == 'both') { if ($GLOBALS['cfg']['PropertiesIconic'] === 'both') {
$del_str .= '&nbsp;' . $GLOBALS['strKill'] . '</div>'; $del_str .= ' ' . $GLOBALS['strKill'] . '</div>';
} }
} }
} // end if (1.2.2) } // end if (1.2.2)
@@ -1183,7 +1138,6 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
$doWriteModifyAt = 'left'; $doWriteModifyAt = 'left';
require('./libraries/display_tbl_links.lib.php'); require('./libraries/display_tbl_links.lib.php');
} // end if (1.3) } // end if (1.3)
echo (($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') ? "\n" : '');
} // end if (1) } // end if (1)
// 2. Displays the rows' values // 2. Displays the rows' values
@@ -1196,7 +1150,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
// garvin: See if this column should get highlight because it's used in the // garvin: See if this column should get highlight because it's used in the
// where-query. // where-query.
if (isset($highlight_columns) && (isset($highlight_columns[$meta->name]) || isset($highlight_columns[PMA_backquote($meta->name)]))) { if (isset($highlight_columns) && (isset($highlight_columns[$meta->name]) || isset($highlight_columns[PMA_backquote($meta->name)]))) {
$column_style = 'style="border: 1px solid ' . $GLOBALS['cfg']['BrowseMarkerColor'] . '"'; $column_style = ' style="border: 1px solid ' . $GLOBALS['cfg']['BrowseMarkerColor'] . '" ';
} else { } else {
$column_style = ''; $column_style = '';
} }
@@ -1204,15 +1158,13 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
if ($disp_direction == 'vertical' && (!isset($GLOBALS['printview']) || ($GLOBALS['printview'] != '1'))) { if ($disp_direction == 'vertical' && (!isset($GLOBALS['printview']) || ($GLOBALS['printview'] != '1'))) {
if ($GLOBALS['cfg']['BrowsePointerColor'] == TRUE) { if ($GLOBALS['cfg']['BrowsePointerColor'] == TRUE) {
$column_style .= ' onmouseover="setVerticalPointer(this, ' . $row_no . ', \'over\', \'' . $GLOBALS['cfg']['BgcolorOne'] . '\', \'' . $GLOBALS['cfg']['BgcolorTwo'] . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');"' $column_style .= ' onmouseover="setVerticalPointer(this, ' . $row_no . ', \'over\', \'' . $GLOBALS['cfg']['BgcolorOne'] . '\', \'' . $GLOBALS['cfg']['BgcolorTwo'] . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');"'
. ' onmouseout="setVerticalPointer(this, ' . $row_no . ', \'out\', \'' . $GLOBALS['cfg']['BgcolorOne'] . '\', \'' . $GLOBALS['cfg']['BgcolorTwo'] . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');"'; . ' onmouseout="setVerticalPointer(this, ' . $row_no . ', \'out\', \'' . $GLOBALS['cfg']['BgcolorOne'] . '\', \'' . $GLOBALS['cfg']['BgcolorTwo'] . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');" ';
} }
if ($GLOBALS['cfg']['BrowseMarkerEnable'] == TRUE) { if ($GLOBALS['cfg']['BrowseMarkerEnable'] == TRUE) {
$column_style .= ' onmousedown="setVerticalPointer(this, ' . $row_no . ', \'click\', \'' . $GLOBALS['cfg']['BgcolorOne'] . '\', \'' . $GLOBALS['cfg']['BgcolorTwo'] . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\'); setCheckboxColumn(\'id_rows_to_delete' . $row_no . '\');"'; $column_style .= ' onmousedown="setVerticalPointer(this, ' . $row_no . ', \'click\', \'' . $GLOBALS['cfg']['BgcolorOne'] . '\', \'' . $GLOBALS['cfg']['BgcolorTwo'] . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\'); setCheckboxColumn(\'id_rows_to_delete' . $row_no . '\');" ';
} else { } else {
$column_style .= ' onmousedown="setCheckboxColumn(\'id_rows_to_delete' . $row_no . '\');" '; $column_style .= ' onmousedown="setCheckboxColumn(\'id_rows_to_delete' . $row_no . '\');" ';
} }
} else {
$column_style .= ' onmousedown="setCheckboxColumn(\'id_rows_to_delete' . $row_no . '\');" ';
}// end if }// end if
// garvin: Wrap MIME-transformations. [MIME] // garvin: Wrap MIME-transformations. [MIME]
@@ -1263,9 +1215,9 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
//if (!isset($row[$meta->name]) //if (!isset($row[$meta->name])
if (!isset($row[$i]) || is_null($row[$i])) { if (!isset($row[$i]) || is_null($row[$i])) {
$vertical_display['data'][$row_no][$i] = ' <td align="right" valign="top" ' . $column_style . ' bgcolor="' . $bgcolor . '"><i>NULL</i></td>' . "\n"; $vertical_display['data'][$row_no][$i] = ' <td align="right"' . $column_style . $bgcolor . '><i>NULL</i></td>' . "\n";
} else if ($row[$i] != '') { } else if ($row[$i] != '') {
$vertical_display['data'][$row_no][$i] = ' <td align="right" valign="top" ' . $column_style . ' bgcolor="' . $bgcolor . '" class="nowrap">'; $vertical_display['data'][$row_no][$i] = ' <td align="right"' . $column_style . $bgcolor . ' class="nowrap">';
if (isset($analyzed_sql[0]['select_expr']) && is_array($analyzed_sql[0]['select_expr'])) { if (isset($analyzed_sql[0]['select_expr']) && is_array($analyzed_sql[0]['select_expr'])) {
foreach ($analyzed_sql[0]['select_expr'] AS $select_expr_position => $select_expr) { foreach ($analyzed_sql[0]['select_expr'] AS $select_expr_position => $select_expr) {
@@ -1315,7 +1267,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
} }
$vertical_display['data'][$row_no][$i] .= '</td>' . "\n"; $vertical_display['data'][$row_no][$i] .= '</td>' . "\n";
} else { } else {
$vertical_display['data'][$row_no][$i] = ' <td align="right" ' . $column_style . ' valign="top" bgcolor="' . $bgcolor . '" class="nowrap">&nbsp;</td>' . "\n"; $vertical_display['data'][$row_no][$i] = ' <td align="right"' . $column_style . $bgcolor . ' class="nowrap">&nbsp;</td>' . "\n";
} }
// b l o b // b l o b
@@ -1339,10 +1291,10 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
$blobtext .= ']'; $blobtext .= ']';
$blobtext = ($default_function != $transform_function ? $transform_function($blobtext, $transform_options, $meta) : $default_function($blobtext, array(), $meta)); $blobtext = ($default_function != $transform_function ? $transform_function($blobtext, $transform_options, $meta) : $default_function($blobtext, array(), $meta));
$vertical_display['data'][$row_no][$i] = ' <td align="center" ' . $column_style . ' valign="top" bgcolor="' . $bgcolor . '">' . $blobtext . '</td>'; $vertical_display['data'][$row_no][$i] = ' <td align="center"' . $column_style . $bgcolor . '>' . $blobtext . '</td>';
} else { } else {
if (!isset($row[$i]) || is_null($row[$i])) { if (!isset($row[$i]) || is_null($row[$i])) {
$vertical_display['data'][$row_no][$i] = ' <td valign="top" ' . $column_style . ' bgcolor="' . $bgcolor . '"><i>NULL</i></td>' . "\n"; $vertical_display['data'][$row_no][$i] = ' <td' . $column_style . $bgcolor . '><i>NULL</i></td>' . "\n";
} else if ($row[$i] != '') { } else if ($row[$i] != '') {
// garvin: if a transform function for blob is set, none of these replacements will be made // garvin: if a transform function for blob is set, none of these replacements will be made
if (PMA_strlen($row[$i]) > $GLOBALS['cfg']['LimitChars'] && ($dontlimitchars != 1)) { if (PMA_strlen($row[$i]) > $GLOBALS['cfg']['LimitChars'] && ($dontlimitchars != 1)) {
@@ -1352,14 +1304,14 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
// characters for tabulations and <cr>/<lf> // characters for tabulations and <cr>/<lf>
$row[$i] = ($default_function != $transform_function ? $transform_function($row[$i], $transform_options, $meta) : $default_function($row[$i], array(), $meta)); $row[$i] = ($default_function != $transform_function ? $transform_function($row[$i], $transform_options, $meta) : $default_function($row[$i], array(), $meta));
$vertical_display['data'][$row_no][$i] = ' <td valign="top" ' . $column_style . ' bgcolor="' . $bgcolor . '">' . $row[$i] . '</td>' . "\n"; $vertical_display['data'][$row_no][$i] = ' <td' . $column_style . $bgcolor . '>' . $row[$i] . '</td>' . "\n";
} else { } else {
$vertical_display['data'][$row_no][$i] = ' <td valign="top" ' . $column_style . ' bgcolor="' . $bgcolor . '">&nbsp;</td>' . "\n"; $vertical_display['data'][$row_no][$i] = ' <td' . $column_style . $bgcolor . '>&nbsp;</td>' . "\n";
} }
} }
} else { } else {
if (!isset($row[$i]) || is_null($row[$i])) { if (!isset($row[$i]) || is_null($row[$i])) {
$vertical_display['data'][$row_no][$i] = ' <td valign="top" ' . $column_style . ' bgcolor="' . $bgcolor . '"><i>NULL</i></td>' . "\n"; $vertical_display['data'][$row_no][$i] = ' <td' . $column_style . $bgcolor . '><i>NULL</i></td>' . "\n";
} else if ($row[$i] != '') { } else if ($row[$i] != '') {
// loic1: support blanks in the key // loic1: support blanks in the key
$relation_id = $row[$i]; $relation_id = $row[$i];
@@ -1391,7 +1343,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
// loic1: do not wrap if date field type // loic1: do not wrap if date field type
$nowrap = ((preg_match('@DATE|TIME@i', $meta->type) || $bool_nowrap) ? ' nowrap="nowrap"' : ''); $nowrap = ((preg_match('@DATE|TIME@i', $meta->type) || $bool_nowrap) ? ' nowrap="nowrap"' : '');
$vertical_display['data'][$row_no][$i] = ' <td valign="top" ' . $column_style . ' bgcolor="' . $bgcolor . '"' . $nowrap . '>'; $vertical_display['data'][$row_no][$i] = ' <td' . $column_style . $bgcolor . $nowrap . '>';
if (isset($analyzed_sql[0]['select_expr']) && is_array($analyzed_sql[0]['select_expr'])) { if (isset($analyzed_sql[0]['select_expr']) && is_array($analyzed_sql[0]['select_expr'])) {
foreach ($analyzed_sql[0]['select_expr'] AS $select_expr_position => $select_expr) { foreach ($analyzed_sql[0]['select_expr'] AS $select_expr_position => $select_expr) {
@@ -1436,7 +1388,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
} }
$vertical_display['data'][$row_no][$i] .= '</td>' . "\n"; $vertical_display['data'][$row_no][$i] .= '</td>' . "\n";
} else { } else {
$vertical_display['data'][$row_no][$i] = ' <td valign="top" ' . $column_style . ' bgcolor="' . $bgcolor . '">&nbsp;</td>' . "\n"; $vertical_display['data'][$row_no][$i] = ' <td' . $column_style . $bgcolor . '>&nbsp;</td>' . "\n";
} }
} }
@@ -1460,7 +1412,6 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
} // end if (3) } // end if (3)
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') { if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
echo "\n";
?> ?>
</tr> </tr>
<?php <?php
@@ -1485,7 +1436,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
} }
if (!empty($del_url) && $is_display['del_lnk'] != 'kp') { if (!empty($del_url) && $is_display['del_lnk'] != 'kp') {
$vertical_display['row_delete'][$row_no] .= ' <td align="center" valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '"' . $column_style_vertical . '>' . "\n" $vertical_display['row_delete'][$row_no] .= ' <td align="center" ' . $bgcolor . $column_style_vertical . '>' . "\n"
. ' <input type="checkbox" id="id_rows_to_delete' . $row_no . '[%_PMA_CHECKBOX_DIR_%]" name="rows_to_delete[' . $uva_condition . ']"' . ' <input type="checkbox" id="id_rows_to_delete' . $row_no . '[%_PMA_CHECKBOX_DIR_%]" name="rows_to_delete[' . $uva_condition . ']"'
. ' onclick="' . $column_marker_vertical . 'copyCheckboxesRange(\'rowsDeleteForm\', \'id_rows_to_delete' . $row_no . '\',\'[%_PMA_CHECKBOX_DIR_%]\');"' . ' onclick="' . $column_marker_vertical . 'copyCheckboxesRange(\'rowsDeleteForm\', \'id_rows_to_delete' . $row_no . '\',\'[%_PMA_CHECKBOX_DIR_%]\');"'
. ' value="' . $del_query . '" ' . (isset($GLOBALS['checkall']) ? 'checked="checked"' : '') . ' />' . "\n" . ' value="' . $del_query . '" ' . (isset($GLOBALS['checkall']) ? 'checked="checked"' : '') . ' />' . "\n"
@@ -1495,7 +1446,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
} }
if (isset($edit_url)) { if (isset($edit_url)) {
$vertical_display['edit'][$row_no] .= ' <td align="center" valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '"' . $column_style_vertical . '>' . "\n" $vertical_display['edit'][$row_no] .= ' <td align="center"' . $bgcolor . $column_style_vertical . '>' . "\n"
. PMA_linkOrButton($edit_url, $edit_str, array(), FALSE) . PMA_linkOrButton($edit_url, $edit_str, array(), FALSE)
. $bookmark_go . $bookmark_go
. ' </td>' . "\n"; . ' </td>' . "\n";
@@ -1504,7 +1455,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
} }
if (isset($del_url)) { if (isset($del_url)) {
$vertical_display['delete'][$row_no] .= ' <td align="center" valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '"' . $column_style_vertical . '>' . "\n" $vertical_display['delete'][$row_no] .= ' <td align="center"' . $bgcolor . $column_style_vertical . '>' . "\n"
. PMA_linkOrButton($del_url, $del_str, (isset($js_conf) ? $js_conf : ''), FALSE) . PMA_linkOrButton($del_url, $del_str, (isset($js_conf) ? $js_conf : ''), FALSE)
. ' </td>' . "\n"; . ' </td>' . "\n";
} else { } else {
@@ -1546,9 +1497,9 @@ function PMA_displayVerticalTable()
echo '<tr>' . "\n"; echo '<tr>' . "\n";
echo $vertical_display['textbtn']; echo $vertical_display['textbtn'];
$foo_counter = 0; $foo_counter = 0;
foreach ($vertical_display['row_delete'] AS $key => $val) { foreach ($vertical_display['row_delete'] as $val) {
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) { if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
echo '<th class="td">&nbsp;</th>' . "\n"; echo '<th>&nbsp;</th>' . "\n";
} }
echo str_replace('[%_PMA_CHECKBOX_DIR_%]', '', $val); echo str_replace('[%_PMA_CHECKBOX_DIR_%]', '', $val);
@@ -1564,9 +1515,9 @@ function PMA_displayVerticalTable()
echo $vertical_display['textbtn']; echo $vertical_display['textbtn'];
} }
$foo_counter = 0; $foo_counter = 0;
foreach ($vertical_display['edit'] AS $key => $val) { foreach ($vertical_display['edit'] as $val) {
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) { if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
echo ' <th class="td">&nbsp;</th>' . "\n"; echo ' <th>&nbsp;</th>' . "\n";
} }
echo $val; echo $val;
@@ -1582,9 +1533,9 @@ function PMA_displayVerticalTable()
echo $vertical_display['textbtn']; echo $vertical_display['textbtn'];
} }
$foo_counter = 0; $foo_counter = 0;
foreach ($vertical_display['delete'] AS $key => $val) { foreach ($vertical_display['delete'] as $val) {
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) { if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
echo '<th class="td">&nbsp;</th>' . "\n"; echo '<th>&nbsp;</th>' . "\n";
} }
echo $val; echo $val;
@@ -1594,21 +1545,13 @@ function PMA_displayVerticalTable()
} // end if } // end if
// Displays data // Displays data
$row_no = 0;
foreach ($vertical_display['desc'] AS $key => $val) { foreach ($vertical_display['desc'] AS $key => $val) {
$row_no++;
if (isset($GLOBALS['printview']) && ($GLOBALS['printview'] == '1')) {
$bgcolor = '#ffffff';
} else {
$bgcolor = ($row_no % 2) ? $GLOBALS['cfg']['BgcolorOne'] : $GLOBALS['cfg']['BgcolorTwo'];
}
echo '<tr>' . "\n"; echo '<tr>' . "\n";
echo $val; echo $val;
$foo_counter = 0; $foo_counter = 0;
foreach ($vertical_display['rowdata'][$key] AS $subkey => $subval) { foreach ($vertical_display['rowdata'][$key] as $subval) {
if (($foo_counter != 0) && ($repeat_cells != 0) and !($foo_counter % $repeat_cells)) { if (($foo_counter != 0) && ($repeat_cells != 0) and !($foo_counter % $repeat_cells)) {
echo $val; echo $val;
} }
@@ -1625,9 +1568,9 @@ function PMA_displayVerticalTable()
echo '<tr>' . "\n"; echo '<tr>' . "\n";
echo $vertical_display['textbtn']; echo $vertical_display['textbtn'];
$foo_counter = 0; $foo_counter = 0;
foreach ($vertical_display['row_delete'] AS $key => $val) { foreach ($vertical_display['row_delete'] as $val) {
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) { if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
echo '<th class="td">&nbsp;</th>' . "\n"; echo '<th>&nbsp;</th>' . "\n";
} }
echo str_replace('[%_PMA_CHECKBOX_DIR_%]', 'r', $val); echo str_replace('[%_PMA_CHECKBOX_DIR_%]', 'r', $val);
@@ -1643,9 +1586,9 @@ function PMA_displayVerticalTable()
echo $vertical_display['textbtn']; echo $vertical_display['textbtn'];
} }
$foo_counter = 0; $foo_counter = 0;
foreach ($vertical_display['edit'] AS $key => $val) { foreach ($vertical_display['edit'] as $val) {
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) { if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
echo '<th class="td">&nbsp;</th>' . "\n"; echo '<th>&nbsp;</th>' . "\n";
} }
echo $val; echo $val;
@@ -1661,9 +1604,9 @@ function PMA_displayVerticalTable()
echo $vertical_display['textbtn']; echo $vertical_display['textbtn'];
} }
$foo_counter = 0; $foo_counter = 0;
foreach ($vertical_display['delete'] AS $key => $val) { foreach ($vertical_display['delete'] as $val) {
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) { if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
echo '<th class="td">&nbsp;</th>' . "\n"; echo '<th>&nbsp;</th>' . "\n";
} }
echo $val; echo $val;
@@ -1826,7 +1769,9 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
// 3. ----- Displays the results table ----- // 3. ----- Displays the results table -----
PMA_displayTableHeaders($is_display, $fields_meta, $fields_cnt, $analyzed_sql); PMA_displayTableHeaders($is_display, $fields_meta, $fields_cnt, $analyzed_sql);
$url_query=''; $url_query='';
echo '<tbody>' . "\n";
PMA_displayTableBody($dt_result, $is_display, $map, $analyzed_sql); PMA_displayTableBody($dt_result, $is_display, $map, $analyzed_sql);
echo '</tbody>' . "\n";
// vertical output case // vertical output case
if ($disp_direction == 'vertical') { if ($disp_direction == 'vertical') {
PMA_displayVerticalTable(); PMA_displayVerticalTable();
@@ -1834,16 +1779,13 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
unset($vertical_display); unset($vertical_display);
?> ?>
</table> </table>
<?php <?php
echo "\n";
// 4. ----- Displays the link for multi-fields delete // 4. ----- Displays the link for multi-fields delete
if ($is_display['del_lnk'] == 'dr' && $is_display['del_lnk'] != 'kp') { if ($is_display['del_lnk'] == 'dr' && $is_display['del_lnk'] != 'kp') {
$delete_text = $is_display['del_lnk'] == 'dr' ? $GLOBALS['strDelete'] : $GLOBALS['strKill']; $delete_text = $is_display['del_lnk'] == 'dr' ? $GLOBALS['strDelete'] : $GLOBALS['strKill'];
$propicon = (string)$GLOBALS['cfg']['PropertiesIconic'];
$uncheckall_url = 'sql.php?' $uncheckall_url = 'sql.php?'
. PMA_generate_common_url($db, $table) . PMA_generate_common_url($db, $table)
@@ -1856,36 +1798,55 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
. '&amp;goto=' . $goto . '&amp;goto=' . $goto
. '&amp;dontlimitchars=' . $dontlimitchars; . '&amp;dontlimitchars=' . $dontlimitchars;
$checkall_url = $uncheckall_url . '&amp;checkall=1'; $checkall_url = $uncheckall_url . '&amp;checkall=1';
$checkall_params['onclick'] = 'if ( markAllRows(\'rowsDeleteForm\') ) return false;';
$uncheckall_params['onclick'] = 'if ( unMarkAllRows(\'rowsDeleteForm\') ) return false;'; if ( $disp_direction == 'vertical' ) {
$checkall_params['onclick'] = 'if ( setCheckboxes(\'rowsDeleteForm\', true) ) return false;';
$uncheckall_params['onclick'] = 'if ( setCheckboxes(\'rowsDeleteForm\', false) ) return false;';
} else {
$checkall_params['onclick'] = 'if ( markAllRows(\'rowsDeleteForm\') ) return false;';
$uncheckall_params['onclick'] = 'if ( unMarkAllRows(\'rowsDeleteForm\') ) return false;';
}
$checkall_link = PMA_linkOrButton( $checkall_url, $GLOBALS['strCheckAll'], $checkall_params, false ); $checkall_link = PMA_linkOrButton( $checkall_url, $GLOBALS['strCheckAll'], $checkall_params, false );
$uncheckall_link = PMA_linkOrButton( $uncheckall_url, $GLOBALS['strUncheckAll'], $uncheckall_params, false ); $uncheckall_link = PMA_linkOrButton( $uncheckall_url, $GLOBALS['strUncheckAll'], $uncheckall_params, false );
?> if ( $disp_direction != 'vertical' ) {
&nbsp;&nbsp;<img src="<?php echo $GLOBALS['pmaThemeImage'] . 'arrow_' . $GLOBALS['text_dir'] . '.png'; ?>" border="0" width="38" height="22" alt="<?php echo $GLOBALS['strWithChecked']; ?>" /> echo '<img class="selectallarrow" width="38" height="22"'
<?php echo $checkall_link; ?> .' src="' . $GLOBALS['pmaThemeImage'] . 'arrow_' . $GLOBALS['text_dir'] . '.png' . '"'
&nbsp;/&nbsp; .' alt="' . $GLOBALS['strWithChecked'] . '" />';
<?php echo $uncheckall_link; ?> }
<?php echo $checkall_link . "\n"
echo '&nbsp;&nbsp;<i>' . $GLOBALS['strWithChecked'] . '</i>'. "\n"; .' / ' . "\n"
.$uncheckall_link . "\n"
.'<i>' . $GLOBALS['strWithChecked'] . '</i>' . "\n";
if ($GLOBALS['cfg']['PropertiesIconic']) { if ( $GLOBALS['cfg']['PropertiesIconic'] ) {
PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_change', $GLOBALS['strChange'], 'b_edit.png'); PMA_buttonOrImage('submit_mult', 'mult_submit',
PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_delete', $delete_text, 'b_drop.png'); 'submit_mult_change', $GLOBALS['strChange'], 'b_edit.png');
PMA_buttonOrImage('submit_mult', 'mult_submit',
'submit_mult_delete', $delete_text, 'b_drop.png');
if ($analyzed_sql[0]['querytype'] == 'SELECT') { if ($analyzed_sql[0]['querytype'] == 'SELECT') {
PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_export', $GLOBALS['strExport'], 'b_tblexport.png'); PMA_buttonOrImage('submit_mult', 'mult_submit',
'submit_mult_export', $GLOBALS['strExport'],
'b_tblexport.png');
} }
echo "\n"; echo "\n";
} else { } else {
echo ' <input type="submit" name="submit_mult" value="' . htmlspecialchars($GLOBALS['strEdit']) . '" title="' . $GLOBALS['strEdit'] . '" />' . "\n"; echo ' <input type="submit" name="submit_mult"'
echo '&nbsp;<input type="submit" name="submit_mult" value="' . htmlspecialchars($delete_text) . '" title="' . $delete_text . '" />' . "\n"; .' value="' . htmlspecialchars($GLOBALS['strEdit']) . '"'
.' title="' . $GLOBALS['strEdit'] . '" />' . "\n";
echo ' <input type="submit" name="submit_mult"'
.' value="' . htmlspecialchars($delete_text) . '"'
.' title="' . $delete_text . '" />' . "\n";
if ($analyzed_sql[0]['querytype'] == 'SELECT') { if ($analyzed_sql[0]['querytype'] == 'SELECT') {
echo '&nbsp;<input type="submit" name="submit_mult" value="' . htmlspecialchars($GLOBALS['strExport']) . '" title="' . $GLOBALS['strExport'] . '" />' . "\n"; echo ' <input type="submit" name="submit_mult"'
.' value="' . htmlspecialchars($GLOBALS['strExport']) . '"'
.' title="' . $GLOBALS['strExport'] . '" />' . "\n";
} }
} }
echo '<input type="hidden" name="sql_query" value="' . htmlspecialchars($sql_query) . '" />' . "\n"; echo '<input type="hidden" name="sql_query"'
.' value="' . htmlspecialchars($sql_query) . '" />' . "\n";
echo '<input type="hidden" name="pos" value="' . $pos . '" />' . "\n"; echo '<input type="hidden" name="pos" value="' . $pos . '" />' . "\n";
echo '<input type="hidden" name="url_query" value="' . $GLOBALS['url_query'] . '" />' . "\n"; echo '<input type="hidden" name="url_query"'
echo '<br />' . "\n"; .' value="' . $GLOBALS['url_query'] . '" />' . "\n";
echo '</form>' . "\n"; echo '</form>' . "\n";
} }
@@ -1901,7 +1862,8 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
function default_function($buffer) { function default_function($buffer) {
$buffer = htmlspecialchars($buffer); $buffer = htmlspecialchars($buffer);
$buffer = str_replace("\011", ' &nbsp;&nbsp;&nbsp;', str_replace(' ', ' &nbsp;', $buffer)); $buffer = str_replace("\011", ' &nbsp;&nbsp;&nbsp;',
str_replace(' ', ' &nbsp;', $buffer));
$buffer = preg_replace("@((\015\012)|(\015)|(\012))@", '<br />', $buffer); $buffer = preg_replace("@((\015\012)|(\015)|(\012))@", '<br />', $buffer);
return $buffer; return $buffer;

View File

@@ -11,37 +11,37 @@
if ( $doWriteModifyAt == 'left' ){ if ( $doWriteModifyAt == 'left' ){
if (!empty($del_url) && $is_display['del_lnk'] != 'kp') { if (!empty($del_url) && $is_display['del_lnk'] != 'kp') {
echo ' <td width="16" align="center" valign="top" bgcolor="' . $bgcolor . '">' . "\n" echo ' <td align="center">' . "\n"
. ' <input type="checkbox" id="id_rows_to_delete' . $row_no . '" name="rows_to_delete[' . $uva_condition . ']"' . ' <input type="checkbox" id="id_rows_to_delete' . $row_no . '" name="rows_to_delete[' . $uva_condition . ']"'
. ' onclick="copyCheckboxesRange(\'rowsDeleteForm\', \'id_rows_to_delete' . $row_no . '\',\'l\');"' . ' onclick="copyCheckboxesRange(\'rowsDeleteForm\', \'id_rows_to_delete' . $row_no . '\',\'l\');"'
. ' value="' . $del_query . '" ' . (isset($GLOBALS['checkall']) ? 'checked="checked"' : '') . ' />' . "\n" . ' value="' . $del_query . '" ' . (isset($GLOBALS['checkall']) ? 'checked="checked"' : '') . ' />' . "\n"
. ' </td>' . "\n"; . ' </td>' . "\n";
} }
if (!empty($edit_url)) { if (!empty($edit_url)) {
echo ' <td width="16" align="center" valign="top" bgcolor="' . $bgcolor . '">' . "\n" echo ' <td align="center">' . "\n"
. PMA_linkOrButton($edit_url, $edit_str, '', FALSE) . PMA_linkOrButton($edit_url, $edit_str, '', FALSE)
. $bookmark_go . $bookmark_go
. ' </td>' . "\n"; . ' </td>' . "\n";
} }
if (!empty($del_url)) { if (!empty($del_url)) {
echo ' <td width="16" align="center" valign="top" bgcolor="' . $bgcolor . '">' . "\n" echo ' <td align="center">' . "\n"
. PMA_linkOrButton($del_url, $del_str, (isset($js_conf) ? $js_conf : ''), FALSE) . PMA_linkOrButton($del_url, $del_str, (isset($js_conf) ? $js_conf : ''), FALSE)
. ' </td>' . "\n"; . ' </td>' . "\n";
} }
} else if ($doWriteModifyAt == 'right') { } else if ($doWriteModifyAt == 'right') {
if (!empty($del_url)) { if (!empty($del_url)) {
echo ' <td width="16" align="center" valign="top" bgcolor="' . $bgcolor . '">' . "\n" echo ' <td align="center">' . "\n"
. PMA_linkOrButton($del_url, $del_str, (isset($js_conf) ? $js_conf : ''), FALSE) . PMA_linkOrButton($del_url, $del_str, (isset($js_conf) ? $js_conf : ''), FALSE)
. ' </td>' . "\n"; . ' </td>' . "\n";
} }
if (!empty($edit_url)) { if (!empty($edit_url)) {
echo ' <td width="16" align="center" valign="top" bgcolor="' . $bgcolor . '">' . "\n" echo ' <td align="center">' . "\n"
. PMA_linkOrButton($edit_url, $edit_str, '', FALSE) . PMA_linkOrButton($edit_url, $edit_str, '', FALSE)
. $bookmark_go . $bookmark_go
. ' </td>' . "\n"; . ' </td>' . "\n";
} }
if (!empty($del_url) && $is_display['del_lnk'] != 'kp') { if (!empty($del_url) && $is_display['del_lnk'] != 'kp') {
echo ' <td width="16" align="center" valign="top" bgcolor="' . $bgcolor . '">' . "\n" echo ' <td align="center">' . "\n"
. ' <input type="checkbox" id="id_rows_to_delete' . $row_no . 'r" name="rows_to_delete[' . $uva_condition . ']"' . ' <input type="checkbox" id="id_rows_to_delete' . $row_no . 'r" name="rows_to_delete[' . $uva_condition . ']"'
. ' onclick="copyCheckboxesRange(\'rowsDeleteForm\', \'id_rows_to_delete' . $row_no . '\',\'r\');"' . ' onclick="copyCheckboxesRange(\'rowsDeleteForm\', \'id_rows_to_delete' . $row_no . '\',\'r\');"'
. ' value="' . $del_query . '" ' . (isset($GLOBALS['checkall']) ? 'checked="checked"' : '') . ' />' . "\n" . ' value="' . $del_query . '" ' . (isset($GLOBALS['checkall']) ? 'checked="checked"' : '') . ' />' . "\n"