diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2008-12-08 12:09:31 -0500 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2008-12-08 12:09:31 -0500 |
commit | 17fd7b185054e260f0a9a2cedd264ff3ef43d725 (patch) | |
tree | b0ba3cd7189135659a21e2fb0f5fbb03de797bdf /actions/block.php | |
parent | 5327d3f7ba87a1c81229cc9ec56c8d26f5dd6b50 (diff) |
add returnto information to the block form
darcs-hash:20081208170931-5ed1f-e7c5853e6a222b04723f20c01ebaae15eeab3687.gz
Diffstat (limited to 'actions/block.php')
-rw-r--r-- | actions/block.php | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/actions/block.php b/actions/block.php index b507af324..8956b79ba 100644 --- a/actions/block.php +++ b/actions/block.php @@ -95,6 +95,12 @@ class BlockAction extends Action { 'type' => 'hidden', 'value' => $id)); + foreach ($this->args as $k => $v) { + if (substr($k, 0, 9) == 'returnto-') { + common_hidden($k, $v); + } + } + common_submit('no', _('No')); common_submit('yes', _('Yes')); @@ -147,7 +153,21 @@ class BlockAction extends Action { $block->query('COMMIT'); - common_redirect(common_local_url('subscribers', - array('nickname' => $cur->nickname))); + # Now, gotta figure where we go back to + + foreach ($this->args as $k => $v) { + if ($k == 'returnto-action') { + $action = $v; + } else if (substr($k, 0, 9) == 'returnto-') { + $args[$k] = substr($k, 9); + } + } + + if ($action) { + common_redirect(common_local_url($action, $args)); + } else { + common_redirect(common_local_url('subscriptions', + array('nickname' => $cur->nickname))); + } } } |