mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 18:59:33 +00:00
c74b6afb18
git-svn-id: https://svn.fhem.de/fhem/trunk@1311 2b470e98-0d58-463d-a4d8-8e2adae1ed80
38 lines
773 B
Perl
Executable File
38 lines
773 B
Perl
Executable File
##############################################
|
|
# $Id$
|
|
package main;
|
|
|
|
use strict;
|
|
use warnings;
|
|
|
|
#####################################
|
|
sub
|
|
weblink_Initialize($)
|
|
{
|
|
my ($hash) = @_;
|
|
|
|
$hash->{DefFn} = "weblink_Define";
|
|
$hash->{AttrList}= "fixedrange plotmode plotsize label title htmlattr";
|
|
}
|
|
|
|
|
|
#####################################
|
|
sub
|
|
weblink_Define($$)
|
|
{
|
|
my ($hash, $def) = @_;
|
|
my ($type, $name, $wltype, $link) = split("[ \t]+", $def, 4);
|
|
my %thash = ( link=>1, fileplot=>1, image=>1, iframe=>1, htmlCode=>1 );
|
|
|
|
if(!$link || !$thash{$wltype}) {
|
|
return "Usage: define <name> weblink [" .
|
|
join("|",sort keys %thash) . "] <arg>";
|
|
}
|
|
$hash->{WLTYPE} = $wltype;
|
|
$hash->{LINK} = $link;
|
|
$hash->{STATE} = "initial";
|
|
return undef;
|
|
}
|
|
|
|
1;
|