Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Create database handle in constructor of WellWell::Compose::Engine::Z…
…oom class.

Allow separate directory for Zoom components.
  • Loading branch information
racke committed Nov 4, 2010
1 parent 715c4d5 commit c8b0e60
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions lib/WellWell/Compose/Engine/Zoom.pm
Expand Up @@ -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;
Expand Down

0 comments on commit c8b0e60

Please sign in to comment.