patch #2798592 [import] Progress bar

This commit is contained in:
Marc Delisle
2009-07-02 12:12:06 +00:00
parent 1dae3a15e2
commit 60536d78e1
73 changed files with 678 additions and 24 deletions

View File

@@ -16,6 +16,8 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
+ rfe #2726479 [export] Export tables preselect
+ patch #2805828 [export] PHP array export plugin,
thanks to Geoffray Warnants - amnsk
+ patch #2798592 [import] Progress bar,
thanks to Tomas Srnka - tomassrnka
3.2.1.0 (not yet released)
- bug #2799009 Login with ipv6 IP address breaks redirect

View File

@@ -11,6 +11,11 @@
*/
require_once './libraries/common.inc.php';
/**
* Load mootools for upload progress bar
*/
$GLOBALS['js_include'][] = 'mootools.js';
/**
* Gets tables informations and displays top links
*/

View File

@@ -12,8 +12,12 @@
* Get the variables sent or posted to this script and a core script
*/
require_once './libraries/common.inc.php';
//require_once './libraries/display_import_functions.lib.php';
$GLOBALS['js_include'][] = 'functions.js';
// reset import messages for ajax request
$_SESSION['Import_message']['message'] = null;
$_SESSION['Import_message']['go_back_url'] = null;
// default values
$GLOBALS['reload'] = false;
@@ -50,11 +54,17 @@ if (!empty($sql_query)) {
// If we didn't get any parameters, either user called this directly, or
// upload limit has been reached, let's assume the second possibility.
;
if ($_POST == array() && $_GET == array()) {
require_once './libraries/header.inc.php';
$message = PMA_Message::error('strUploadLimit');
$message->addParam('[a@./Documentation.html#faq1_16@_blank]');
$message->addParam('[/a]');
// so we can obtain the message
$_SESSION['Import_message']['message'] = $message->getDisplay();
$_SESSION['Import_message']['go_back_url'] = $goto;
$message->display();
require './libraries/footer.inc.php';
}
@@ -71,12 +81,15 @@ require_once './libraries/import.lib.php';
// Create error and goto url
if ($import_type == 'table') {
$err_url = 'tbl_import.php?' . PMA_generate_common_url($db, $table);
$_SESSION['Import_message']['go_back_url'] = $err_url;
$goto = 'tbl_import.php';
} elseif ($import_type == 'database') {
$err_url = 'db_import.php?' . PMA_generate_common_url($db);
$_SESSION['Import_message']['go_back_url'] = $err_url;
$goto = 'db_import.php';
} elseif ($import_type == 'server') {
$err_url = 'server_import.php?' . PMA_generate_common_url();
$_SESSION['Import_message']['go_back_url'] = $err_url;
$goto = 'server_import.php';
} else {
if (empty($goto) || !preg_match('@^(server|db|tbl)(_[a-z]*)*\.php$@i', $goto)) {
@@ -98,6 +111,7 @@ if ($import_type == 'table') {
$err_url = $goto
. '?' . $common
. (preg_match('@^tbl_[a-z]*\.php$@', $goto) ? '&table=' . urlencode($table) : '');
$_SESSION['Import_message']['go_back_url'] = $err_url;
}
@@ -230,6 +244,7 @@ if (!empty($local_import_file) && !empty($cfg['UploadDir'])) {
}
// Do we have file to import?
if ($import_file != 'none' && !$error) {
// work around open_basedir and other limitations
$open_basedir = @ini_get('open_basedir');
@@ -243,11 +258,15 @@ if ($import_file != 'none' && !$error) {
$tmp_subdir = (PMA_IS_WINDOWS ? '.\\tmp\\' : './tmp/');
if (is_writable($tmp_subdir)) {
$import_file_new = $tmp_subdir . basename($import_file);
if (move_uploaded_file($import_file, $import_file_new)) {
$import_file = $import_file_new;
$file_to_unlink = $import_file_new;
}
$size = filesize($import_file);
}
}
@@ -320,6 +339,9 @@ if ($import_file != 'none' && !$error) {
}
}
// so we can obtain the message
//$_SESSION['Import_message'] = $message->getDisplay();
// Convert the file's charset if necessary
if ($cfg['AllowAnywhereRecoding'] && isset($charset_of_file)) {
if ($charset_of_file != $charset) {
@@ -396,6 +418,11 @@ if ($timeout_passed) {
}
}
// if there is any message, copy it into $_SESSION as well, so we can obtain it by AJAX call
if (isset($message)) {
$_SESSION['Import_message']['message'] = $message->getDisplay();
// $_SESSION['Import_message']['go_back_url'] = $goto.'?'. PMA_generate_common_url();
}
// Parse and analyze the query, for correct db and table name
// in case of a query typed in the query window
require_once './libraries/parse_analyze.lib.php';

32
import_status.php Normal file
View File

@@ -0,0 +1,32 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
*
* @version $Id$
* @package phpMyAdmin
*/
require_once './libraries/common.inc.php';
require_once './libraries/display_import_ajax.lib.php';
// AJAX requests can't be cached!
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 11 Jan 1991 06:30:00 GMT"); // Date in the past
// $GLOBALS["message"] is used for asking for an import message
if ($GLOBALS["message"]) {
header('Content-type: text/html');
while ($_SESSION['Import_message']['message']==null) // wait until message is available
usleep(250000); // 0.25 sec
echo $_SESSION['Import_message']['message'];
echo '<fieldset class="tblFooters">'."\n";
echo ' [ <a href="'.$_SESSION['Import_message']['go_back_url'].'">'.$GLOBALS["strBack"].'</a> ]' ."\n";
echo '</fieldset>'."\n";
} else {
PMA_importAjaxStatus($GLOBALS["id"]);
}
?>

View File

@@ -1487,4 +1487,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1486,4 +1486,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1488,4 +1488,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1483,4 +1483,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1462,4 +1462,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1480,4 +1480,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1462,4 +1462,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1470,4 +1470,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1486,4 +1486,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1460,4 +1460,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1483,4 +1483,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1457,4 +1457,7 @@ $strZip = '"comprimit amb zip"';
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1470,4 +1470,7 @@ $strZip = 'zip 压缩';
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1467,4 +1467,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1464,4 +1464,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1466,4 +1466,7 @@ $strSetupZipDumpExportWarning = '[a@?page=form&amp;formset=features#tab_Import_e
$strSetupZipDumpImportWarning = '[a@?page=form&amp;formset=features#tab_Import_export]Zip decompression[/a] requires functions (%s) which are unavailable on this system.'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1462,4 +1462,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1467,4 +1467,7 @@ $strZip = '"Gezipt"';
$strNavTableFilter = 'Filter';
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -381,7 +381,10 @@ $strImportExportCoords = 'Import/Export coordinates for PDF schema';
$strImportFiles = 'Import files';
$strImportFormat = 'Format of imported file';
$strImport = 'Import';
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.';
$strImportProceedingFile = 'The file is being processed, please be patient.';
$strImportSuccessfullyFinished = 'Import has been successfully finished, %d queries executed.';
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.';
$strIndexes = 'Indexes';
$strIndexesSeemEqual = 'The indexes %1$s and %2$s seem to be equal and one of them could possibly be removed.';
$strIndexHasBeenDropped = 'Index %s has been dropped';

View File

@@ -1468,4 +1468,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1463,4 +1463,7 @@ $strZip = '"zip-pakattu"';
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1459,4 +1459,7 @@ $strYes = 'Oui';
$strZeroRemovesTheLimit = 'Note: Une valeur de 0 (zero) enlève la limite.';
$strZip = '"zippé"';
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1461,4 +1461,7 @@ $strReplicationStatus_master = 'Estado do mestre';
$strReplicationStatus_slave = 'Estado do escravo';
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1467,4 +1467,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1481,4 +1481,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1485,4 +1485,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1480,4 +1480,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1488,4 +1488,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1464,4 +1464,7 @@ $strZeroRemovesTheLimit = 'Megjegyzés: Ezen beállítások 0-ra (nulla) állít
$strZip = '"zip tömörítés"';
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1478,4 +1478,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1467,4 +1467,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1468,4 +1468,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1483,4 +1483,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1485,4 +1485,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1477,4 +1477,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1463,4 +1463,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1500,4 +1500,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1483,4 +1483,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1460,4 +1460,7 @@ $strZip = 'Komprimert (zip)';
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1514,4 +1514,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1456,4 +1456,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1489,4 +1489,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1469,4 +1469,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1473,4 +1473,7 @@ $strReplicationStatusInfo = 'This MySQL server works as %s in <b>replication</b>
$strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1462,4 +1462,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1462,4 +1462,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1465,4 +1465,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1463,4 +1463,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1482,4 +1482,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1460,4 +1460,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1460,4 +1460,7 @@ $strZip = '"zippad"';
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1473,4 +1473,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1484,4 +1484,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1466,4 +1466,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -1482,4 +1482,7 @@ $strReplicationStatus_master = 'Master status'; //to translate
$strReplicationStatus_slave = 'Slave status'; //to translate
$strNavTableFilter = 'Filter'; //to translate
$strPhpArray = 'PHP array'; //to translate
$strImportLargeFileUploading = 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'; //to translate
$strImportProceedingFile = 'The file is being processed, please be patient.'; //to translate
$strImportUploadInfoNotAvailable = 'Please be patient, the file is being uploaded. Details about the upload are not available.'; //to translate
?>

View File

@@ -540,6 +540,8 @@ function PMA_mysqlDie($error_message = '', $the_query = '',
*/
require_once './libraries/header.inc.php';
$error_msg_output = '';
if (!$error_message) {
$error_message = PMA_DBI_getError();
}
@@ -562,8 +564,8 @@ function PMA_mysqlDie($error_message = '', $the_query = '',
}
}
// ---
echo "\n" . '<!-- PMA-SQL-ERROR -->' . "\n";
echo ' <div class="error"><h1>' . $GLOBALS['strError'] . '</h1>' . "\n";
$error_msg_output .= "\n" . '<!-- PMA-SQL-ERROR -->' . "\n";
$error_msg_output .= ' <div class="error"><h1>' . $GLOBALS['strError'] . '</h1>' . "\n";
// if the config password is wrong, or the MySQL server does not
// respond, do not show the query that would reveal the
// username/password
@@ -572,14 +574,14 @@ function PMA_mysqlDie($error_message = '', $the_query = '',
// Robbat2 - 12 January 2003, 9:46PM
// Revised, Robbat2 - 13 January 2003, 2:59PM
if (function_exists('PMA_SQP_isError') && PMA_SQP_isError()) {
echo PMA_SQP_getErrorString() . "\n";
echo '<br />' . "\n";
$error_msg_output .= PMA_SQP_getErrorString() . "\n";
$error_msg_output .= '<br />' . "\n";
}
// ---
// modified to show me the help on sql errors (Michael Keck)
echo ' <p><strong>' . $GLOBALS['strSQLQuery'] . ':</strong>' . "\n";
$error_msg_output .= ' <p><strong>' . $GLOBALS['strSQLQuery'] . ':</strong>' . "\n";
if (strstr(strtolower($formatted_sql), 'select')) { // please show me help to the error on select
echo PMA_showMySQLDocu('SQL-Syntax', 'SELECT');
$error_msg_output .= PMA_showMySQLDocu('SQL-Syntax', 'SELECT');
}
if ($is_modify_link) {
$_url_params = array(
@@ -597,11 +599,11 @@ function PMA_mysqlDie($error_message = '', $the_query = '',
$doedit_goto = '<a href="server_sql.php?' . PMA_generate_common_url($_url_params) . '">';
}
echo $doedit_goto
$error_msg_output .= $doedit_goto
. PMA_getIcon('b_edit.png', $GLOBALS['strEdit'])
. '</a>';
} // end if
echo ' </p>' . "\n"
$error_msg_output .= ' </p>' . "\n"
.' <p>' . "\n"
.' ' . $formatted_sql . "\n"
.' </p>' . "\n";
@@ -615,7 +617,7 @@ function PMA_mysqlDie($error_message = '', $the_query = '',
}
// modified to show me the help on error-returns (Michael Keck)
// (now error-messages-server)
echo '<p>' . "\n"
$error_msg_output .= '<p>' . "\n"
. ' <strong>' . $GLOBALS['strMySQLSaid'] . '</strong>'
. PMA_showMySQLDocu('Error-messages-server', 'Error-messages-server')
. "\n"
@@ -631,10 +633,12 @@ function PMA_mysqlDie($error_message = '', $the_query = '',
// Replace linebreaks
$error_message = nl2br($error_message);
echo '<code>' . "\n"
$error_msg_output .= '<code>' . "\n"
. $error_message . "\n"
. '</code><br />' . "\n";
echo '</div>';
$error_msg_output .= '</div>';
$_SESSION['Import_message']['message'] = $error_msg_output;
if ($exit) {
if (! empty($back_url)) {
@@ -643,13 +647,19 @@ function PMA_mysqlDie($error_message = '', $the_query = '',
} else {
$back_url .= '?no_history=true';
}
echo '<fieldset class="tblFooters">';
echo '[ <a href="' . $back_url . '">' . $GLOBALS['strBack'] . '</a> ]';
echo '</fieldset>' . "\n\n";
$_SESSION['Import_message']['go_back_url'] = $back_url;
$error_msg_output .= '<fieldset class="tblFooters">';
$error_msg_output .= '[ <a href="' . $back_url . '">' . $GLOBALS['strBack'] . '</a> ]';
$error_msg_output .= '</fieldset>' . "\n\n";
}
echo $error_msg_output;
/**
* display footer and exit
*/
require_once './libraries/footer.inc.php';
}
} // end of the 'PMA_mysqlDie()' function
@@ -940,6 +950,7 @@ function PMA_whichCrlf()
/**
* Reloads navigation if needed.
*
* @param $jsonly prints out pure JavaScript
* @uses $GLOBALS['reload']
* @uses $GLOBALS['db']
* @uses PMA_generate_common_url()
@@ -947,7 +958,7 @@ function PMA_whichCrlf()
*
* @access public
*/
function PMA_reloadNavigation()
function PMA_reloadNavigation($jsonly=false)
{
global $cfg;
@@ -960,8 +971,9 @@ function PMA_reloadNavigation()
unset($_SESSION['tmp_user_values']['table_limit_offset']);
echo "\n";
$reload_url = './navigation.php?' . PMA_generate_common_url($GLOBALS['db'], '', '&');
if (!$jsonly)
echo '<script type="text/javascript">'."\n";
?>
<script type="text/javascript">
//<![CDATA[
if (typeof(window.parent) != 'undefined'
&& typeof(window.parent.frame_navigation) != 'undefined'
@@ -969,8 +981,10 @@ if (typeof(window.parent) != 'undefined'
window.parent.goTo('<?php echo $reload_url; ?>');
}
//]]>
</script>
<?php
if (!$jsonly)
echo '</script>'."\n";
unset($GLOBALS['reload']);
}
}

View File

@@ -14,6 +14,7 @@ if (! defined('PHPMYADMIN')) {
*/
require_once './libraries/file_listing.php';
require_once './libraries/plugin_interface.lib.php';
require_once './libraries/display_import_ajax.lib.php';
/* Scan for plugins */
$import_list = PMA_getPlugins('./libraries/import/', $import_type);
@@ -25,7 +26,124 @@ if (empty($import_list)) {
}
?>
<iframe id="import_upload_iframe" name="import_upload_iframe" width="1" height="1" style="display: none" src="import.php"></iframe>
<div id="import_form_status" style="display: none;"></div>
<div id="importmain">
<script type="text/javascript">
<!--
// Mootools code for handling Ajax requests
window.addEvent('load', function() {
// webkit fix from 3rd source, but it does not work sometimes (??) --
// toms
////////////////////////////// {{{{{
Request.HTML.implement({
processHTML: function(text) {
var match = text.match(/<body[^>]*>([\s\S]*?)<\/body>/i);
text = (match) ? match[1] : text;
var container = new Element('div');
return $try(function(){
var root = '<root>' + text + '</root>', doc;
doc = new DOMParser().parseFromString(root, 'text/html');
root = doc.getElementsByTagName('root')[0];
for (var i = 0, k = root.childNodes.length; i < k; i++){
var child = Element.clone(root.childNodes[i], true, true);
if (child) container.grab(child);
}
return container;
}) || container.set('html', text);
}
});
////////////////////////// }}}}}
// add event when user click on "Go" button
$('buttonGo').addEvent('click', function() {
<?php
if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
?>
$('upload_form_status').set('html', '<div class="upload_progress_bar_outer"><div id="status" class="upload_progress_bar_inner"></div></div>'); // add the progress bar
<?php
}
?>
$('upload_form_form').setStyle("display", "none"); // hide form
$('upload_form_status').setStyle("display", "inline"); // show progress bar
$('upload_form_status_info').setStyle("display", "inline"); // - || -
var finished = false;
var percent = 0.0;
var total = 0;
var complete = 0;
var perform_upload;
var periodical_upload;
var request_upload = new Request({
url: 'import_status.php?id=<?php echo $upload_id ; ?>&<?php echo PMA_generate_common_url(); ?>', // the "&" is causing problems for webkit browsers
method: 'get',
update: 'upload_form_status',
onComplete: function(response) {
objectsReturned = JSON.decode(response);
$each(objectsReturned, function(item, index) {
if (index=="finished") {
finished = item;
if (finished==true) {
$clear(periodical_upload);
$('importmain').setStyle('display', 'none');
$('import_form_status').setStyle('display', 'inline');
$('import_form_status').set('html', '<img src="<?php echo $GLOBALS['pmaThemeImage'];?>ajax_clock_small.gif" alt="ajax clock" /> <?php echo $strImportProceedingFile; ?> ');
$('import_form_status').load('import_status.php?message=true&<?php echo PMA_generate_common_url(); ?>'); // loads the message, either success or mysql error
<?php
// reload the left sidebar when the import is finished
$GLOBALS['reload']=true;
PMA_reloadNavigation(true);
?>
} // if [finished==item]
} // if [index==finished]
if (index=="percent")
percent = item;
if (index=="total")
total = item;
if (index=="complete")
complete = item;
}); // [$each]
<?php
if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
?>
if (total==0 && complete==0 && percent==0) {
$('upload_form_status_info').set('html', '<img src="<?php echo $GLOBALS['pmaThemeImage'];?>ajax_clock_small.gif" alt="ajax clock" /> <?php echo $strImportLargeFileUploading; ?>');
$('upload_form_status').setStyle("display", "none");
} else {
$('upload_form_status_info').set('html', ' '+Math.round(percent)+'%, '+complete+'/'+total);
$('status').tween('width', Math.round(percent)*2+'px');
} //[else]
<?php
} else {
?>
$('upload_form_status_info').set('html', '<img src="<?php echo $GLOBALS['pmaThemeImage'];?>ajax_clock_small.gif" alt="ajax clock" /> <?php echo $strImportUploadInfoNotAvailable; ?>');
$('upload_form_status').setStyle("display", "none");
<?php
} //[else]
?>
} //[onComplete]
}); // [request]
perform_upload = function () {
request_upload.send('r=' + $time() + $random(0, 100)); // hack for IE7,8 & webkit (Safari, Chrome, Arora...)
}
periodical_upload = perform_upload.periodical(1000);
}); // if [buttonGo]
}); // if [load]
document.write('<form action="import.php" method="post" enctype="multipart/form-data" name="import" <?php if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") echo 'target="import_upload_iframe"'; ?>>');
-->
</script>
<noscript>
<form action="import.php" method="post" enctype="multipart/form-data" name="import">
</noscript>
<input type="hidden" name="<?php echo $ID_KEY; ?>" value="<?php echo $upload_id ; ?>" />
<?php
if ($import_type == 'server') {
echo PMA_generate_common_hidden_inputs('', '', 1);
@@ -34,16 +152,21 @@ if ($import_type == 'server') {
} else {
echo PMA_generate_common_hidden_inputs($db, $table, 1);
}
echo ' <input type="hidden" name="import_type" value="' . $import_type . '" />';
echo ' <input type="hidden" name="import_type" value="' . $import_type . '" />'."\n";
echo PMA_pluginGetJavascript($import_list);
?>
<fieldset class="options">
<legend><?php echo $strFileToImport; ?></legend>
<?php
if ($GLOBALS['is_upload']) {
$uid = uniqid("");
?>
<div class="formelementrow">
<div class="formelementrow" id="upload_form">
<div id="upload_form_status" style="display: none;"></div>
<div id="upload_form_status_info" style="display: none;"></div>
<div id="upload_form_form">
<label for="input_import_file"><?php echo $strLocationTextfile; ?></label>
<input style="margin: 5px" type="file" name="import_file" id="input_import_file" onchange="match_file(this.value);" />
<?php
@@ -52,6 +175,7 @@ if ($GLOBALS['is_upload']) {
echo PMA_generateHiddenMaxFileSize($max_upload_size) . "\n";
?>
</div>
</div>
<?php
} else {
PMA_Message::warning('strUploadsNotAllowed')->display();
@@ -185,6 +309,7 @@ echo "\n";
<input type="submit" value="<?php echo $strGo; ?>" id="buttonGo" />
</fieldset>
</form>
</div>
<script type="text/javascript">
//<![CDATA[
init_options();

View File

@@ -0,0 +1,86 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
*
* @version $Id$
* @package phpMyAdmin
*/
if (!defined('PHPMYADMIN')) {
exit;
}
/**
* constant for differenciating array in $_SESSION variable
*/
$SESSION_KEY = '__upload_status';
/**
* sets default plugin for handling the import process
*/
$_SESSION[$SESSION_KEY]["handler"] = "";
/**
* unique ID for each upload
*/
$upload_id = uniqid("");
/**
* list of available plugins
*/
$plugins = array(
"uploadprogress",
"apc",
"noplugin"
); // available plugins. Each plugin has own checkfunction in upload_functions.php and own file with functions in upload_#KEY#.php
// select available plugin
foreach ($plugins as $plugin) {
$check = "PMA_import_".$plugin."Check";
if ($check()) {
$_SESSION[$SESSION_KEY]["handler"] = $plugin;
include_once("import/upload/".$plugin.".php");
break;
}
}
/**
* Checks if APC bar extension is available and configured correctly.
*
* @return true if APC extension is available and if rfc1867 is enabled, false if it is not
*/
function PMA_import_apcCheck() {
if (!extension_loaded('apc') || !function_exists('apc_fetch') || !function_exists('getallheaders'))
return false;
return (ini_get('apc.enabled') && ini_get('apc.rfc1867'));
}
/**
* Checks if UploadProgress bar extension is available.
*
* @return true if UploadProgress extension is available, false if it is not
*/
function PMA_import_uploadprogressCheck() {
if (!function_exists("uploadprogress_get_info") || !function_exists('getallheaders'))
return false;
return true;
}
/**
* Default plugin for handling import. If no other plugin is available, noplugin is used.
*
* @return true
*/
function PMA_import_nopluginCheck() {
return true;
}
/**
* The function outputs json encoded status of uploaded. It uses PMA_getUploadStatus, which is defined in plugin's file.
*
* @param $id - ID of transfer, usually $upload_id from display_import_ajax.lib.php
*/
function PMA_importAjaxStatus($id) {
header('Content-type: application/json');
echo json_encode(PMA_getUploadStatus($id));
}
?>

View File

@@ -0,0 +1,54 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
*
* @version $Id: $
* @package phpMyAdmin
*/
if (!defined('PHPMYADMIN')) {
exit;
}
$ID_KEY = 'APC_UPLOAD_PROGRESS';
function PMA_getUploadStatus($id) {
global $SESSION_KEY;
global $ID_KEY;
if (trim($id)=="")
return;
if (!array_key_exists($id, $_SESSION[$SESSION_KEY])) {
$_SESSION[$SESSION_KEY][$id] = array(
'id' => $id,
'finished' => false,
'percent' => 0,
'total' => 0,
'complete' => 0,
'plugin' => $ID_KEY
);
}
$ret = $_SESSION[$SESSION_KEY][$id];
if (!PMA_import_apcCheck() || $ret['finished'])
return $ret;
$status = apc_fetch('upload_' . $id);
if ($status) {
$ret['finished'] = (bool)$status['done'];
$ret['total'] = $status['total'];
$ret['complete'] = $status['current'];
if ($ret['total'] > 0)
$ret['percent'] = $ret['complete'] / $ret['total'] * 100;
if ($ret['percent']==100)
$ret['finished']=(bool)true;
$_SESSION[$SESSION_KEY][$id] = $ret;
}
return $ret;
}
?>

View File

@@ -0,0 +1,36 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
*
* @version $Id: $
* @package phpMyAdmin
*/
if (!defined('PHPMYADMIN')) {
exit;
}
$ID_KEY = 'noplugin';
function PMA_getUploadStatus($id) {
global $SESSION_KEY;
global $ID_KEY;
if (trim($id)=="")
return;
if (!array_key_exists($id, $_SESSION[$SESSION_KEY])) {
$_SESSION[$SESSION_KEY][$id] = array(
'id' => $id,
'finished' => false,
'percent' => 0,
'total' => 0,
'complete' => 0,
'plugin' => $ID_KEY
);
}
$ret = $_SESSION[$SESSION_KEY][$id];
return $ret;
}
?>

View File

@@ -0,0 +1,63 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
*
* @version $Id: $
* @package phpMyAdmin
*/
if (!defined('PHPMYADMIN')) {
exit;
}
$ID_KEY = "UPLOAD_IDENTIFIER";
function PMA_getUploadStatus($id) {
global $SESSION_KEY;
global $ID_KEY;
if (trim($id)=="")
return;
if (!array_key_exists($id, $_SESSION[$SESSION_KEY])) {
$_SESSION[$SESSION_KEY][$id] = array(
'id' => $id,
'finished' => false,
'percent' => 0,
'total' => 0,
'complete' => 0,
'plugin' => $ID_KEY
);
}
$ret = $_SESSION[$SESSION_KEY][$id];
if (!PMA_import_uploadprogressCheck() || $ret['finished'])
return $ret;
$status = uploadprogress_get_info($id);
if ($status) {
if ($status['bytes_uploaded']==$status['bytes_total'])
$ret['finished'] = true;
else
$ret['finished'] = false;
$ret['total'] = $status['bytes_total'];
$ret['complete'] = $status['bytes_uploaded'];
if ($ret['total'] > 0)
$ret['percent'] = $ret['complete'] / $ret['total'] * 100;
} else {
$ret = array(
'id' => $id,
'finished' => true,
'percent' => 100,
'total' => $ret['total'],
'complete' => $ret['total'],
'plugin' => $ID_KEY
);
}
$_SESSION[$SESSION_KEY][$id] = $ret;
return $ret;
}
?>

View File

@@ -11,6 +11,12 @@
*/
require_once './libraries/common.inc.php';
/**
* Load mootools for upload progress bar
*/
$GLOBALS['js_include'][] = 'mootools.js';
/**
* Does the common work
*/

View File

@@ -11,6 +11,11 @@
*/
require_once './libraries/common.inc.php';
/**
* Load mootools for upload progress bar
*/
$GLOBALS['js_include'][] = 'mootools.js';
/**
* Gets tables informations and displays top links
*/

View File

@@ -1226,3 +1226,20 @@ code.sql {
border-bottom: 0.3em solid <?php echo $GLOBALS['cfg']['ThBackground']; ?>;
margin-bottom: 0.3em;
}
/**
* Progress bar styles
*/
div.upload_progress_bar_outer
{
border: 1px solid black;
width: 202px;
}
div.upload_progress_bar_inner
{
background-color: <?php echo (isset($_SESSION['userconf']['custom_color']) ? $_SESSION['userconf']['custom_color'] : $GLOBALS['cfg']['NaviBackground']); ?>;
width: 0px;
height: 12px;
margin: 1px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -1178,3 +1178,20 @@ code.sql {
border-bottom: 0.3em solid <?php echo $GLOBALS['cfg']['ThBackground']; ?>;
margin-bottom: 0.3em;
}
/**
* Progress bar styles
*/
div.upload_progress_bar_outer
{
border: 1px solid black;
width: 202px;
}
div.upload_progress_bar_inner
{
background-color: <?php echo (isset($_SESSION['userconf']['custom_color']) ? $_SESSION['userconf']['custom_color'] : $GLOBALS['cfg']['NaviBackground']); ?>;
width: 0px;
height: 12px;
margin: 1px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB