Export only SELECT queries, do not show multi row actions when no checkboxes shown.

This commit is contained in:
Michal Čihař
2004-05-03 13:52:36 +00:00
parent af00a22cdd
commit 71c24b8e76
3 changed files with 15 additions and 8 deletions

View File

@@ -15,6 +15,8 @@ $Source$
css/phpmyadmin.css.php: Get rid of wrap="virtual" to achieve more XHTML
validity.
* libraries/common.lib.php, lang/*: Add Refresh link (RFE #942110).
* sql.php, libraries/display_tbl.lib.php: Export only SELECT queries, do
not show multi row actions when no checkboxes shown.
2004-05-03 Garvin Hicking <pma@supergarv.de>
* left.php: Bug #946501 - Nested table now also work with aliased

View File

@@ -1797,7 +1797,7 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
// 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'];
$propicon = (string)$GLOBALS['cfg']['PropertiesIconic'];
@@ -1816,22 +1816,27 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
echo '&nbsp;<button class="mult_submit" type="submit" name="submit_mult" value="row_delete" title="' . $delete_text . '">' . "\n"
. '<img src="./images/button_drop.png" title="' . $delete_text . '" alt="' . $delete_text . '" width="12" height="13" />' . (($propicon == 'both') ? '&nbsp;' . $delete_text : '') . "\n"
. '</button>';
if ($analyzed_sql[0]['querytype'] == 'SELECT') {
echo '&nbsp;<button class="mult_submit" type="submit" name="submit_mult" value="row_export" title="' . $GLOBALS['strExport'] . '">' . "\n"
. '<img src="./images/button_export.png" title="' . $GLOBALS['strExport'] . '" alt="' . $GLOBALS['strExport'] . '" width="12" height="13" />' . (($propicon == 'both') ? '&nbsp;' . $GLOBALS['strExport'] : '') . "\n"
. '</button>';
}
} else {
echo ' <input type="image" name="submit_mult_edit" value="row_edit" title="' . $GLOBALS['strEdit'] . '" src="./images/button_edit.png" />' . (($propicon == 'both') ? '&nbsp;' . $GLOBALS['strEdit'] : '');
echo '&nbsp;<input type="image" name="submit_mult" value="row_delete" title="' . $delete_text . '" src="./images/button_drop.png" />' . (($propicon == 'both') ? '&nbsp;' . $delete_text : '');
if ($analyzed_sql[0]['querytype'] == 'SELECT') {
echo '&nbsp;<input type="image" name="submit_mult_export" value="row_export" title="' . $GLOBALS['strExport'] . '" src="./images/button_export.png" />' . (($propicon == 'both') ? '&nbsp;' . $GLOBALS['strExport'] : '');
}
}
echo "\n";
} else {
echo ' <input type="submit" name="submit_mult" value="' . htmlspecialchars($GLOBALS['strEdit']) . '" title="' . $GLOBALS['strEdit'] . '" />' . "\n";
echo '&nbsp;<input type="submit" name="submit_mult" value="' . htmlspecialchars($delete_text) . '" title="' . $delete_text . '" />' . "\n";
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="hidden" name="sql_query" value="' . $encoded_sql_query . '" />' . "\n";
echo '<input type="hidden" name="pos" value="' . $pos . '" />' . "\n";
echo '<input type="hidden" name="url_query" value="' . $GLOBALS['url_query'] . '" />' . "\n";

View File

@@ -726,7 +726,7 @@ else {
// (the url_query has extra parameters that won't be used to export)
// (the single_table parameter is used in display_export.lib.php
// to hide the SQL and the structure export dialogs)
if (!isset($printview)) {
if ($analyzed_sql[0]['querytype'] == 'SELECT' && !isset($printview)) {
if (isset($analyzed_sql[0]['table_ref'][0]['table_true_name']) && !isset($analyzed_sql[0]['table_ref'][1]['table_true_name'])) {
$single_table = '&amp;single_table=true';
} else {