aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Cobrand.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/Cobrand.pm')
-rw-r--r--perllib/Cobrand.pm16
1 files changed, 15 insertions, 1 deletions
diff --git a/perllib/Cobrand.pm b/perllib/Cobrand.pm
index 26fc6c95e..63224aa54 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.5 2009-08-31 09:48:55 louise Exp $
+# $Id: Cobrand.pm,v 1.6 2009-08-31 14:19:42 louise Exp $
package Cobrand;
use strict;
@@ -36,6 +36,7 @@ sub cobrand_handle{
my $cobrand_class = ucfirst($cobrand);
my $class = "Cobrands::" . $cobrand_class . "::Util";
eval "use $class";
+
my $handle;
eval{ $handle = $class->new };
return 0 if $@;
@@ -71,5 +72,18 @@ sub set_site_restriction{
return $handle->site_restriction($q);
}
+
+=item set_lang_and_domain Q HOST
+
+Set the language and domain of the site based on the query and host
+=cut
+sub set_lang_and_domain{
+ my ($q, $host) = @_;
+ my $handle = cobrand_handle($q);
+ if ($handle != 0){
+ $handle->set_lang_and_domain($q, $host);
+ }
+}
+
1;