aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Cobrand.pm
diff options
context:
space:
mode:
authorlouise <louise>2009-12-09 13:34:35 +0000
committerlouise <louise>2009-12-09 13:34:35 +0000
commitf64dd76a0ee8b35d02232181e13ea2ede7cf2cea (patch)
tree745082016e1992b447973fad1788606829e3ee88 /perllib/Cobrand.pm
parent9b2cb2c40d8489149c3d013690278a61d7de8e9e (diff)
Allow cobrands to perform a check on geocoded string locations
Diffstat (limited to 'perllib/Cobrand.pm')
-rw-r--r--perllib/Cobrand.pm20
1 files changed, 19 insertions, 1 deletions
diff --git a/perllib/Cobrand.pm b/perllib/Cobrand.pm
index d225fdb8e..18704ed9a 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.49 2009-12-08 17:43:13 louise Exp $
+# $Id: Cobrand.pm,v 1.50 2009-12-09 13:34:35 louise Exp $
package Cobrand;
use strict;
@@ -728,6 +728,24 @@ sub allow_update_reporting {
}
+=item geocoded_string_check LOCATION QUERY
+
+Return a boolean indicating whether the string LOCATION passes the cobrands
+checks.
+
+=cut
+sub geocoded_string_check {
+ my ($cobrand, $location, $query) = @_;
+ my $handle;
+ if ($cobrand){
+ $handle = cobrand_handle($cobrand);
+ }
+ if ( !$cobrand || !$handle || !$handle->can('geocoded_string_check')){
+ return 1;
+ } else{
+ return $handle->geocoded_string_check($location, $query);
+ }
+}
=item council_check COBRAND COUNCILS QUERY