|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /usr/libexec/webmin/Webmin/ |
Upload File : |
package Webmin::Icon;
=head2 Webmin::Icon(type, [message])
This object generates an icon indicating some status. Possible types are :
ok - OK
critial - A serious problem
major - A relatively serious problem
minor - A small problem
Can be used inside tables and property lists
=cut
sub new
{
if (defined(&Webmin::Theme::Icon::new) && caller() !~ /Webmin::Theme::Icon/) {
return new Webmin::Theme::Icon(@_[1..$#_]);
}
my ($self, $type, $message) = @_;
$self = { };
bless($self);
$self->set_type($type);
$self->set_message($message) if (defined($message));
return $self;
}
=head2 html()
Returns HTML for the icon
=cut
sub html
{
my ($self) = @_;
my $rv;
$rv .= "<img src=/images/".$self->get_type().".gif align=middle>";
if ($self->get_message()) {
$rv .= " ".$self->get_message();
}
return $rv;
}
sub set_type
{
my ($self, $type) = @_;
$self->{'type'} = $type;
}
sub get_type
{
my ($self) = @_;
return $self->{'type'};
}
sub set_message
{
my ($self, $message) = @_;
$self->{'message'} = $message;
}
sub get_message
{
my ($self) = @_;
return $self->{'message'};
}
1;