aboutsummaryrefslogtreecommitdiffstats
path: root/ConfigReader.pm
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2014-01-06 00:59:45 +0100
committerAngelo Naselli <anaselli@linux.it>2014-01-06 00:59:45 +0100
commit11533544ca01c2c54899af0a00f2c062c1831433 (patch)
treecdd13f3a209618ddde3a6927a392590238a01a4c /ConfigReader.pm
parenteb0eab8fc6d0c89262daa80d199bb7091540943b (diff)
downloadcolin-keep-11533544ca01c2c54899af0a00f2c062c1831433.tar
colin-keep-11533544ca01c2c54899af0a00f2c062c1831433.tar.gz
colin-keep-11533544ca01c2c54899af0a00f2c062c1831433.tar.bz2
colin-keep-11533544ca01c2c54899af0a00f2c062c1831433.tar.xz
colin-keep-11533544ca01c2c54899af0a00f2c062c1831433.zip
- Added a Base class for modules.
- Now configuration can be read also int /etc/categories.conf.d/ so that external modules can add their own configuration to be launched and added to admin panel - perl modules can be run by extending Module class, creating a start() method and configuring module entry in categories configuration as class element - Admin User now extends Module
Diffstat (limited to 'ConfigReader.pm')
-rw-r--r--ConfigReader.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/ConfigReader.pm b/ConfigReader.pm
index 379d144..d5ec8b1 100644
--- a/ConfigReader.pm
+++ b/ConfigReader.pm
@@ -41,6 +41,13 @@ sub new {
my $xml = new XML::Simple (KeyAttr=>[]);
$self->{data} = $xml->XMLin($fileName);
+ if (ref($self->{data}->{category}) eq "HASH") {
+ # one element alone
+ my @categories;
+ push @categories, $self->{data}->{category};
+ $self->{data}->{category} = undef;
+ push @{$self->{data}->{category}}, @categories;
+ }
$self->{catLen} = scalar(@{$self->{data}->{category}});
$self->{currCat} = -1;