Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
jakubvrana committed Sep 11, 2009
1 parent 4ee2e68 commit dc667ea
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
6 changes: 3 additions & 3 deletions adminer/include/adminer.inc.php
Expand Up @@ -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) {
Expand All @@ -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";
Expand Down Expand Up @@ -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])) {
Expand Down
10 changes: 10 additions & 0 deletions adminer/include/functions.inc.php
Expand Up @@ -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";
}
8 changes: 6 additions & 2 deletions adminer/select.inc.php
Expand Up @@ -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);

Expand Down

0 comments on commit dc667ea

Please sign in to comment.