diff options
-rw-r--r-- | perllib/Cobrand.pm | 6 | ||||
-rw-r--r-- | perllib/Page.pm | 9 | ||||
-rwxr-xr-x | web/contact.cgi | 4 | ||||
-rwxr-xr-x | web/index.cgi | 10 | ||||
-rwxr-xr-x | web/reports.cgi | 5 |
5 files changed, 17 insertions, 17 deletions
diff --git a/perllib/Cobrand.pm b/perllib/Cobrand.pm index 534ddc74f..410fec969 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.47 2009-12-02 12:09:36 louise Exp $ +# $Id: Cobrand.pm,v 1.48 2009-12-08 11:13:30 louise Exp $ package Cobrand; use strict; @@ -583,7 +583,7 @@ Return any params to be added to responses =cut sub header_params { - my ($cobrand, $q) = @_; + my ($cobrand, $q, %params) = @_; my $handle; if ($cobrand){ $handle = cobrand_handle($cobrand); @@ -591,7 +591,7 @@ sub header_params { if ( !$cobrand || !$handle || !$handle->can('header_params')){ return {}; } else{ - return $handle->header_params($q); + return $handle->header_params($q, %params); } } diff --git a/perllib/Page.pm b/perllib/Page.pm index beecbd68b..9da737558 100644 --- a/perllib/Page.pm +++ b/perllib/Page.pm @@ -6,7 +6,7 @@ # Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: Page.pm,v 1.218 2009-12-04 11:53:44 matthew Exp $ +# $Id: Page.pm,v 1.219 2009-12-08 11:13:30 louise Exp $ # package Page; @@ -276,10 +276,11 @@ Return HTML for the top of the page, given PARAMs (TITLE is required). =cut sub header ($%) { my ($q, %params) = @_; - my $default_params = Cobrand::header_params(get_cobrand($q)); + my $context = $params{context}; + my $default_params = Cobrand::header_params(get_cobrand($q), $q, %params); my %default_params = %{$default_params}; %params = (%default_params, %params); - my %permitted_params = map { $_ => 1 } qw(title rss js expires lastmodified template cachecontrol); + my %permitted_params = map { $_ => 1 } qw(title rss js expires lastmodified template cachecontrol context); foreach (keys %params) { croak "bad parameter '$_'" if (!exists($permitted_params{$_})); } @@ -298,7 +299,7 @@ sub header ($%) { my $template = template($q, %params); my $html = template_header($template, $q, template_root($q), %params); - + my $cache_val = $default_params{cachecontrol}; if (mySociety::Config::get('STAGING_SITE')) { #$html .= '<p class="error">' . _("This is a developer site; things might break at any time.") . '</p>'; } diff --git a/web/contact.cgi b/web/contact.cgi index 9f0ab6d59..417959847 100755 --- a/web/contact.cgi +++ b/web/contact.cgi @@ -6,7 +6,7 @@ # Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: contact.cgi,v 1.52 2009-12-08 10:20:38 matthew Exp $ +# $Id: contact.cgi,v 1.53 2009-12-08 11:13:30 louise Exp $ use strict; use Standard; @@ -19,7 +19,7 @@ use mySociety::Random qw(random_bytes); # Main code for index.cgi sub main { my $q = shift; - print Page::header($q, title=>_('Contact Us')); + print Page::header($q, title=>_('Contact Us'), context=>'contact'); my $out = ''; if ($q->param('submit_form')) { $out = contact_submit($q); diff --git a/web/index.cgi b/web/index.cgi index cf44e0507..12dd93fa3 100755 --- a/web/index.cgi +++ b/web/index.cgi @@ -6,7 +6,7 @@ # Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: index.cgi,v 1.329 2009-12-08 10:20:38 matthew Exp $ +# $Id: index.cgi,v 1.330 2009-12-08 11:13:30 louise Exp $ use strict; use Standard; @@ -90,7 +90,7 @@ sub main { $out = front_page($q); } } else { - $out = front_page($q); + ($out, %params) = front_page($q); } print Page::header($q, %params); print $out; @@ -111,7 +111,7 @@ sub front_page { my $cobrand_form_elements = Cobrand::form_elements($cobrand, 'postcodeForm', $q); my $form_action = Cobrand::url($cobrand, '/', $q); my $question = Cobrand::enter_postcode_text($cobrand, $q); - + my %params = ('context' => 'front-page'); my %vars = ( error => $error || '', pc_h => $pc_h, @@ -120,7 +120,7 @@ sub front_page { question => $question, ); my $cobrand_front_page = Page::template_include('front-page', $q, Page::template_root($q), %vars); - return $cobrand_front_page if $cobrand_front_page; + return ($cobrand_front_page, %params) if $cobrand_front_page; my $out = '<p id="expl"><strong>' . _('Report, view, or discuss local problems') . '</strong>'; my $subhead = _('(like graffiti, fly tipping, broken paving slabs, or street lighting)'); @@ -194,7 +194,7 @@ EOF $out .= '</div>'; } - return $out; + return ($out, %params); } sub submit_update { diff --git a/web/reports.cgi b/web/reports.cgi index 3ddad2a85..fa9e1d4a5 100755 --- a/web/reports.cgi +++ b/web/reports.cgi @@ -7,7 +7,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: reports.cgi,v 1.40 2009-11-18 17:57:17 louise Exp $ +# $Id: reports.cgi,v 1.41 2009-12-08 11:13:30 louise Exp $ use strict; use Standard; @@ -235,8 +235,7 @@ sub main { $col .= list_problems($q, _('Old fixed'), $fixed{$one_council}{old}, $all); $vars{col_fixed} = $col; } - - print Page::header($q, title=>sprintf(_('%s - Summary reports'), $name), rss => [ sprintf(_('Problems within %s, FixMyStreet'), $name), Cobrand::url($cobrand, $rss_url, $q) ]); + print Page::header($q, context => 'reports', title=>sprintf(_('%s - Summary reports'), $name), rss => [ sprintf(_('Problems within %s, FixMyStreet'), $name), Cobrand::url($cobrand, $rss_url, $q) ]); print Page::template_include('reports', $q, Page::template_root($q), %vars); } } |