diff options
Diffstat (limited to 'perllib/Cobrand.pm')
-rw-r--r-- | perllib/Cobrand.pm | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/perllib/Cobrand.pm b/perllib/Cobrand.pm index 116268f92..fba948868 100644 --- a/perllib/Cobrand.pm +++ b/perllib/Cobrand.pm @@ -7,10 +7,9 @@ # Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved. # Email: louise@mysociety.org. WWW: http://www.mysociety.org # -# $Id: Cobrand.pm,v 1.2 2009-08-20 15:38:48 louise Exp $ +# $Id: Cobrand.pm,v 1.3 2009-08-26 16:52:14 louise Exp $ package Cobrand; - use strict; use Carp; @@ -24,4 +23,21 @@ sub get_allowed_cobrands{ my @allowed_cobrands = split(/\|/, $allowed_cobrand_string); return \@allowed_cobrands; } + +=item cobrand_page QUERY + +Return a string containing the HTML to be rendered for a custom Cobranded page + +=cut +sub cobrand_page{ + my $q = shift; + my $cobrand = $q->{site}; + my $cobrand_class = ucfirst($cobrand); + my $class = "Cobrands::" . $cobrand_class . "::Util"; + eval "use $class"; + my $handle = $class->new; + my ($out, %params) = $handle->page($q); + return ($out, %params); +} + 1; |