aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlouise <louise>2009-11-16 17:20:37 +0000
committerlouise <louise>2009-11-16 17:20:37 +0000
commit135af1f0ee22f6486d42445637dde3cecf0a4f81 (patch)
tree258eb5d90b191b0cf5044b8bb2866117120d7d9c
parentacf6fcfa896fb5e1f09c4b73878585f118109567 (diff)
Added functions for returning a list of allowed admin pages, determining whether to show the problem creation graph, and generating a restriction clause to use when generating lists of contacts
-rw-r--r--perllib/Cobrand.pm61
1 files changed, 58 insertions, 3 deletions
diff --git a/perllib/Cobrand.pm b/perllib/Cobrand.pm
index 4d4865ae3..3b7daae60 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.37 2009-11-12 14:38:13 louise Exp $
+# $Id: Cobrand.pm,v 1.38 2009-11-16 17:20:37 louise Exp $
package Cobrand;
use strict;
@@ -78,6 +78,25 @@ sub set_site_restriction {
return $handle->site_restriction($q);
}
+=item contact_restriction COBRAND
+
+Return a contact restriction clause if the cobrand uses a subset of the FixMyStreet contact data.
+
+=cut
+
+sub contact_restriction {
+ my ($cobrand) = @_;
+ my $handle;
+ if ($cobrand){
+ $handle = cobrand_handle($cobrand);
+ }
+ if ( !$cobrand || !$handle || ! $handle->can('contact_restriction')){
+ return '';
+ }{
+ return $handle->contact_restriction();
+ }
+}
+
=item base_url COBRAND
Return the base url for the cobranded version of the site
@@ -182,6 +201,7 @@ sub recent_photos {
}
}
+
=item recent
Return recent problems on the site.
@@ -564,7 +584,7 @@ sub council_check {
}
}
-=item feed_xsl
+=item feed_xsl COBRAND
Return an XSL to be used in rendering feeds
@@ -583,7 +603,7 @@ sub feed_xsl {
}
-=item all_councils_report
+=item all_councils_report COBRAND
Return a boolean indicating whether the cobrand displays a report of all councils
@@ -602,6 +622,41 @@ sub all_councils_report {
}
}
+=item admin_pages COBRAND
+
+List of names of pages to display on the admin interface
+
+=cut
+sub admin_pages {
+ my ($cobrand) = @_;
+ my $handle;
+ if ($cobrand){
+ $handle = cobrand_handle($cobrand);
+ }
+ if ( !$cobrand || !$handle || !$handle->can('admin_pages')){
+ return 0;
+ } else{
+ return $handle->admin_pages();
+ }
+
+}
+
+=item admin_show_creation_graph COBRAND
+
+Show the problem creation graph in the admin interface
+=cut
+sub admin_show_creation_graph {
+ my ($cobrand) = @_;
+ my $handle;
+ if ($cobrand){
+ $handle = cobrand_handle($cobrand);
+ }
+ if ( !$cobrand || !$handle || !$handle->can('admin_show_creation_graph')){
+ return 1;
+ } else{
+ return $handle->admin_show_creation_graph();
+ }
+}
1;