summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndreas Brachold <vdr07@deltab.de>2008-01-25 16:24:07 +0000
committerAndreas Brachold <vdr07@deltab.de>2008-01-25 16:24:07 +0000
commitfb3e038cc7e44d3726854c7484d161886495b631 (patch)
treefca5510e21450259ac7d6238cf8fc4482877698e /lib
parent79ba68495443e4d8383320c19c3fe366819ea796 (diff)
downloadxxv-fb3e038cc7e44d3726854c7484d161886495b631.tar.gz
xxv-fb3e038cc7e44d3726854c7484d161886495b631.tar.bz2
* Tools: add date format with weekday
* Change language, now independent from external settings * EPG/TIMERS: move time formating from template to perl code * RECORDS: [Bug #13014] vfat-Recordings with '/' can't assign * AUTOTIMER: [Bug #012960] AUTOTIMER with PDC ignore user settings * AJAX: Ignore now unknown formats
Diffstat (limited to 'lib')
-rw-r--r--lib/Tools.pm7
-rw-r--r--lib/XXV/MODULES/AUTOTIMER.pm4
-rw-r--r--lib/XXV/MODULES/EPG.pm78
-rw-r--r--lib/XXV/MODULES/HTTPD.pm4
-rw-r--r--lib/XXV/MODULES/RECORDS.pm29
-rw-r--r--lib/XXV/MODULES/TIMERS.pm9
-rw-r--r--lib/XXV/OUTPUT/Ajax.pm129
7 files changed, 147 insertions, 113 deletions
diff --git a/lib/Tools.pm b/lib/Tools.pm
index 87a7587..de0c8d4 100644
--- a/lib/Tools.pm
+++ b/lib/Tools.pm
@@ -57,6 +57,9 @@ sub datum {
} elsif(lc($typ) eq 'tag') {
# day depends locale e.g. 24.12.2007 or 12/24/2007
return strftime("%x", localtime($zeit));
+ } elsif(lc($typ) eq 'weekday') {
+ # day depends locale e.g. Fryday ,24.12.2007
+ return strftime("%A, %x", localtime($zeit));
} elsif (lc($typ) eq 'int') {
# 1901-01-01T00:00+00:00
return strftime("%Y-%m-%dT%H:%M:%S%z", localtime($zeit));
@@ -186,7 +189,7 @@ sub con_err {
my $msg = shift;
if(ref $console) {
- $console->{call} = 'message'; #reset default widget, avoid own widget
+ $console->setCall('message'); #reset default widget, avoid own widget
$console->err($msg);
}
@@ -207,7 +210,7 @@ sub con_msg {
my $msg = shift;
if(ref $console) {
- $console->{call} = 'message'; #reset default widget, avoid own widget
+ $console->setCall('message'); #reset default widget, avoid own widget
$console->msg($msg);
}
diff --git a/lib/XXV/MODULES/AUTOTIMER.pm b/lib/XXV/MODULES/AUTOTIMER.pm
index fdee37e..6e6fd30 100644
--- a/lib/XXV/MODULES/AUTOTIMER.pm
+++ b/lib/XXV/MODULES/AUTOTIMER.pm
@@ -436,7 +436,7 @@ sub _autotimerLookup {
if($events->{$Id}->{subtitle});
push(@$output, [gettext("Channel"), $events->{$Id}->{channelname}]);
- if($events->{$Id}->{vpsstart} and $a->{VPS} and $modT->{usevpstime} eq 'y') {
+ if($events->{$Id}->{vpsstart} and $a->{VPS} eq 'y' and $modT->{usevpstime} eq 'y') {
push(@$output, [gettext("Start"), datum($events->{$Id}->{vpsstart} )]);
push(@$output, [gettext("Stop"), datum($events->{$Id}->{vpsstop} )]);
} else {
@@ -462,7 +462,7 @@ sub _autotimerLookup {
$event->{priority} = $a->{Priority};
$event->{lifetime} = $a->{Lifetime};
- if($event->{vpsstart} and $a->{VPS} and $modT->{usevpstime} eq 'y') {
+ if($event->{vpsstart} and $a->{VPS} eq 'y' and $modT->{usevpstime} eq 'y') {
$event->{vps} = 'y';
$event->{starttime} = $event->{vpsstart};
$event->{stoptime} = $event->{vpsstop};
diff --git a/lib/XXV/MODULES/EPG.pm b/lib/XXV/MODULES/EPG.pm
index 8b2fe39..bb66842 100644
--- a/lib/XXV/MODULES/EPG.pm
+++ b/lib/XXV/MODULES/EPG.pm
@@ -5,7 +5,6 @@ use Tools;
use File::Basename;
use Locale::gettext;
-
# This module method must exist for XXV
# ------------------
sub module {
@@ -631,18 +630,26 @@ sub search {
push(@{$search->{term}},($params->{MinLength}*60));
}
+ my %f = (
+ 'id' => gettext('Service'),
+ 'title' => gettext('Title'),
+ 'channel' => gettext('Channel'),
+ 'start' => gettext('Start'),
+ 'stop' => gettext('Stop'),
+ 'day' => gettext('Day')
+ );
my $sql = qq|
SELECT SQL_CACHE
- e.eventid as Service,
- e.title as Title,
+ e.eventid as \'$f{'id'}\',
+ e.title as \'$f{'title'}\',
e.subtitle as __Subtitle,
- c.Name as Channel,
+ c.Name as \'$f{'channel'}\',
c.POS as __Pos,
- DATE_FORMAT(e.starttime, '%H:%i') as Start,
- DATE_FORMAT(FROM_UNIXTIME(UNIX_TIMESTAMP(e.starttime) + e.duration), '%H:%i') as Stop,
- UNIX_TIMESTAMP(e.starttime) as Day,
- e.description,
+ DATE_FORMAT(e.starttime, '%H:%i') as \'$f{'start'}\',
+ DATE_FORMAT(FROM_UNIXTIME(UNIX_TIMESTAMP(e.starttime) + e.duration), '%H:%i') as \'$f{'stop'}\',
+ UNIX_TIMESTAMP(e.starttime) as \'$f{'day'}\',
+ e.description as __description,
IF(e.vpstime!=0,DATE_FORMAT(e.vpstime, '%H:%i'),'') as __PDC,
( SELECT
t.id
@@ -674,10 +681,16 @@ sub search {
$sth->execute(@{$search->{term}})
or return con_err($console, sprintf("Couldn't execute query: %s.",$sth->errstr));
$erg = $sth->fetchall_arrayref();
+ map {
+ $_->[7] = datum($_->[7],'weekday');
+ } @$erg;
unshift(@$erg, $fields);
}
- $console->table($erg);
+ my $modC = main::getModule('CHANNELS');
+ $console->table($erg, {
+ channels => $modC->ChannelArray('Name'),
+ });
}
# ------------------
@@ -699,14 +712,23 @@ sub program {
or return con_err($console, sprintf(gettext("This channel '%s' does not exist in the database!"),$channel));
}
+ my %f = (
+ 'id' => gettext('Service'),
+ 'title' => gettext('Title'),
+ 'channel' => gettext('Channel'),
+ 'start' => gettext('Start'),
+ 'stop' => gettext('Stop'),
+ 'day' => gettext('Day')
+ );
+
my $sql = qq|
SELECT SQL_CACHE
- e.eventid as Service,
- e.title as Title,
+ e.eventid as \'$f{'id'}\',
+ e.title as \'$f{'title'}\',
e.subtitle as __Subtitle,
- DATE_FORMAT(e.starttime, '%H:%i') as Start,
- DATE_FORMAT(FROM_UNIXTIME(UNIX_TIMESTAMP(e.starttime) + e.duration), '%H:%i') as Stop,
- UNIX_TIMESTAMP(e.starttime) as Day,
+ DATE_FORMAT(e.starttime, '%H:%i') as \'$f{'start'}\',
+ DATE_FORMAT(FROM_UNIXTIME(UNIX_TIMESTAMP(e.starttime) + e.duration), '%H:%i') as \'$f{'stop'}\',
+ UNIX_TIMESTAMP(e.starttime) as \'$f{'day'}\',
e.description as __Description,
e.video as __Video,
e.audio as __Audio,
@@ -740,6 +762,10 @@ order by
$sth->execute($cid)
or return con_err($console, sprintf("Couldn't execute query: %s.",$sth->errstr));
my $erg = $sth->fetchall_arrayref();
+ map {
+ $_->[5] = datum($_->[5],'weekday');
+ } @$erg;
+
unshift(@$erg, $fields);
$console->table($erg, {
@@ -776,22 +802,14 @@ sub display {
my $fields;
my $erg;
- my $start = "e.starttime";
- my $stopp = "FROM_UNIXTIME(UNIX_TIMESTAMP(e.starttime) + e.duration)";
- my $vps = "e.vpstime";
-
- $start = "UNIX_TIMESTAMP(e.starttime)" if($console->typ eq "HTML");
- $stopp = "UNIX_TIMESTAMP(e.starttime) + e.duration" if($console->typ eq "HTML");
- $vps = "UNIX_TIMESTAMP(e.vpstime)" if($console->typ eq "HTML");
-
- foreach my $table (qw/EPG OLDEPG/) {
+ foreach my $table (qw/EPG OLDEPG/) {
my $sql = qq|
SELECT SQL_CACHE
e.eventid as \'$f{'Id'}\',
e.title as \'$f{'Title'}\',
e.subtitle as \'$f{'Subtitle'}\',
- $start as \'$f{'Start'}\',
- $stopp as \'$f{'Stop'}\',
+ UNIX_TIMESTAMP(e.starttime) as \'$f{'Start'}\',
+ UNIX_TIMESTAMP(e.starttime) + e.duration as \'$f{'Stop'}\',
c.Name as \'$f{'Channel'}\',
e.description as \'$f{'Description'}\',
e.video as __Video,
@@ -813,7 +831,7 @@ SELECT SQL_CACHE
WHERE t.eventid = e.eventid
LIMIT 1) as __running,
e.image as __Image,
- IF(e.vpstime!=0,$vps,'') as __PDC,
+ UNIX_TIMESTAMP(e.vpstime) as __PDC,
e.channel_id as __channel_id
from
$table as e,CHANNELS as c
@@ -835,7 +853,13 @@ where
con_err($console, sprintf(gettext("Event '%d' does not exist in the database!"),$eventid));
return;
}
-
+ if($console->{TYP} ne 'HTML') {
+ map {
+ $_->[3] = datum($_->[3],'voll');
+ $_->[4] = datum($_->[4],'time');
+ $_->[14] = datum($_->[14],'time') if($_->[14]);
+ } @$erg;
+ }
unshift(@$erg, $fields);
$console->table($erg);
diff --git a/lib/XXV/MODULES/HTTPD.pm b/lib/XXV/MODULES/HTTPD.pm
index be18755..b245878 100644
--- a/lib/XXV/MODULES/HTTPD.pm
+++ b/lib/XXV/MODULES/HTTPD.pm
@@ -270,7 +270,7 @@ sub communicator
($userMod->{active} ne 'y'
or exists $console->{USER}->{Level})) {
- $console->{call} = 'nothing';
+ $console->setCall('nothing');
if(($data->{Request} eq '/' or $data->{Request} =~ /\.html$/) and not $data->{Query}) {
# Send the first page (index.html)
my $page = $data->{Request};
@@ -475,7 +475,7 @@ sub handleInput {
my $u = main::getModule('USER');
if($u) {
my ($cmdobj, $cmdname, $shorterr, $err) = $u->checkCommand($console, $ucmd);
- $console->{call} = $cmdname;
+ $console->setCall($cmdname);
if($cmdobj and not $shorterr) {
if($cmdobj->{binary}) {
diff --git a/lib/XXV/MODULES/RECORDS.pm b/lib/XXV/MODULES/RECORDS.pm
index 7b9f4d8..9158cba 100644
--- a/lib/XXV/MODULES/RECORDS.pm
+++ b/lib/XXV/MODULES/RECORDS.pm
@@ -1365,12 +1365,6 @@ sub display {
return;
}
- my $start = "e.starttime";
- my $stopp = "FROM_UNIXTIME(UNIX_TIMESTAMP(e.starttime) + e.duration)";
-
- $start = "UNIX_TIMESTAMP(e.starttime)" if($console->typ eq "HTML");
- $stopp = "UNIX_TIMESTAMP(e.starttime) + e.duration" if($console->typ eq "HTML");
-
my $sql = qq|
SELECT SQL_CACHE
r.RecordMD5 as RecordId,
@@ -1379,8 +1373,8 @@ SELECT SQL_CACHE
r.Marks,
r.Prio,
r.Lifetime,
- $start as StartTime,
- $stopp as StopTime,
+ UNIX_TIMESTAMP(e.starttime) as StartTime,
+ UNIX_TIMESTAMP(e.starttime) + e.duration as StopTime,
e.title as Title,
e.subtitle as SubTitle,
e.description as Description,
@@ -1397,23 +1391,28 @@ where
and RecordMD5 = ?
|;
- my $rec;
- my $fields = fields($obj->{dbh}, $sql);
+ my $erg;
+# my $fields = fields($obj->{dbh}, $sql);
my $sth = $obj->{dbh}->prepare($sql);
if(!$sth->execute($recordid)
- || !($rec = $sth->fetchrow_hashref())) {
+ || !($erg = $sth->fetchrow_hashref())) {
con_err($console,sprintf(gettext("Recording '%s' does not exist in the database!"),$recordid));
return;
}
+ if($console->{TYP} ne 'HTML') {
+ $erg->{StartTime} = datum($erg->{StartTime},'voll');
+ $erg->{StopTime} = datum($erg->{StopTime},'voll');
+ }
+
$obj->_loadreccmds;
my $param = {
- previews => $obj->getPreviewFiles($rec->{RecordId}),
+ previews => $obj->getPreviewFiles($erg->{RecordId}),
reccmds => [@{$obj->{reccmds}}],
};
- $console->table($rec, $param);
+ $console->table($erg, $param);
}
# ------------------
@@ -2265,7 +2264,7 @@ sub translate {
$title =~ s/(\.$)/\#2E/sig;
$title =~ s/(\.~)/\#2E~/sig;
} else {
- $title =~ tr# \'\/#_\x01\x02#;
+ $title =~ tr# \'\/#_\x01\x02#;
}
$title =~ tr#\/~#~\/#;
@@ -2281,13 +2280,13 @@ sub converttitle {
my $vfat = shift || $obj->{vfat};
$title =~ s/_/ /g;
+ $title =~ tr#\/~\x01\x02#~\/\'\/#;
if($vfat eq 'y') {
$title =~ s/\#([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$title =~ s/\x03/:/g; # See backward compat.. at recordings.c
}
- $title=~tr#\/~\x01\x02#~\/\'\/#;
return $title;
}
diff --git a/lib/XXV/MODULES/TIMERS.pm b/lib/XXV/MODULES/TIMERS.pm
index 9dff05d..e8ce776 100644
--- a/lib/XXV/MODULES/TIMERS.pm
+++ b/lib/XXV/MODULES/TIMERS.pm
@@ -1233,12 +1233,11 @@ SELECT SQL_CACHE
t.flags as \'$f{'flags'}\',
c.Name as \'$f{'channel'}\',
c.Pos as __pos,
- t.day as \'$f{'day'}\',
+ UNIX_TIMESTAMP(t.starttime) as \'$f{'day'}\',
DATE_FORMAT(t.starttime, '%H:%i') as \'$f{'start'}\',
DATE_FORMAT(t.stoptime, '%H:%i') as \'$f{'stop'}\',
t.file as \'$f{'title'}\',
t.priority as \'$f{'priority'}\',
- UNIX_TIMESTAMP(t.starttime) as __day,
t.collision as __collision,
t.eventid as __eventid,
t.autotimerid as __autotimerid,
@@ -1256,7 +1255,7 @@ WHERE
AND t.channel = c.Id
$search
ORDER BY
- __day
+ t.starttime
|;
my $fields = fields($obj->{dbh}, $sql);
@@ -1265,6 +1264,10 @@ ORDER BY
$sth->execute(@{$term})
or return error sprintf("Couldn't execute query: %s.",$sth->errstr);
my $erg = $sth->fetchall_arrayref();
+ map {
+ $_->[4] = datum($_->[4],'weekday');
+ } @$erg;
+
unshift(@$erg, $fields);
$console->table($erg, {
diff --git a/lib/XXV/OUTPUT/Ajax.pm b/lib/XXV/OUTPUT/Ajax.pm
index f218bab..290c1eb 100644
--- a/lib/XXV/OUTPUT/Ajax.pm
+++ b/lib/XXV/OUTPUT/Ajax.pm
@@ -13,7 +13,7 @@ $SIG{CHLD} = 'IGNORE';
# ------------------
sub module {
# ------------------
- my $obj = shift || return error('No object defined!');
+ my $self = shift || return error('No object defined!');
my $args = {
Name => 'Ajax',
Prereq => {
@@ -32,17 +32,17 @@ sub module {
# ------------------
sub AUTOLOAD {
# ------------------
- my $obj = shift || return error('No object defined!');
+ my $self = shift || return error('No object defined!');
my $data = shift || {};
my $params = shift || 0;
my $name = (split('::', $AUTOLOAD))[-1];
return if($name eq 'DESTROY');
- $obj->{nopack} = 1;
- $obj->out( $data, $params, $name );
+ $self->{nopack} = 1;
+ $self->out( $data, $params, $name );
- $obj->{call} = '';
+ $self->{call} = '';
}
# ------------------
@@ -65,30 +65,35 @@ sub new {
|| return error('No handle defined!');
$self->{cgi} = $attr{'-cgi'}
- || return error('No TemplateDir given!');
+ || return error('No cgi given!');
$self->{browser} = $attr{'-browser'}
- || return error('No Mimehash given!');
-
- $self->{xml} = XML::Simple->new()
- || return error('XML failed!');
+ || return error('No browser given!');
$self->{outtype} = $attr{'-output'}
|| return error('No output type given!');
$self->{types} = {
'xml' => 'application/xml',
+# 'json' => 'application/json; charset=utf-8', # json with utf-8
+# 'json' => 'application/json; charset=iso-8859-1', # json with iso-8859
'json' => 'text/html',
- 'html' => 'text/html',
- 'javascript' => 'text/javascript',
+ 'text' => 'text/plain',
};
# New JSON Object if required
if($self->{outtype} eq 'json') {
$self->{json} = JSON->new()
- unless(ref $self->{json});
- }
-
+ || return error("Can't create JSON instance!");
+ } elsif($self->{outtype} eq 'xml') {
+ $self->{xml} = XML::Simple->new()
+ || return error("Can't create XML instance!");
+ } elsif($self->{outtype} eq 'text') {
+ # ...
+ } else {
+ $self->{outtype} = 'text';
+# return error(sprintf("Can't create instance for typ '%s'!"),$self->{outtype});
+ }
$self->{TYP} = 'AJAX';
return $self;
@@ -97,27 +102,27 @@ sub new {
# ------------------
sub out {
# ------------------
- my $obj = shift || return error('No object defined!');
+ my $self = shift || return error('No object defined!');
my $data = shift || 0;
my $para = shift || 0;
my $name = shift || 'noName';
- my $type = shift || $obj->{types}->{$obj->{outtype}} || 'text/plain';
+ my $type = shift || $self->{types}->{$self->{outtype}} || 'text/plain';
my %args = @_;
- $obj->{nopack} = 1;
- unless(defined $obj->{header}) {
+ $self->{nopack} = 1;
+ unless(defined $self->{header}) {
# HTTP Header
- $obj->{output_header} = $obj->header($type, \%args);
+ $self->{output_header} = $self->header($type, \%args);
}
- $obj->{sendbytes}+= length($data);
+ $self->{sendbytes}+= length($data);
- if($obj->{outtype} eq 'json') {
- $obj->{output}->{data} = $data;
+ if($type ne 'application/xml') {
+ $self->{output}->{data} = $data;
} else {
- $obj->{output}->{DATA} = $data;
- $obj->{output}->{$name}->{data} = $data;
- $obj->{output}->{$name}->{params} = $para
+ $self->{output}->{DATA} = $data;
+ $self->{output}->{$name}->{data} = $data;
+ $self->{output}->{$name}->{params} = $para
if($para);
}
}
@@ -125,58 +130,58 @@ sub out {
# ------------------
sub printout {
# ------------------
- my $obj = shift || return error('No object defined!');
- my $nopack = shift || $obj->{nopack} || 0;
+ my $self = shift || return error('No object defined!');
+ my $nopack = shift || $self->{nopack} || 0;
my $content;
- if($obj->{browser}->{Method} ne 'HEAD') {
- if($obj->{outtype} eq 'xml') {
- $content = $obj->{xml}->XMLout($obj->{output});
- } elsif( $obj->{outtype} eq 'json' ) {
- if($obj->{json}->can('to_json')) { # Version 2.0 see http://search.cpan.org/~makamaka/JSON-2.04/lib/JSON.pm#Transition_ways_from_1.xx_to_2.xx.
- $content = $obj->{json}->to_json($obj->{output});
+ if($self->{browser}->{Method} ne 'HEAD') {
+ if( $self->{outtype} eq 'json' ) {
+ if($self->{json}->can('to_json')) { # Version 2.0 see http://search.cpan.org/~makamaka/JSON-2.04/lib/JSON.pm#Transition_ways_from_1.xx_to_2.xx.
+ $content = $self->{json}->to_json($self->{output});
} else { # Version 1.0
- $content = $obj->{json}->objToJson ($obj->{output});
+ $content = $self->{json}->objToJson($self->{output});
}
+ } elsif($self->{outtype} eq 'xml') {
+ $content = $self->{xml}->XMLout($self->{output});
} else {
- $content = $obj->{output}->{DATA};
+ $content = $self->{output}->{data};
}
# compress data
$content = Compress::Zlib::memGzip($content)
- if(! $nopack and $obj->{Zlib} and $obj->{browser}->{accept_gzip});
+ if(! $nopack and $self->{Zlib} and $self->{browser}->{accept_gzip});
}
if($content) {
- $obj->{handle}->print($obj->{output_header},$content);
- $obj->{sendbytes}+= length($obj->{output_header});
- $obj->{sendbytes}+= length($content);
+ $self->{handle}->print($self->{output_header},$content);
+ $self->{sendbytes}+= length($self->{output_header});
+ $self->{sendbytes}+= length($content);
} else {
- $obj->{handle}->print($obj->{output_header});
- $obj->{sendbytes}+= length($obj->{output_header});
+ $self->{handle}->print($self->{output_header});
+ $self->{sendbytes}+= length($self->{output_header});
}
- undef $obj->{output};
- undef $obj->{output_header};
- undef $obj->{nopack};
+ undef $self->{output};
+ undef $self->{output_header};
+ undef $self->{nopack};
}
# ------------------
sub header {
# ------------------
- my $obj = shift || return error('No object defined!');
+ my $self = shift || return error('No object defined!');
my $typ = shift || return error('No type defined!');
my $arg = shift || {};
$arg->{'Content-encoding'} = 'gzip'
- if($obj->{browser}->{accept_gzip} && ((!defined $obj->{nopack}) || $obj->{nopack} == 0) );
+ if($self->{browser}->{accept_gzip} && ((!defined $self->{nopack}) || $self->{nopack} == 0) );
$arg->{'Cache-Control'} = 'no-cache, must-revalidate' if(!defined $arg->{'Cache-Control'});
$arg->{'Pragma'} = 'no-cache' if(!defined $arg->{'Pragma'});
- $obj->{header} = 200;
- return $obj->{cgi}->header(
+ $self->{header} = 200;
+ return $self->{cgi}->header(
-type => $typ,
-status => "200 OK",
-expires => "now",
@@ -187,11 +192,11 @@ sub header {
# ------------------
sub headerNoAuth {
# ------------------
- my $obj = shift || return error('No object defined!');
+ my $self = shift || return error('No object defined!');
my $typ = shift || 'text/html';
- $obj->{header} = 401;
- return $obj->{cgi}->header(
+ $self->{header} = 401;
+ return $self->{cgi}->header(
-type => $typ,
-status => "401 Authorization Required\nWWW-Authenticate: Basic realm=\"xxvd\""
);
@@ -200,7 +205,7 @@ sub headerNoAuth {
# ------------------
sub msg {
# ------------------
- my $obj = shift || return error('No object defined!');
+ my $self = shift || return error('No object defined!');
my $data = shift || 0;
my $err = shift || 0;
@@ -212,33 +217,33 @@ sub msg {
$msg = sprintf('ERROR:%s (%s)', $data);
}
- $obj->out( $msg, 0, 'msg' );
+ $self->out( $msg, 0, 'msg' );
- $obj->{call} = '';
+ $self->{call} = '';
}
# ------------------
sub typ {
# ------------------
- my $obj = shift || return error('No object defined!');
- return $obj->{TYP};
+ my $self = shift || return error('No object defined!');
+ return $self->{TYP};
}
# ------------------
sub setCall {
# ------------------
- my $obj = shift || return error('No object defined!');
+ my $self = shift || return error('No object defined!');
my $name = shift || return error('No name defined!');
- $obj->{call} = $name;
- return $obj->{call};
+ $self->{call} = $name;
+ return $self->{call};
}
# ------------------
sub browser {
# ------------------
- my $obj = shift || return error('No object defined!');
- return $obj->{browser};
+ my $self = shift || return error('No object defined!');
+ return $self->{browser};
}
1;