[wellwell-devel] [wellwell/zoom] Add lookup for ITL components through plugin_search_component function.
Stefan Hornburg
wellwell-devel at rt.icdevgroup.org
Sun Oct 24 19:50:48 UTC 2010
commit 3e1abf7c2f2c10ce8aec91fcbf4efa06e7da1874
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date: Sun Oct 24 21:48:53 2010 +0200
Add lookup for ITL components through plugin_search_component function.
lib/WellWell/Compose/Engine/ITL.pm | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/lib/WellWell/Compose/Engine/ITL.pm b/lib/WellWell/Compose/Engine/ITL.pm
index cc08e87..424a3be 100644
--- a/lib/WellWell/Compose/Engine/ITL.pm
+++ b/lib/WellWell/Compose/Engine/ITL.pm
@@ -24,6 +24,7 @@ use warnings;
use Vend::Tags;
+use WellWell::Core qw/plugin_search_component/;
use WellWell::Compose::Component::ITL;
sub new {
@@ -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;
More information about the wellwell-devel
mailing list