\n";
+print "| $text{'ehost_desc'} | \n";
+print "";
+print &ui_textbox("desc", &html_escape($host->{'comment'}), 60);
+print " | ";
+print " ";
-print " | $text{'ehost_desc'} | \n";
-printf " | \n",
- &html_escape($host->{'comment'});
+print "| $text{'ehost_hname'} | \n";
+print "";
+print &ui_textbox("name", ( $host ? $host->{'values'}->[0] : "" ), 20);
+print " | \n";
-print " | $text{'ehost_hname'} | \n";
-printf " | \n",
- $host ? $host->{'values'}->[0] : "";
$assign = $in{'gidx'} ne "" ? "3" :
$in{'uidx'} ne "" ? "2" :
$in{'sidx'} ne "" ? "1" : "0";
if (!defined($in{'ret'})) {
- local @labels = ( $text{'ehost_toplevel'}, $text{'ehost_inshared'},
+ my @labels = ( $text{'ehost_toplevel'}, $text{'ehost_inshared'},
$text{'ehost_insubnet'}, $text{'ehost_ingroup'} );
- print "";
+ print "";
print "| $text{'ehost_nojavascr'} | \n" if ($in{'assign'});
print "$text{'ehost_assign'} \n";
if ($in{'assign'}) {
$assign = $in{'assign'};
print "$labels[$assign] | \n";
- print "\n";
- print "\n";
+ print &ui_hidden("assign",$assign);
+ print &ui_hidden("jsquirk",1);
}
else {
- print "\n";
+ print &ui_select("assign", undef, \@assign_sel, 1, undef, undef, undef, "onChange='setparent(0)'" );
+ print "\n";
}
- print " | \n";
+ print &ui_select("parent", undef, \@parent_sel, 5, undef, undef, undef, "width=120");
+ print "\n";
print "
| \n";
-
- print " \n";
+ print " \n";
}
else {
- print "\n";
- print "\n";
+ print &ui_hidden("assign",$assign);
+ print &ui_hidden("parent",$currpar);
}
$hard = $hconf ? &find("hardware", $hconf) : undef;
-print "| $text{'ehost_hwaddr'} | \n";
-print "";
-printf " | \n",
- $hard ? $hard->{'values'}->[1] : "";
+print "$text{'ehost_hwaddr'} | \n";
+print "";
+my @hardware_type_sel;
+my @hardware = ("ethernet","token-ring","fddi");
+foreach my $hv (@hardware) {
+ push(@hardware_type_sel, [$hv,$hv, ($hard && $hard->{'values'}->[0] eq $hv ? "selected" : "")] );
+}
+print &ui_select("hardware_type", undef, \@hardware_type_sel, 1);
+print &ui_textbox("hardware", ( $hard ? $hard->{'values'}->[1] : "" ), 18);
+print " | \n";
$fixed = $host ? &find("fixed-address", $hconf) : "";
-print " | $text{'ehost_fixedip'} | \n";
-printf " | \n",
- $fixed ? join(" ", grep { $_ ne "," } @{$fixed->{'values'}}) : "";
+print " | $text{'ehost_fixedip'} | \n";
+print &ui_textbox("fixed-address", ( $fixed ? join(" ", grep { $_ ne "," } @{$fixed->{'values'}}) : "" ), 20);
+print " | \n";
&display_params($hconf, "host");
-print "
| \n";
-print "\n";
-print "\n";
-print "\n";
+print &ui_table_end();
+
+print &ui_hidden("gidx",$in{'gidx'});
+print &ui_hidden("uidx",$in{'uidx'});
+print &ui_hidden("sidx",$in{'sidx'});
+
if (!$in{'new'}) {
- print "\n";
+ print &ui_hidden("idx",$in{'idx'});
print "\n";
- print " | \n"
- if &can('rw', \%access, $host);
- print " | \n";
- print " | \n"
- if &can('rw', \%access, $host, 1);
+ print "".&ui_submit($text{'save'})." | " if &can('rw', \%access, $host);
+ print "".&ui_submit(( &can('rw', \%access, $host) ? $text{'butt_eco'} : $text{'butt_vco'} ),"options")." | ";
+ print "".&ui_submit($text{'delete'},"delete")." | " if &can('rw', \%access, $host, 1);
print " \n";
}
else {
- print "\n";
- print "\n";
+ print &ui_hidden("new",1);
+ print &ui_submit($text{'butt_create'});
}
-print "\n";
+
+print &ui_form_end();
+
print &script_fn() if (!defined($in{'ret'}));
if ($in{'ret'} eq "group") {
&ui_print_footer("edit_group.cgi?sidx=$in{'sidx'}&uidx=$in{'uidx'}&idx=$in{'gidx'}",
@@ -298,7 +288,7 @@ else {
sub script_fn
{
return <
+ |