Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add lookup for ITL components through plugin_search_component function.
  • Loading branch information
racke committed Oct 24, 2010
1 parent f8e4d13 commit 3e1abf7
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lib/WellWell/Compose/Engine/ITL.pm
Expand Up @@ -24,6 +24,7 @@ use warnings;

use Vend::Tags;

use WellWell::Core qw/plugin_search_component/;
use WellWell::Compose::Component::ITL;

sub new {
Expand All @@ -37,12 +38,21 @@ sub new {

sub locate_component {
my ($self, $name) = @_;
my ($component);
my ($directory, $component, $pref);

if (-f "$::Variable->{MV_COMPONENT_DIR}/$name") {
$component = new WellWell::Compose::Component::ITL(file => "$::Variable->{MV_COMPONENT_DIR}/$name", name => $name);
return $component;
$directory = $::Variable->{MV_COMPONENT_DIR};
}
elsif ($pref = plugin_search_component($name)) {
$directory = $pref->{directory};
}
else {
# component missing
return;
}

$component = new WellWell::Compose::Component::ITL(file => "$::Variable->{MV_COMPONENT_DIR}/$name", name => $name);
return $component;
}

1;
Expand Down

0 comments on commit 3e1abf7

Please sign in to comment.