[wellwell-devel] [wellwell/zoom] Create database handle in constructor of WellWell::Compose::Engine::Zoom class.
Stefan Hornburg
wellwell-devel at rt.icdevgroup.org
Thu Nov 4 11:24:53 UTC 2010
commit c8b0e606413c453fb3842b011a518a3469fbd05d
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date: Thu Nov 4 12:23:45 2010 +0100
Create database handle in constructor of WellWell::Compose::Engine::Zoom class.
Allow separate directory for Zoom components.
lib/WellWell/Compose/Engine/Zoom.pm | 19 +++++++++++++------
1 files changed, 13 insertions(+), 6 deletions(-)
---
diff --git a/lib/WellWell/Compose/Engine/Zoom.pm b/lib/WellWell/Compose/Engine/Zoom.pm
index 6719b1a..bce8968 100644
--- a/lib/WellWell/Compose/Engine/Zoom.pm
+++ b/lib/WellWell/Compose/Engine/Zoom.pm
@@ -36,14 +36,21 @@ sub new {
sub locate_component {
my ($self, $name) = @_;
- my (%component_hash, $component);
-
- if (-f "$::Variable->{MV_COMPONENT_DIR}/$name.xml"
- && -f "$::Variable->{MV_COMPONENT_DIR}/$name.html") {
+ my (%component_hash, $component, $component_dir);
+
+ $component_dir = "$::Variable->{MV_COMPONENT_DIR}/$name";
+
+ if (-d "$component_dir/$name") {
+ # separate directory for component
+ $component_dir = "$component_dir/$name";
+ }
+
+ if (-f "$component_dir/$name.xml"
+ && -f "$component_dir/$name.html") {
%component_hash = (database => $self->{database},
name => $name,
- specification => "$::Variable->{MV_COMPONENT_DIR}/$name.xml",
- template => "$::Variable->{MV_COMPONENT_DIR}/$name.html");
+ specification => "$component_dir/$name.xml",
+ template => "$component_dir/$name.html");
$component = new WellWell::Compose::Component::Zoom(%component_hash);
return $component;
More information about the wellwell-devel
mailing list