From b53e28bd31fdaa177a4ff29314ed94b4eb1318f8 Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Wed, 17 Oct 2007 10:05:27 +0000 Subject: [PATCH] PMA_mysqlDie(): cleanup, make use of PMA_getIcon() and better use of PMA_generate_common_url() --- libraries/common.lib.php | 45 ++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 9a41e763b..d9609f778 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -550,21 +550,25 @@ function PMA_mysqlDie($error_message = '', $the_query = '', if (strstr(strtolower($formatted_sql), 'select')) { // please show me help to the error on select echo PMA_showMySQLDocu('SQL-Syntax', 'SELECT'); } - if ($is_modify_link && strlen($db)) { + if ($is_modify_link) { + $_url_params = array( + 'sql_query' => $the_query, + 'show_query' => 1, + ); if (strlen($table)) { - $doedit_goto = ''; + $_url_params['db'] = $db; + $_url_params['table'] = $table; + $doedit_goto = ''; + } elseif (strlen($db)) { + $_url_params['db'] = $db; + $doedit_goto = ''; } else { - $doedit_goto = ''; - } - if ($GLOBALS['cfg']['PropertiesIconic']) { - echo $doedit_goto - . '' . $GLOBALS['strEdit'] .'' - . ''; - } else { - echo ' [' - . $doedit_goto . $GLOBALS['strEdit'] . '' - . ']' . "\n"; + $doedit_goto = ''; } + + echo $doedit_goto + . PMA_getIcon('b_edit.png', $GLOBALS['strEdit']) + . ''; } // end if echo '

' . "\n" .'

' . "\n" @@ -600,14 +604,18 @@ function PMA_mysqlDie($error_message = '', $the_query = '', . $error_message . "\n" . '
' . "\n"; echo ''; - echo '

'; - if (!empty($back_url) && $exit) { - $goto_back_url=''; - echo '[ ' . $goto_back_url . $GLOBALS['strBack'] . ' ]'; - } - echo '
' . "\n\n"; if ($exit) { + if (! empty($back_url)) { + if (strstr($back_url, '?')) { + $back_url .= '&no_history=true'; + } else { + $back_url .= '?no_history=true'; + } + echo '
'; + echo '[ ' . $GLOBALS['strBack'] . ' ]'; + echo '
' . "\n\n"; + } /** * display footer and exit */ @@ -615,6 +623,7 @@ function PMA_mysqlDie($error_message = '', $the_query = '', } } // end of the 'PMA_mysqlDie()' function + /** * Returns a string formatted with CONVERT ... USING * if MySQL supports it