diff options
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Open311.pm | 2 | ||||
-rwxr-xr-x | perllib/FixMyStreet/App/Controller/Rss.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 5 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Zurich.pm | 6 |
4 files changed, 12 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Open311.pm b/perllib/FixMyStreet/App/Controller/Open311.pm index a4e72e9bd..b336a44f0 100644 --- a/perllib/FixMyStreet/App/Controller/Open311.pm +++ b/perllib/FixMyStreet/App/Controller/Open311.pm @@ -272,7 +272,7 @@ sub output_requests : Private { $request->{'comment_count'} = [ $updates ]; } - my $display_photos = $c->cobrand->allow_photo_display; + my $display_photos = $c->cobrand->allow_photo_display($problem); if ($display_photos && $problem->photo) { my $url = $c->cobrand->base_url(); my $imgurl = $url . "/photo/$id.full.jpeg"; diff --git a/perllib/FixMyStreet/App/Controller/Rss.pm b/perllib/FixMyStreet/App/Controller/Rss.pm index 90ab7ad41..ed47f6f87 100755 --- a/perllib/FixMyStreet/App/Controller/Rss.pm +++ b/perllib/FixMyStreet/App/Controller/Rss.pm @@ -280,7 +280,7 @@ sub add_row : Private { $item{pubDate} = $pubDate if $pubDate; $item{category} = $row->{category} if $row->{category}; - if ($c->cobrand->allow_photo_display && $row->{photo}) { + if ($c->cobrand->allow_photo_display($row) && $row->{photo}) { my $key = $alert_type->item_table eq 'comment' ? 'c/' : ''; $item{description} .= ent("\n<br><img src=\"". $base_url . "/photo/$key$row->{id}.jpeg\">"); } diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index 96b3625a8..978968ba6 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -364,7 +364,10 @@ Return a boolean indicating whether the cobrand allows photo display =cut -sub allow_photo_display { return 1; } +sub allow_photo_display { + my ( $self, $r ) = @_; + return 1; +} =head2 allow_update_reporting diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm index 9c725e7aa..7f7125b29 100644 --- a/perllib/FixMyStreet/Cobrand/Zurich.pm +++ b/perllib/FixMyStreet/Cobrand/Zurich.pm @@ -103,6 +103,12 @@ sub updates_as_hashref { return $hashref; } +sub allow_photo_display { + my ( $self, $r ) = @_; + my $extra = ref($r) eq 'HASH' ? $r->{extra} : $r->extra; + return $extra->{publish_photo}; +} + sub show_unconfirmed_reports { 1; } |