diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-03-15 18:00:30 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-03-15 18:00:30 +0100 |
commit | ad69fc565fe01e18bca7d3ad975156d6a2c8a604 (patch) | |
tree | f7606ab5fd33ada73ba21775d787672636cbd232 /lib | |
parent | 3574da8815b830efc1317221c1348fd741559dd6 (diff) |
Only place lightbox html links when lightbox is enabled
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/App/Dthumb.pm | 6 | ||||
-rw-r--r-- | lib/App/Dthumb/Data.pm.PL | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/App/Dthumb.pm b/lib/App/Dthumb.pm index 8d71383..f7b6d86 100755 --- a/lib/App/Dthumb.pm +++ b/lib/App/Dthumb.pm @@ -146,6 +146,12 @@ sub new { height => $conf{size} * $conf{spacing} . 'px', ); + if ($conf{lightbox}) { + $ref->{data}->set_vars( + lightbox => $ref->{data}->get('html_lightbox.dthumb'), + ); + } + $ref->{html} = $ref->{data}->get('html_start.dthumb'); return bless($ref, $obj); diff --git a/lib/App/Dthumb/Data.pm.PL b/lib/App/Dthumb/Data.pm.PL index eaf914e..a0fb4f5 100644 --- a/lib/App/Dthumb/Data.pm.PL +++ b/lib/App/Dthumb/Data.pm.PL @@ -103,7 +103,10 @@ B<get> function, dthumb will replace occurences of "<!-- $key -->" or "/* $key sub set_vars { my ($self, %vars) = @_; - $self->{replace} = \%vars; + + while (my ($key, $value) = each(%vars)) { + $self->{replace}->{$key} = $value; + } } |