# + add - adds a specific host group to the instance
#
-# $Id: HostGroups.pm,v 1.9 2000/10/26 19:06:52 sljohnson Exp $
+# $Id: HostGroups.pm,v 1.10 2000/12/14 21:18:40 sljohnson Exp $
use Spong::Host;
use Spong::HostList;
return $_[0]->{'group_hash'}->{$_[1]}; }
sub group_names {
- return keys %{$_[0]->{'group_hash'}};
+ my( @grps, @ret );
+ # Try to use GROUPS_LIST list order, else use sorted group names
+ if ( defined @main::GROUPS_LIST ) { @grps = @main::GROUPS_LIST; }
+ else { @grps = (sort keys %main::GROUPS ); }
+ # Go thru list order, in order to sort the group names
+ foreach my $grp ( @grps ) {
+ if ( defined %{$_[0]->{'group_hash'}}->{$grp} ) {
+ push @ret,$grp;
+ }
+ }
+ return (@ret);
}
sub groups {
my $name = $service->name();
my $color = substr($service->color(),0,2);
$color =~ tr/a-z/A-Z/;
+
print "<b><anchor title=\"$name\">$color";
print "<go href=\"!!WAPSPONG!!/service/$host/$name\"/>";
print "</anchor></b> $name<br/>\n";