[wellwell-devel] [wellwell/zoom] Call component load hook for Zoom components.

Stefan Hornburg wellwell-devel at rt.icdevgroup.org
Tue Dec 7 15:37:33 UTC 2010


commit 3b854276fc115c8585ec79bf26515f3586a73fa3
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Tue Dec 7 16:37:12 2010 +0100

    Call component load hook for Zoom components.

 lib/WellWell/Compose/Component/Zoom.pm |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/lib/WellWell/Compose/Component/Zoom.pm b/lib/WellWell/Compose/Component/Zoom.pm
index 67f3f1b..f987fd6 100644
--- a/lib/WellWell/Compose/Component/Zoom.pm
+++ b/lib/WellWell/Compose/Component/Zoom.pm
@@ -43,7 +43,7 @@ sub new {
 sub process {
 	my ($self, $attributes) = @_;
 	my ($content, $xml_spec, $spec, $iter_name, $html_object, $zoom);
-	my (%filters);
+	my (%filters, $subname, $subref);
 
 	# parse specification
 	$xml_spec = new Template::Zoom::Specification::XML;
@@ -68,6 +68,14 @@ sub process {
 	$zoom = new Template::Zoom (template => $html_object, filters => \%filters,
 								database => $self->{database});
 
+	# call component load subroutine
+	$subname = "component_$self->{name}_load";
+	$subref = $Vend::Cfg->{Sub}{$subname} || $Global::GlobalSub->{$subname};
+
+	if ($subref) {
+		$subref->($self->{name}, $spec, $html_object, $zoom);
+	}
+	
 	return $zoom->process($attributes);
 }
 



More information about the wellwell-devel mailing list