sub cmd_save {
open(CONF, '>'.$conffile);
- print CONF XML::Simple::XMLout($conf, KeepRoot => 1, KeyAttr => ['module', 'key']);
+ print CONF XML::Simple::XMLout($conf, KeepRoot => 1, KeyAttr => {'config' => 'module', 'option' => 'key'});
close(CONF);
}
my $p;
- unless(-r $conffile && defined($conf = XML::Simple::XMLin($conffile, ForceArray => ['config', 'option'], KeepRoot => 1, KeyAttr => ['module', 'key']))) {
+ unless(-r $conffile && defined($conf = XML::Simple::XMLin($conffile, ForceArray => ['config', 'option'], KeepRoot => 1, KeyAttr => {'config' => 'module', 'option' => 'key'}))) {
# No config, start with an empty one
write_debug(undef, 'No config found, using defaults');
$conf = { 'videosite' => { 'getter' => '' }};
my $c = shift;
my $o;
+ return $self->{'_CONFIG'} unless defined($c);
+
foreach $o (keys(%{$c->{'option'}})) {
if (exists($self->{'_CONFIG'}->{'option'}->{$o})) {
$self->{'_CONFIG'}->{'option'}->{$o}->{'content'} = $c->{'option'}->{$o}->{'content'};
my $self = shift;
my $p;
- $self->{'_CONFIG'} = { 'module' => $self->{'NAME'},
- 'option' => {}};
+ $self->{'_CONFIG'} = {'option' => {}};
foreach $p (keys(%{$self->{'_PARAMS'}})) {
$self->{'_CONFIG'}->{'option'}->{$p}->{'content'} = $self->{'_PARAMS'}->{$p}->[0];