Do I need to do anything special to make apiVersion visible to other
plugins?
Is it enough just to globally declare:
my $apiVersion = 20080829;
??
How about this:
$Plugins::SrvrPowerCtrl::Plugin::blockAction('set', 'pluginname',
'reason for blocking');
Code:
--------------------
sub blockAction {
my $set = shift;
my $caller = shift;
my $reason = shift;
my $element;
my $num;
if (!defined($set)) {
return 0;
}
if ($set eq 'set') {
push ( @{$g{aBlockAction}}, { caller => $caller, reason =>
$reason, } );
return 1;
} elsif ($set eq 'clear' ) {
$num = 0;
foreach my $element($g{aBlockAction}) {
if ($element->{'caller'} eq $caller) {
delete $g{aBlockAction}[$num];
return 1
}
$num++;
}
}
return 0;
}
--------------------
A plugin would clear it's block with:
$Plugins::SrvrPowerCtrl::Plugin::blockAction('clear', 'pluginname');
A given plugin could set multiple blocks and pop them off at it's
discretion. As long as my plugin sees $g{aBlockAction}[0] as defined,
it will refuse to take action and show the 'reason' 0 on the display.
--
gharris999
------------------------------------------------------------------------
gharris999's Profile: http://forums.slimdevices.com/member.php?userid=115
View this thread: http://forums.slimdevices.com/showthread.php?t=48521
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/plugins