# + add - adds a specific host group to the instance
#
+# $Id: HostGroups.pm,v 1.9 2000/10/26 19:06:52 sljohnson Exp $
+
use Spong::Host;
use Spong::HostList;
} elsif ( $grps eq "ALL" ) {
foreach $group ( keys %main::GROUPS ) {
next if $group eq 'all' && ! $main::HOSTGROUPSALL;
- next if $group->{'display'} == 0; # skip if display attr = 0
+ next if ( defined $main::GROUPS{$group}->{'display'} &&
+ $main::GROUPS{$group}->{'display'} == 0);
my $object = Spong::HostList->new( $group );
if( $object ) { $groups{$group} = $object; }
}
$self->{'group_hash'}->{$name} = $hostlist;
}
+
# Display routines. Does both text and html, does rely on both the Host and
# Service objects for some help.
#
$self->display_text( $view ) if $type eq "text";
$self->display_html( $view ) if $type eq "html";
+ $self->display_wml( $view ) if $type eq "wml";
}
# This displays a summary of all the hosts in this list in a text format
}
+# This displays a summary of all the hosts in this list in an WML format
+# suitable for displaying on WAP enabled devices
+
+sub display_wml {
+ my( $self, $format ) = @_;
+
+ if( $format eq "brief" ) {
+
+ # Go through each HostList
+ foreach $hostlist ( $self->groups() ) {
+ my $color = substr($hostlist->summary_color(),0,2);
+ $color =~ tr/a-z/A-Z/;
+ my $name = $hostlist->name();
+ print "<b><anchor title=\"$name\">$color";
+ print "<go href=\"!!WAPSPONG!!/grp-summary/$name\"/></anchor></b> ";
+ print $main::GROUPS{$hostlist->name()}->{'name'}, "<br/>\n";
+ }
+
+ }
+ elsif( $format eq "standard" ) {
+
+ # Go through each HostList
+ foreach $group ( $self->groups() ) {
+ print "<b> ",$main::GROUPS{$group->name()}->{'name'}, " </b><br/><br/>\n";
+ $group->display_wml("standard");
+ print "<br/>\n";
+ }
+ }
+}
+
+
1;