Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add options top,bottom and create_text to [reviews display].
  • Loading branch information
racke committed Sep 2, 2010
1 parent d646e92 commit 65a6ce0
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions plugins/reviews/code/reviews.tag
Expand Up @@ -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%^/%) {
Expand All @@ -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));
}
Expand Down

0 comments on commit 65a6ce0

Please sign in to comment.