diff options
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/Cobrand.pm | 15 | ||||
-rw-r--r-- | perllib/Problems.pm | 6 |
2 files changed, 11 insertions, 10 deletions
diff --git a/perllib/Cobrand.pm b/perllib/Cobrand.pm index 13ba644a9..d0f15947a 100644 --- a/perllib/Cobrand.pm +++ b/perllib/Cobrand.pm @@ -7,7 +7,7 @@ # Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved. # Email: louise@mysociety.org. WWW: http://www.mysociety.org # -# $Id: Cobrand.pm,v 1.40 2009-11-17 13:58:47 louise Exp $ +# $Id: Cobrand.pm,v 1.41 2009-11-19 09:56:11 louise Exp $ package Cobrand; use strict; @@ -61,21 +61,20 @@ sub cobrand_page { return $handle->page($q); } -=item set_site_restriction Q +=item site_restriction COBRAND COBRAND_DATA Return a site restriction clause and a site key if the cobrand uses a subset of the FixMyStreet -data. Q is the query object. Returns an empty string and site key 0 if the cobrand uses all the -data. +data. COBRAND_DATA is any extra data the cobrand needs. Returns an empty string and site key 0 +if the cobrand uses all the data. =cut -sub set_site_restriction { - my $q = shift; +sub site_restriction { + my ($cobrand, $cobrand_data) = @_; my $site_restriction = ''; my $site_id = 0; - my $cobrand = Page::get_cobrand($q); my $handle = cobrand_handle($cobrand); return ($site_restriction, $site_id) unless $handle; - return $handle->site_restriction($q); + return $handle->site_restriction($cobrand_data); } =item contact_restriction COBRAND diff --git a/perllib/Problems.pm b/perllib/Problems.pm index 685c0db0b..4d5a32fbd 100644 --- a/perllib/Problems.pm +++ b/perllib/Problems.pm @@ -6,7 +6,7 @@ # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: Problems.pm,v 1.29 2009-11-18 16:43:42 louise Exp $ +# $Id: Problems.pm,v 1.30 2009-11-19 09:56:12 louise Exp $ # package Problems; @@ -25,7 +25,9 @@ sub set_site_restriction { my $q = shift; my $site = $q->{site}; if ($site ne 'fixmystreet'){ - ($site_restriction, $site_key) = Cobrand::set_site_restriction($q); + my $cobrand = Page::get_cobrand($q); + my $cobrand_data = Cobrand::extra_data($cobrand, $q); + ($site_restriction, $site_key) = Cobrand::site_restriction($cobrand, $cobrand_data); } else { $site_restriction = ''; $site_key = 0; |