diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2012-01-30 16:36:43 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2012-01-30 16:46:06 +0000 |
commit | 9a9889db881e24c17f51804ba56c11bd264bbf9c (patch) | |
tree | 2f6f8de01e3aba72f8736c9a25606b85842d495f /perllib | |
parent | a176268063145c9a2d5359c24da0143fb4fe7520 (diff) |
Make FixMyStreet a cobrand, like the others.
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/CrossSell.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand.pm | 3 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Base.pm | 3 |
3 files changed, 5 insertions, 3 deletions
diff --git a/perllib/CrossSell.pm b/perllib/CrossSell.pm index 9235d0a03..4a0f31ea8 100644 --- a/perllib/CrossSell.pm +++ b/perllib/CrossSell.pm @@ -167,7 +167,7 @@ EOF sub display_advert ($$;$%) { my ($c, $email, $name, %data) = @_; - return '' unless $c->cobrand->is_default; + return '' unless $c->cobrand->moniker eq 'fixmystreet'; #if (defined $data{council} && $data{council} eq '2326') { # my ($out, $ad) = display_hfyc_cheltenham_advert($email, $name); diff --git a/perllib/FixMyStreet/Cobrand.pm b/perllib/FixMyStreet/Cobrand.pm index 6fe2a2bc8..ad21820d7 100644 --- a/perllib/FixMyStreet/Cobrand.pm +++ b/perllib/FixMyStreet/Cobrand.pm @@ -84,6 +84,9 @@ sub get_class_for_moniker { return $avail if $moniker eq $avail->moniker; } + # Special case for old blank cobrand entries in fixmystreet.com. + return 'FixMyStreet::Cobrand::FixMyStreet' if $moniker eq ''; + # if none match then use the default return 'FixMyStreet::Cobrand::Default'; } diff --git a/perllib/FixMyStreet/Cobrand/Base.pm b/perllib/FixMyStreet/Cobrand/Base.pm index 00b47d7da..42a891cb4 100644 --- a/perllib/FixMyStreet/Cobrand/Base.pm +++ b/perllib/FixMyStreet/Cobrand/Base.pm @@ -35,7 +35,6 @@ sub moniker { my $class = ref( $_[0] ) || $_[0]; # deal with object or class my ($last_part) = $class =~ m{::(\w+)$}; $last_part = lc($last_part); - return '' if $last_part eq 'default'; return $last_part; } @@ -49,7 +48,7 @@ Returns true if this is the default cobrand, false otherwise. sub is_default { my $self = shift; - return $self->moniker eq ''; + return $self->moniker eq 'default'; } =head2 path_to_web_templates |