diff options
author | louise <louise> | 2009-08-26 16:52:14 +0000 |
---|---|---|
committer | louise <louise> | 2009-08-26 16:52:14 +0000 |
commit | 6ab35a4059158909d2560d2a8b201e2e477d3dcf (patch) | |
tree | 9dbe6c5ee62a1ca3668a9850ced3c1777bc3b94e /perllib/Cobrand.pm | |
parent | 6cc083845e75d3b9b7967c5764401caab4e77265 (diff) |
Allowing cobrands to serve pages not in the main app
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; |