diff options
-rw-r--r-- | lib/AdminPanel/Category.pm | 10 | ||||
-rw-r--r-- | lib/AdminPanel/ConfigReader.pm | 12 | ||||
-rw-r--r-- | lib/AdminPanel/MainDisplay.pm | 41 | ||||
-rw-r--r-- | lib/AdminPanel/SettingsReader.pm | 3 |
4 files changed, 32 insertions, 34 deletions
diff --git a/lib/AdminPanel/Category.pm b/lib/AdminPanel/Category.pm index 825e6cd0..63c23b1f 100644 --- a/lib/AdminPanel/Category.pm +++ b/lib/AdminPanel/Category.pm @@ -51,10 +51,10 @@ use yui; sub new { my ($class, $newName, $newIcon) = @_; my $self = { - my $name = 0, - my $button = 0, - my $icon = 0, - my $modules = 0 + name => 0, + button => 0, + icon => 0, + modules => [], }; bless $self, 'AdminPanel::Category'; @@ -128,7 +128,7 @@ sub moduleLoaded { my $present = 0; - if (!$module_name) { + if (!$module_name || ! $self->{modules}) { return $present; } diff --git a/lib/AdminPanel/ConfigReader.pm b/lib/AdminPanel/ConfigReader.pm index 718a381d..1c905c94 100644 --- a/lib/AdminPanel/ConfigReader.pm +++ b/lib/AdminPanel/ConfigReader.pm @@ -30,12 +30,12 @@ sub new { my ($class, $fileName) = @_; my $self = { - my $data = 0, - my $catLen = 0, - my $currCat = 0, - my $modLen = 0, - my $currMod = 0, - my $placeHolder = 0 + data => 0, + catLen => 0, + currCat => 0, + modLen => 0, + currMod => 0, + placeHolder => 0, }; bless $self, 'AdminPanel::ConfigReader'; diff --git a/lib/AdminPanel/MainDisplay.pm b/lib/AdminPanel/MainDisplay.pm index 118fc787..72dd9b6b 100644 --- a/lib/AdminPanel/MainDisplay.pm +++ b/lib/AdminPanel/MainDisplay.pm @@ -114,27 +114,26 @@ the startup GUI. sub new { my $self = { - my $categories = 0, - my $event = 0, - my $factory = 0, - my $mainWin = 0, - my $mainLayout = 0, - my $menuLayout = 0, - my $menus = { - my $file = 0, - my $help = 0 + categories => 0, + event => 0, + factory => 0, + mainWin => 0, + mainLayout => 0, + menuLayout => 0, + menus => { + file => 0, + help => 0 }, - my $layout = 0, - my $leftPane = 0, - my $rightPane = 0, - my $currCategory = 0, - my $confDir = 0, - my $title = 0, - my $settings = 0, - my $exitButton = 0, - my $loc = 0, - my $justToGetRidOfERROR = 0, - my $replacePoint = 0 + layout => 0, + leftPane => 0, + rightPane => 0, + currCategory => 0, + confDir => 0, + title => 0, + settings => 0, + exitButton => 0, + loc => 0, + replacePoint => 0, }; bless $self, 'AdminPanel::MainDisplay'; @@ -570,6 +569,7 @@ sub _loadCategories { $tmp = $inFile->getNextMod(); my $tmpMod; my $loaded = 0; + if (exists $tmp->{title}) { if (not $currCategory->moduleLoaded($tmp->{title})) { $tmpMod = AdminPanel::Module->create(name => $tmp->{title}, @@ -588,7 +588,6 @@ sub _loadCategories { undef $tmpMod if !$loaded; } $hasNextMod = $inFile->hasNextMod(); - } } } diff --git a/lib/AdminPanel/SettingsReader.pm b/lib/AdminPanel/SettingsReader.pm index 33099bd6..ebd7a0e2 100644 --- a/lib/AdminPanel/SettingsReader.pm +++ b/lib/AdminPanel/SettingsReader.pm @@ -85,8 +85,7 @@ sub new { my ($class, $fileName) = @_; my $self = { - my $settings = 0, - my $justToGetRidOfERROR = 0 + settings => 0, }; bless $self, 'AdminPanel::SettingsReader'; |