| $text{'egroup_hosts'} | \n";
print "";
foreach $h (&find("host", $mems)) {
push(@host, $h);
# if &can('r', \%access, $h);
}
foreach $g (&find("group", $mems)) {
foreach $h (&find("host", $g->{'members'})) {
push(@host, $h);
# if &can('r', \%access, $h);
$ingroup{$h} = $g->{'index'};
}
}
@host = sort { $a->{'values'}->[0] cmp $b->{'values'}->[0] } @host;
my @hosts_sel;
foreach $h (@host) {
next if !&can('r', \%access, $h);
push(@hosts_sel, ["$h->{'index'},$ingroup{$h}", $h->{'values'}->[0], ((!$in{'new'}) && $ingroup{$h} eq $group->{'index'} ? "selected" : "") ] );
}
print &ui_select("hosts", undef, \@hosts_sel, 5, 1);
print " | \n";
if (!$in{'new'}) {
# inaccessible hosts in this group
foreach $h (@host) {
if (!&can('r', \%access, $h) && $ingroup{$h} eq $group->{'index'}) {
print &ui_hidden("hosts","$h->{'index'},$group->{'index'}");
}
}
}
$assign = $in{'uidx'} ne "" ? "2" :
$in{'sidx'} ne "" ? "1" : "0";
if (!defined($in{'ret'})) {
my @labels = ( $text{'ehost_toplevel'}, $text{'ehost_inshared'},
$text{'ehost_insubnet'} );
print "";
print "| $text{'ehost_nojavascr'} | \n" if ($in{'assign'});
print "$text{'egroup_assign'} \n";
if ($in{'assign'}) {
$assign = $in{'assign'};
print "$labels[$assign] | \n";
print &ui_hidden("assign",$assign);
print &ui_hidden("jsquirk",1);
}
else {
my @assign_sel;
for ($i = 0; $i <= 2; $i++) {
push(@assign_sel, [$i, $labels[$i], ( $assign == $i ? "selected" : "" ) ]);
}
print &ui_select("assign", undef, \@assign_sel, 1, undef, undef, undef, "onChange='setparent(0)'" );
print "";
}
print "";
my @parent_sel;
if ($assign == 2) {
$iu = 0;
foreach $u (@subn) {
my $val1 = defined($shared{$u}) ? "$shared{$u},$u->{'index'}" : $u->{'index'};
my $txt1 = $subn_desc[$iu] if &can('rw', \%access, $u);
push(@parent_sel, [$val1, $txt1, ($iu == $sel_parent ? "selected" : "") ] );
$iu++;
}
}
elsif ($assign == 1) {
$is = 0;
foreach $s (@shar) {
my $txt2 = $shar_desc[$is] if &can('rw', \%access, $s);
push(@parent_sel, [$s->{'index'}, $txt1, ($is == $sel_parent ? "selected" : "") ] );
$is++;
}
}
print &ui_select("parent", undef, \@parent_sel, 5, undef, undef, undef, "width=120");
print " | \n";
print "
| \n";
print "