[wellwell-devel] [wellwell/zoom] Add options top, bottom and create_text to [reviews display].
Stefan Hornburg
wellwell-devel at rt.icdevgroup.org
Wed Sep 15 10:46:40 UTC 2010
commit 1f8f72aafb884cde533ae858c8731050170dc5fe
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date: Thu Sep 2 19:28:28 2010 +0200
Add options top,bottom and create_text to [reviews display].
plugins/reviews/code/reviews.tag | 23 +++++++++++++++++++++--
1 files changed, 21 insertions(+), 2 deletions(-)
---
diff --git a/plugins/reviews/code/reviews.tag b/plugins/reviews/code/reviews.tag
index e62844a..3bbb6f0 100644
--- a/plugins/reviews/code/reviews.tag
+++ b/plugins/reviews/code/reviews.tag
@@ -56,11 +56,27 @@ sub {
unless ($rating) {
if ($sku) {
- my $url = $Tag->area("reviews/$sku/create");
- return qq{<a href="$url">Enter First Review</a>};
+ my ($create_text, $url);
+
+ if (exists $opt->{create_text}) {
+ $create_text = $opt->{create_text};
+ }
+ else {
+ $create_text = 'Enter First Review';
+ }
+
+ if ($create_text =~ /\S/) {
+ $url = $Tag->area("reviews/$sku/create");
+ return qq{<a href="$url">Enter First Review</a>};
+ }
+
+ return;
}
}
+ # additional content at the top
+ push @out, $opt->{top};
+
for (qw/empty full/) {
$img{"rating_path_$_"} = $opt->{"img_rating_$_"} || $Variable->{'REVIEWS_IMG_RATING_' . uc($_)};
if ($img{"rating_path_$_"} =~ m%^/%) {
@@ -78,6 +94,9 @@ sub {
push @out, qq{<img src="$img{'rating_empty'}">};
}
}
+
+ # additional content at the bottom
+ push @out, $opt->{bottom};
return(join('', @out));
}
More information about the wellwell-devel
mailing list