Skip to content
Browse files

Hide select export and import

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1096 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
1 parent 4ee2e68 commit dc667ea1a784d3c3f2978110fa7954cd15bf111a jakubvrana committed
Showing with 19 additions and 5 deletions.
  1. +3 −3 adminer/include/adminer.inc.php
  2. +10 −0 adminer/include/functions.inc.php
  3. +6 −2 adminer/select.inc.php
View
6 adminer/include/adminer.inc.php
@@ -136,7 +136,7 @@ function editVal($val, $field) {
* @return null
*/
function selectColumnsPrint($select, $columns) {
- echo '<fieldset><legend><a href="#fieldset-select" onclick="return !toggle(\'fieldset-select\');">' . lang('Select') . "</a></legend><div id='fieldset-select'" . ($select ? "" : " class='hidden'") . ">\n";
+ print_fieldset("select", lang('Select'), $select);
$i = 0;
$fun_group = array(lang('Functions') => $this->functions, lang('Aggregation') => $this->grouping);
foreach ($select as $key => $val) {
@@ -157,7 +157,7 @@ function selectColumnsPrint($select, $columns) {
* @return null
*/
function selectSearchPrint($where, $columns, $indexes) {
- echo '<fieldset><legend><a href="#fieldset-search" onclick="return !toggle(\'fieldset-search\');">' . lang('Search') . "</a></legend><div id='fieldset-search'" . ($where ? "" : " class='hidden'") . ">\n";
+ print_fieldset("search", lang('Search'), $where);
foreach ($indexes as $i => $index) {
if ($index["type"] == "FULLTEXT") {
echo "(<i>" . implode("</i>, <i>", array_map('h', $index["columns"])) . "</i>) AGAINST";
@@ -188,7 +188,7 @@ function selectSearchPrint($where, $columns, $indexes) {
* @return null
*/
function selectOrderPrint($order, $columns, $indexes) {
- echo '<fieldset><legend><a href="#fieldset-sort" onclick="return !toggle(\'fieldset-sort\');">' . lang('Sort') . "</a></legend><div id='fieldset-sort'" . ($order ? "" : " class='hidden'") . ">\n";
+ print_fieldset("sort", lang('Sort'), $order);
$i = 0;
foreach ((array) $_GET["order"] as $key => $val) {
if (isset($columns[$val])) {
View
10 adminer/include/functions.inc.php
@@ -557,3 +557,13 @@ function is_email($email) {
$domain = '[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])'; // one domain component
return eregi("^$atom+(\\.$atom+)*@($domain?\\.)+$domain\$", $email);
}
+
+/** Print header for hidden fieldset (close by </div></fieldset>)
+* @param string
+* @param string
+* @param bool
+* @return null
+*/
+function print_fieldset($id, $legend, $visible = false) {
+ echo "<fieldset><legend><a href='#fieldset-$id' onclick=\"return !toggle('fieldset-$id');\">$legend</a></legend><div id='fieldset-$id'" . ($visible ? "" : " class='hidden'") . ">\n";
+}
View
8 adminer/select.inc.php
@@ -282,9 +282,13 @@
echo " (" . lang('%d row(s)', $found_rows) . ') <label><input type="checkbox" name="all" value="1">' . lang('whole result') . "</label>\n";
echo (information_schema(DB) ? "" : "<fieldset><legend>" . lang('Edit') . "</legend><div><input type='submit' name='edit' value='" . lang('Edit') . "'> <input type='submit' name='clone' value='" . lang('Clone') . "'> <input type='submit' name='delete' value='" . lang('Delete') . "'$confirm></div></fieldset>\n");
- echo "<fieldset><legend>" . lang('Export') . "</legend><div>$dump_output $dump_format $dump_compress <input type='submit' name='export' value='" . lang('Export') . "'></div></fieldset>\n";
+ print_fieldset("export", lang('Export'));
+ echo "$dump_output $dump_format $dump_compress <input type='submit' name='export' value='" . lang('Export') . "'>\n";
+ echo "</div></fieldset>\n";
}
- echo "<fieldset><legend>" . lang('CSV Import') . "</legend><div><input type='hidden' name='token' value='$token'><input type='file' name='csv_file'> <input type='submit' name='import' value='" . lang('Import') . "'></div></fieldset>\n";
+ print_fieldset("import", lang('CSV Import'), !$result->num_rows);
+ echo "<input type='hidden' name='token' value='$token'><input type='file' name='csv_file'> <input type='submit' name='import' value='" . lang('Import') . "'>\n";
+ echo "</div></fieldset>\n";
$adminer->selectEmailPrint(array_filter($email_fields, 'strlen'), $columns);

0 comments on commit dc667ea

Please sign in to comment.
Something went wrong with that request. Please try again.