aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Cobrand.pm
diff options
context:
space:
mode:
authorlouise <louise>2009-09-23 17:01:00 +0000
committerlouise <louise>2009-09-23 17:01:00 +0000
commitc2c5be29c47584ea0aff8934ee7a796f30bb35b2 (patch)
tree07ba92d114f17d5b53bbedad65bd13d352b63e82 /perllib/Cobrand.pm
parenta6e0574642c9b6aa0f4d3c43bba1f12b56bfdfa5 (diff)
Delegate setting of site title to cobrands
Diffstat (limited to 'perllib/Cobrand.pm')
-rw-r--r--perllib/Cobrand.pm26
1 files changed, 23 insertions, 3 deletions
diff --git a/perllib/Cobrand.pm b/perllib/Cobrand.pm
index e170ec87d..f450304b5 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.21 2009-09-23 15:43:54 louise Exp $
+# $Id: Cobrand.pm,v 1.22 2009-09-23 17:01:00 louise Exp $
package Cobrand;
use strict;
@@ -365,12 +365,14 @@ sub header_params {
}
}
-=item root_path_pattern COBRAND
+=item root_path_js COBRAND
+
+Return some js to set the root path from which AJAX queries should be made
=cut
sub root_path_js {
- my ($cobrand) = @_;
+ my ($cobrand) = @_;
my $handle;
if ($cobrand){
$handle = cobrand_handle($cobrand);
@@ -382,6 +384,24 @@ sub root_path_js {
}
}
+=item site_title COBRAND
+
+Return the title to be used in page heads.
+
+=cut
+sub site_title {
+ my ($cobrand) = @_;
+ my $handle;
+ if ($cobrand){
+ $handle = cobrand_handle($cobrand);
+ }
+ if ( !$cobrand || !$handle || !$handle->can('site_title')){
+ return '';
+ } else{
+ return $handle->site_title();
+ }
+}
+
1;