diff options
author | purge <purge@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2009-10-02 08:51:59 +0000 |
---|---|---|
committer | purge <purge@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2009-10-02 08:51:59 +0000 |
commit | 08c27c5b18df934a3f052d50a9e4ab361ddc4f3e (patch) | |
tree | 48dd7b10c3de9be7dbb63ab013677762219164f2 /lib/Reaction/UI/ViewPort | |
parent | bbf88e0ddb212f945a9641b80746e20cbafe3378 (diff) | |
download | reaction-08c27c5b18df934a3f052d50a9e4ab361ddc4f3e.tar.gz reaction-08c27c5b18df934a3f052d50a9e4ab361ddc4f3e.zip |
allow redirect_to a url parameter
Diffstat (limited to 'lib/Reaction/UI/ViewPort')
-rw-r--r-- | lib/Reaction/UI/ViewPort/Role/Actions.pm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Reaction/UI/ViewPort/Role/Actions.pm b/lib/Reaction/UI/ViewPort/Role/Actions.pm index 89b5ae3..778115b 100644 --- a/lib/Reaction/UI/ViewPort/Role/Actions.pm +++ b/lib/Reaction/UI/ViewPort/Role/Actions.pm @@ -62,14 +62,18 @@ sub _build_actions { my $uri = $proto->{uri} or confess('uri is required in prototype action'); my $label = exists $proto->{label} ? $proto->{label} : $proto_name; my $layout = exists $proto->{layout} ? $proto->{layout} : 'uri'; - my $layout_args = exists $proto->{layout_args} ? $proto->{layout_args} : {}; my $action = Reaction::UI::ViewPort::URI->new( location => join ('-', $loc, 'action', $i++), uri => ( ref($uri) eq 'CODE' ? $uri->($target, $ctx) : $uri ), display => ( ref($label) eq 'CODE' ? $label->($target, $ctx) : $label ), - layout => ( ref($layout) eq 'CODE' ? $layout->($target, $ctx) : $layout ), - layout_args => ( ref($layout_args) eq 'CODE' ? $layout_args->($target, $ctx) : $layout_args ), + layout => $layout, + exists $proto->{layout_args} ? + ( ref($proto->{layout_args}) eq 'CODE' ? + $proto->{layout_args}->($target, $ctx) + : + $proto->{layout_args} ) + : () ); push(@act, $action); } |