2007-12-31 14:43:02 +00:00
|
|
|
##############################################
|
2011-11-12 07:51:08 +00:00
|
|
|
# $Id$
|
2007-12-31 14:43:02 +00:00
|
|
|
package main;
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
|
|
|
|
#####################################
|
|
|
|
sub
|
|
|
|
weblink_Initialize($)
|
|
|
|
{
|
|
|
|
my ($hash) = @_;
|
|
|
|
|
|
|
|
$hash->{DefFn} = "weblink_Define";
|
2011-07-16 09:58:11 +00:00
|
|
|
$hash->{AttrList}= "fixedrange plotmode plotsize label title htmlattr";
|
2007-12-31 14:43:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#####################################
|
|
|
|
sub
|
|
|
|
weblink_Define($$)
|
|
|
|
{
|
|
|
|
my ($hash, $def) = @_;
|
|
|
|
my ($type, $name, $wltype, $link) = split("[ \t]+", $def, 4);
|
2012-03-04 09:20:26 +00:00
|
|
|
my %thash = ( link=>1, fileplot=>1, image=>1, iframe=>1, htmlCode=>1 );
|
2007-12-31 14:43:02 +00:00
|
|
|
|
|
|
|
if(!$link || !$thash{$wltype}) {
|
2009-12-21 18:03:56 +00:00
|
|
|
return "Usage: define <name> weblink [" .
|
|
|
|
join("|",sort keys %thash) . "] <arg>";
|
2007-12-31 14:43:02 +00:00
|
|
|
}
|
|
|
|
$hash->{WLTYPE} = $wltype;
|
|
|
|
$hash->{LINK} = $link;
|
|
|
|
$hash->{STATE} = "initial";
|
|
|
|
return undef;
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|