X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FBase.pm;h=5847b98b5fd9e9b2840ecb86062d212e810be497;hb=db62bb400ec44815daf398a6a0eb5b5b6c9eb297;hp=b97f3c50981a3d3c7fbf3c11ac1a8ede1b0c8b2c;hpb=2b7f7e75b4cfe8e111775970a4524ab48ec898bb;p=kivitendo-erp.git diff --git a/SL/Controller/Base.pm b/SL/Controller/Base.pm index b97f3c509..5847b98b5 100644 --- a/SL/Controller/Base.pm +++ b/SL/Controller/Base.pm @@ -29,6 +29,7 @@ sub url_for { my %params = ref($_[0]) eq 'HASH' ? %{ $_[0] } : @_; my $controller = delete($params{controller}) || $self->controller_name; my $action = $params{action} || 'dispatch'; + my $fragment = delete $params{fragment}; my $script; if ($controller =~ m/\.pl$/) { @@ -41,7 +42,7 @@ sub url_for { my $query = join '&', map { uri_encode($_->[0]) . '=' . uri_encode($_->[1]) } @{ flatten(\%params) }; - return "${script}?${query}"; + return "${script}?${query}" . (defined $fragment ? "#$fragment" : ''); } sub redirect_to { @@ -166,6 +167,8 @@ sub send_file { } else { $::locale->with_raw_io(\*STDOUT, sub { print $$file_name_or_content }); } + + return 1; } sub presenter { @@ -526,6 +529,9 @@ L. The action to call is given by C<$params{action}>. It defaults to C. +If C<$params{fragment}> is present, it's used as the fragment of the resulting +URL. + All other key/value pairs in C<%params> are appended as GET parameters to the URL.