mirror of
https://github.com/webmin/webmin.git
synced 2026-03-20 16:50:24 +00:00
Don't use tables for long row of buttons
This commit is contained in:
@@ -197,52 +197,37 @@ else {
|
||||
sub show_buttons
|
||||
{
|
||||
if (!$access{'edonly'}) {
|
||||
print "<table><tr>\n";
|
||||
|
||||
# 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++;
|
||||
|
||||
# Add a new table
|
||||
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_addview'}),"</td>\n";
|
||||
print &ui_form_end();
|
||||
$form++;
|
||||
print &ui_submit($text{'dbase_addview'}, 'addview');
|
||||
print " \n";
|
||||
}
|
||||
|
||||
# Delete this database
|
||||
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";
|
||||
}
|
||||
|
||||
# Open backup form
|
||||
if ($access{'buser'}) {
|
||||
print &ui_form_start("backup_form.cgi");
|
||||
print &ui_hidden("db", $in{'db'});
|
||||
print "<td>",&ui_submit($text{'dbase_backup'}),"</td>\n";
|
||||
print &ui_form_end();
|
||||
$form++;
|
||||
print &ui_submit($text{'dbase_backup'}, 'backupdb');
|
||||
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_form_end();
|
||||
$form++;
|
||||
print &ui_submit($text{'dbase_exec'}, 'exec');
|
||||
print " \n";
|
||||
|
||||
print "</tr></table>\n";
|
||||
print &ui_form_end();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,25 @@
|
||||
require './mysql-lib.pl';
|
||||
&ReadParse();
|
||||
&can_edit_db($in{'db'}) || &error($text{'dbase_ecannot'});
|
||||
|
||||
# Redirect to other pages depending on button
|
||||
if ($in{'addview'}) {
|
||||
&redirect("edit_view.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{'exec'}) {
|
||||
&redirect("exec_form.cgi?db=".&urlize($in{'db'}));
|
||||
return;
|
||||
}
|
||||
|
||||
$access{'edonly'} && &error($text{'dbase_ecannot'});
|
||||
&ui_print_header(undef, $text{'table_title2'}, "", "table_form");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user