20 |
/; |
/; |
21 |
# FormValidator |
# FormValidator |
22 |
|
|
23 |
our $VERSION = '0.33-dev'; |
use Encode qw/is_utf8 decode/; |
24 |
|
|
25 |
|
our $VERSION = '0.37-dev'; |
26 |
|
|
27 |
# |
# |
28 |
# Configure the application |
# Configure the application |
61 |
my ( $self, $c ) = @_; |
my ( $self, $c ) = @_; |
62 |
$c->stash->{template} = 'index.tt'; |
$c->stash->{template} = 'index.tt'; |
63 |
|
|
64 |
my $site_name = shift @{ $c->req->args }; |
my $site_name = shift @{ $c->req->args } || ''; |
65 |
|
|
66 |
$c->log->debug("trying site name: $site_name"); |
$c->log->debug("trying site name: $site_name"); |
67 |
|
|
108 |
|
|
109 |
$c->stash->{site_url} = "/$site_name/"; |
$c->stash->{site_url} = "/$site_name/"; |
110 |
|
|
111 |
$c->log->dumper( $c->stash, 'stash' ); |
#$c->log->dumper( $c->stash, 'stash' ); |
112 |
|
|
113 |
} |
} |
114 |
|
|
115 |
# Forward to View unless response body is already defined |
# Forward to View unless response body is already defined |
116 |
$c->forward('View::TT'); |
$c->forward('View::TT'); |
117 |
|
|
118 |
$c->fillform( $c->req->params ); |
# oh, turn utf8 flag for all parametars (why do I need to do this?) |
119 |
|
my $utf8_params; |
120 |
|
map { |
121 |
|
$utf8_params->{$_} = decode('UTF-8', $c->request->params->{$_}); |
122 |
|
} keys %{ $c->request->params }; |
123 |
|
|
124 |
|
# and fill-in form with new UTF-8 encoded params (to prevent double-escape of UTF-8) |
125 |
|
$c->fillform( $utf8_params ); |
126 |
|
|
127 |
$c->response->{body} =~ s#\Qnew Ajax.Autocompleter(\E#new WebPAC.Suggest(#gs; |
$c->response->{body} =~ s#\Qnew Ajax.Autocompleter(\E#new WebPAC.Suggest(#gs; |
128 |
$c->response->{body} =~ s#\Qnew Ajax.Updater(\E#new WebPAC.Updater(#gs; |
$c->response->{body} =~ s#\Qnew Ajax.Updater(\E#new WebPAC.Updater(#gs; |