Replace table with row of buttons
This commit is contained in:
@@ -228,6 +228,7 @@ if (!$access{'edonly'}) {
|
||||
print " \n";
|
||||
|
||||
print &ui_form_end();
|
||||
$form++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,8 @@ elsif ($in{'exec'}) {
|
||||
}
|
||||
|
||||
$access{'edonly'} && &error($text{'dbase_ecannot'});
|
||||
&ui_print_header(undef, $text{'table_title2'}, "", "table_form");
|
||||
$desc = "<tt>$in{'db'}</tt>";
|
||||
&ui_print_header($desc, $text{'table_title2'}, "", "table_form");
|
||||
|
||||
print &ui_form_start("create_table.cgi", "post");
|
||||
print &ui_hidden("db", $in{'db'}),"\n";
|
||||
|
||||
+19
-39
@@ -228,71 +228,51 @@ else {
|
||||
# Display buttons for adding tables, views and so on
|
||||
sub show_buttons
|
||||
{
|
||||
print "<table><tr>\n";
|
||||
print &ui_form_start("table_form.cgi");
|
||||
print &ui_hidden("db", $in{'db'});
|
||||
|
||||
if ($access{'tables'}) {
|
||||
# Add a new table
|
||||
print &ui_form_start("table_form.cgi");
|
||||
print &ui_hidden("db", $in{'db'});
|
||||
print "<td>",&ui_submit($text{'dbase_add'})." ".$text{'dbase_fields'}.
|
||||
" ".&ui_textbox("fields", 4, 4),"</td>\n";
|
||||
print &ui_form_end();
|
||||
$form++;
|
||||
print &ui_submit($text{'dbase_add'})." ".$text{'dbase_fields'}.
|
||||
" ".&ui_textbox("fields", 4, 4);
|
||||
print " \n";
|
||||
|
||||
# Add a new view
|
||||
if (&supports_views() && $access{'views'}) {
|
||||
print &ui_form_start("edit_view.cgi");
|
||||
print &ui_hidden("db", $in{'db'});
|
||||
print &ui_hidden("new", 1);
|
||||
print "<td>",&ui_submit($text{'dbase_vadd'}),"</td>\n";
|
||||
print &ui_form_end();
|
||||
$form++;
|
||||
print &ui_submit($text{'dbase_vadd'}, 'addview');
|
||||
print " \n";
|
||||
}
|
||||
|
||||
# Add a new sequence
|
||||
if (&supports_sequences() && $access{'seqs'}) {
|
||||
print &ui_form_start("edit_seq.cgi");
|
||||
print &ui_hidden("db", $in{'db'});
|
||||
print &ui_hidden("new", 1);
|
||||
print "<td>",&ui_submit($text{'dbase_sadd'}),"</td>\n";
|
||||
print &ui_form_end();
|
||||
$form++;
|
||||
print &ui_submit($text{'dbase_sadd'}, 'addseq');
|
||||
print " \n";
|
||||
}
|
||||
}
|
||||
|
||||
# Drop database button
|
||||
if ($access{'delete'}) {
|
||||
print &ui_form_start("drop_dbase.cgi");
|
||||
print &ui_hidden("db", $in{'db'});
|
||||
print "<td>",&ui_submit($text{'dbase_drop'}),"</td>\n";
|
||||
print &ui_form_end();
|
||||
$form++;
|
||||
print &ui_submit($text{'dbase_drop'}, 'dropdb');
|
||||
print " \n";
|
||||
}
|
||||
|
||||
# Backup and restore buttons
|
||||
if (&get_postgresql_version() >= 7.2) {
|
||||
if ($access{'backup'}) {
|
||||
print &ui_form_start("backup_form.cgi");
|
||||
print &ui_hidden("db", $in{'db'});
|
||||
print "<td>",&ui_submit($text{'dbase_bkup'}),"</td>\n";
|
||||
print &ui_form_end();
|
||||
$form++;
|
||||
print &ui_submit($text{'dbase_bkup'}, 'backupdb');
|
||||
print " \n";
|
||||
}
|
||||
if ($access{'restore'}) {
|
||||
print &ui_form_start("restore_form.cgi");
|
||||
print &ui_hidden("db", $in{'db'});
|
||||
print "<td>",&ui_submit($text{'dbase_rstr'}),"</td>\n";
|
||||
print &ui_form_end();
|
||||
$form++;
|
||||
print &ui_submit($text{'dbase_rstr'}, 'restoredb');
|
||||
print " \n";
|
||||
}
|
||||
}
|
||||
|
||||
# Execute SQL form
|
||||
print &ui_form_start("exec_form.cgi");
|
||||
print &ui_hidden("db", $in{'db'});
|
||||
print "<td>",&ui_submit($text{'dbase_exec'}),"</td>\n";
|
||||
print &ui_submit($text{'dbase_exec'}, 'exec');
|
||||
print " \n";
|
||||
|
||||
print &ui_form_end();
|
||||
$form++;
|
||||
|
||||
print "</tr></table>\n";
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,35 @@
|
||||
require './postgresql-lib.pl';
|
||||
&ReadParse();
|
||||
&can_edit_db($in{'db'}) || &error($text{'dbase_ecannot'});
|
||||
&ui_print_header(undef, $text{'table_title2'}, "", "table_form");
|
||||
|
||||
# Redirect to other pages depending on button
|
||||
if ($in{'addview'}) {
|
||||
&redirect("edit_view.cgi?new=1&db=".&urlize($in{'db'}));
|
||||
return;
|
||||
}
|
||||
elsif ($in{'addseq'}) {
|
||||
&redirect("edit_seq.cgi?new=1&db=".&urlize($in{'db'}));
|
||||
return;
|
||||
}
|
||||
elsif ($in{'dropdb'}) {
|
||||
&redirect("drop_dbase.cgi?db=".&urlize($in{'db'}));
|
||||
return;
|
||||
}
|
||||
elsif ($in{'backupdb'}) {
|
||||
&redirect("backup_form.cgi?db=".&urlize($in{'db'}));
|
||||
return;
|
||||
}
|
||||
elsif ($in{'restoredb'}) {
|
||||
&redirect("restore_form.cgi?db=".&urlize($in{'db'}));
|
||||
return;
|
||||
}
|
||||
elsif ($in{'exec'}) {
|
||||
&redirect("exec_form.cgi?db=".&urlize($in{'db'}));
|
||||
return;
|
||||
}
|
||||
|
||||
$desc = "<tt>$in{'db'}</tt>";
|
||||
&ui_print_header($desc, $text{'table_title2'}, "", "table_form");
|
||||
|
||||
# Start of form block
|
||||
print &ui_form_start("create_table.cgi", "post");
|
||||
|
||||
Reference in New Issue
Block a user