Skip to content

Commit

Permalink
Simplify SQL command user interface
Browse files Browse the repository at this point in the history
  • Loading branch information
vrana committed May 21, 2010
1 parent dc4fc82 commit 8f0c260
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
1 change: 1 addition & 0 deletions adminer/lang/cs.inc.php
Expand Up @@ -256,4 +256,5 @@
'Type has been created.' => 'Typ byl vytvořen.',
'Alter type' => 'Pozměnit typ',
'Search data in tables' => 'Vyhledat data v tabulkách',
'From server' => 'Ze serveru',
);
16 changes: 5 additions & 11 deletions adminer/sql.inc.php
Expand Up @@ -18,7 +18,7 @@
: "compress.bzip2://adminer.sql.bz2"
)), "rb");
$query = ($fp ? fread($fp, 1e6) : false);
} elseif ($_POST["file"]) {
} elseif ($_FILES["sql_file"]["error"] != 4) { // 4 - UPLOAD_ERR_NO_FILE
$query = get_file("sql_file", true);
}
if (is_string($query)) { // get_file() returns error as number, fread() as false
Expand Down Expand Up @@ -143,26 +143,20 @@
<input type="submit" value="<?php echo lang('Execute'); ?>">
<?php echo checkbox("error_stops", 1, $_POST["error_stops"], lang('Stop on error')); ?>

<p>
<?php
if (!ini_bool("file_uploads")) {
echo lang('File uploads are disabled.');
} else { ?>
<?php echo lang('File upload'); ?>: <input type="file" name="sql_file">
<input type="submit" name="file" value="<?php echo lang('Run file'); ?>">
<?php } ?>
echo "<p>" . (ini_bool("file_uploads") ? lang('File upload') . ': <input type="file" name="sql_file">' : lang('File uploads are disabled.'));

<p><?php
print_fieldset("webfile", lang('From server'), $_POST["webfile"]);
$compress = array();
foreach (array("gz" => "zlib", "bz2" => "bz2") as $key => $val) {
if (extension_loaded($val)) {
$compress[] = ".$key";
}
}
echo lang('Webserver file %s', "<code>adminer.sql" . ($compress ? "[" . implode("|", $compress) . "]" : "") . "</code>");
?> <input type="submit" name="webfile" value="<?php echo lang('Run file'); ?>">
echo ' <input type="submit" name="webfile" value="' . lang('Run file') . '">';
echo "</div></fieldset>\n";

<?php
if ($history) {
print_fieldset("history", lang('History'), $_GET["history"] != "");
foreach ($history as $key => $val) {
Expand Down

0 comments on commit 8f0c260

Please sign in to comment.