make use of PMA_Message

This commit is contained in:
Sebastian Mendel
2007-10-16 09:30:13 +00:00
parent 8cd87d9e46
commit 585f991656
5 changed files with 13 additions and 13 deletions

View File

@@ -6,7 +6,7 @@
*/ */
/** /**
* * @todo make use of PMA_Message and PMA_Error
*/ */
class PMA_Table { class PMA_Table {

View File

@@ -51,7 +51,7 @@ if (isset($submitcollation) && !empty($db_collation)) {
list($db_charset) = explode('_', $db_collation); list($db_charset) = explode('_', $db_collation);
$sql_query = 'ALTER DATABASE ' . PMA_backquote($db) . ' DEFAULT' . PMA_generateCharsetQueryPart($db_collation); $sql_query = 'ALTER DATABASE ' . PMA_backquote($db) . ' DEFAULT' . PMA_generateCharsetQueryPart($db_collation);
$result = PMA_DBI_query($sql_query); $result = PMA_DBI_query($sql_query);
$message = $strSuccess; $message = PMA_Message::success();
unset($db_charset, $db_collation); unset($db_charset, $db_collation);
} }

View File

@@ -78,7 +78,10 @@ function PMA_detectCompression($filepath)
*/ */
function PMA_importRunQuery($sql = '', $full = '', $controluser = false) function PMA_importRunQuery($sql = '', $full = '', $controluser = false)
{ {
global $import_run_buffer, $go_sql, $complete_query, $display_query, $sql_query, $cfg, $my_die, $error, $reload, $timeout_passed, $skip_queries, $executed_queries, $max_sql_len, $read_multiply, $cfg, $sql_query_disabled, $db, $run_query, $is_superuser, $message, $show_error_header; global $import_run_buffer, $go_sql, $complete_query, $display_query,
$sql_query, $cfg, $my_die, $error, $reload, $timeout_passed,
$skip_queries, $executed_queries, $max_sql_len, $read_multiply,
$cfg, $sql_query_disabled, $db, $run_query, $is_superuser;
$read_multiply = 1; $read_multiply = 1;
if (isset($import_run_buffer)) { if (isset($import_run_buffer)) {
// Should we skip something? // Should we skip something?
@@ -91,10 +94,9 @@ function PMA_importRunQuery($sql = '', $full = '', $controluser = false)
$sql_query .= $import_run_buffer['full']; $sql_query .= $import_run_buffer['full'];
} }
if (!$cfg['AllowUserDropDatabase'] if (!$cfg['AllowUserDropDatabase']
&& !$is_superuser && !$is_superuser
&& preg_match('@^[[:space:]]*DROP[[:space:]]+(IF EXISTS[[:space:]]+)?DATABASE @i', $import_run_buffer['sql'])) { && preg_match('@^[[:space:]]*DROP[[:space:]]+(IF EXISTS[[:space:]]+)?DATABASE @i', $import_run_buffer['sql'])) {
$message = $GLOBALS['strNoDropDatabases']; $GLOBALS['message'] = PMA_Message::error('strNoDropDatabases');
$show_error_header = TRUE;
$error = TRUE; $error = TRUE;
} else { } else {
$executed_queries++; $executed_queries++;

View File

@@ -520,7 +520,7 @@ function PMA_sqlQueryFormUpload(){
echo '</div>'; echo '</div>';
if ($files === FALSE) { if ($files === FALSE) {
$errors[$GLOBALS['strError']] = $GLOBALS['strWebServerUploadDirectoryError']; $errors[] = PMA_Message::error('strWebServerUploadDirectoryError');
} elseif (!empty($files)) { } elseif (!empty($files)) {
echo '<div class="formelement">'; echo '<div class="formelement">';
echo '<strong>' . $GLOBALS['strWebServerUploadDirectory'] .':</strong>' . "\n"; echo '<strong>' . $GLOBALS['strWebServerUploadDirectory'] .':</strong>' . "\n";
@@ -544,9 +544,8 @@ function PMA_sqlQueryFormUpload(){
echo '<div class="clearfloat"></div>' . "\n"; echo '<div class="clearfloat"></div>' . "\n";
echo '</fieldset>'; echo '</fieldset>';
foreach ($errors as $error => $message) { foreach ($errors as $error) {
echo '<div>' . $error . '</div>'; $error->display();
echo '<div>' . $message . '</div>';
} }
} }
?> ?>

View File

@@ -124,7 +124,6 @@ if (! defined('PMA_MINIMUM_COMMON')) {
// Revised, Robbat2 - 13 Janurary 2003, 2:59PM // Revised, Robbat2 - 13 Janurary 2003, 2:59PM
function PMA_SQP_throwError($message, $sql) function PMA_SQP_throwError($message, $sql)
{ {
global $SQP_errorString; global $SQP_errorString;
$SQP_errorString = '<p>'.$GLOBALS['strSQLParserUserError'] . '</p>' . "\n" $SQP_errorString = '<p>'.$GLOBALS['strSQLParserUserError'] . '</p>' . "\n"
. '<pre>' . "\n" . '<pre>' . "\n"
@@ -2370,7 +2369,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
case 'quote_backtick': case 'quote_backtick':
// here we check for punct_user to handle correctly // here we check for punct_user to handle correctly
// DEFINER = `username`@`%` // DEFINER = `username`@`%`
// where @ is the punct_user and `%` is the quote_backtick // where @ is the punct_user and `%` is the quote_backtick
if ($typearr[3] != 'punct_qualifier' && $typearr[3] != 'alpha_variable' && $typearr[3] != 'punct_user') { if ($typearr[3] != 'punct_qualifier' && $typearr[3] != 'alpha_variable' && $typearr[3] != 'punct_user') {
$after .= ' '; $after .= ' ';
} }