diff options
-rw-r--r-- | perllib/Page.pm | 6 | ||||
-rwxr-xr-x | web/ajax.cgi | 16 | ||||
-rw-r--r-- | web/js.js | 3 |
3 files changed, 10 insertions, 15 deletions
diff --git a/perllib/Page.pm b/perllib/Page.pm index 9ba2b6ad7..50f9b1e7f 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.185 2009-09-24 16:16:53 matthew Exp $ +# $Id: Page.pm,v 1.186 2009-09-28 10:43:58 louise Exp $ # package Page; @@ -429,6 +429,7 @@ sub display_map { my $out = ''; my $cobrand = Page::get_cobrand($q); my $root_path_js = Cobrand::root_path_js($cobrand); + my $cobrand_form_elements = Cobrand::form_elements($cobrand, 'mapForm', $q); my $img_type; if ($params{type}) { my $encoding = ''; @@ -441,6 +442,7 @@ sub display_map { <input type="hidden" name="x" id="formX" value="$x"> <input type="hidden" name="y" id="formY" value="$y"> <input type="hidden" name="pc" value="$pc_enc"> +$cobrand_form_elements EOF $img_type = '<input type="image"'; } else { @@ -490,7 +492,7 @@ sub display_pin { . $num . '.gif" alt="' . _('Problem') . '" style="top:' . ($py-59) . 'px; left:' . ($px) . 'px; position: absolute;">'; return $out unless $_ && $_->{id} && $col ne 'blue'; - my $url = '/report/' . $_->{id}; + my $url = NewURL($q, -retain => 1, -url => '/report/' . $_->{id}, pc => undef); $out = '<a title="' . ent($_->{title}) . '" href="' . $url . '">' . $out . '</a>'; return $out; } diff --git a/web/ajax.cgi b/web/ajax.cgi index da465a565..3148573fa 100755 --- a/web/ajax.cgi +++ b/web/ajax.cgi @@ -6,16 +6,16 @@ # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: ajax.cgi,v 1.10 2009-09-28 10:12:41 louise Exp $ +# $Id: ajax.cgi,v 1.11 2009-09-28 10:43:58 louise Exp $ use strict; use Standard; -use mySociety::Web qw(ent); +use mySociety::Web qw(ent NewURL); sub main { my $q = shift; - my @vars = qw(x y sx sy all_pins extra_param_name extra_param_value); + my @vars = qw(x y sx sy all_pins); my %input = map { $_ => $q->param($_) || '' } @vars; my %input_h = map { $_ => $q->param($_) ? ent($q->param($_)) : '' } @vars; @@ -40,10 +40,7 @@ sub main { my $list = ''; my $link = ''; foreach (@$on_map) { - $link = '/report/' . $_->{id}; - if ($input{extra_param_name}){ - $link .= '?' . $input{extra_param_name} . '=' . $input{extra_param_value}; - } + $link = NewURL($q, -retain => 1, -url => '/report/' . $_->{id}, pc => undef); $list .= '<li><a href="' . $link . '">'; $list .= $_->{title}; $list .= '</a>'; @@ -54,10 +51,7 @@ sub main { $list = ''; foreach (@$around_map) { - $link = '/report/' . $_->{id}; - if ($input{extra_param_name}){ - $link .= '?' . $input{extra_param_name} . '=' . $input{extra_param_value}; - } + $link = NewURL($q, -retain => 1, -url => '/report/' . $_->{id}, pc => undef); $list .= '<li><a href="' . $link . '">'; $list .= $_->{title} . ' <small>(' . int($_->{distance}/100+.5)/10 . 'km)</small>'; $list .= '</a>'; @@ -313,8 +313,7 @@ function load_pins(x, y) { 'all_pins=' + document.getElementById('all_pins').value ]; if (document.getElementById('extra_param')) { - ajax_params.push('extra_param_name=' + document.getElementById('extra_param').name); - ajax_params.push('extra_param_value=' + document.getElementById('extra_param').value); + ajax_params.push(document.getElementById('extra_param').name + '=' + document.getElementById('extra_param').value); } var separator; |