From 73175e2b64c85c7a8c528c76452cd82ffa99f925 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Mon, 28 Aug 2017 16:21:10 +0200 Subject: #337: Added routing --- includes/view/UserAngelTypes_view.php | 73 +++++++++++++++++++++++++++-------- 1 file changed, 57 insertions(+), 16 deletions(-) (limited to 'includes/view/UserAngelTypes_view.php') diff --git a/includes/view/UserAngelTypes_view.php b/includes/view/UserAngelTypes_view.php index 15d99961..98f6c3e9 100644 --- a/includes/view/UserAngelTypes_view.php +++ b/includes/view/UserAngelTypes_view.php @@ -19,12 +19,18 @@ function UserAngelType_update_view($user_angeltype, $user, $angeltype, $supporte User_Nick_render($user) ), true), buttons([ - button(page_link_to('angeltypes') . '&action=view&angeltype_id=' . $angeltype['id'], _('cancel'), 'cancel'), button( - page_link_to('user_angeltypes') - . '&action=update&user_angeltype_id=' . $user_angeltype['id'] - . '&supporter=' . ($supporter ? '1' : '0') - . '&confirmed', + page_link_to('angeltypes', ['action' => 'view', 'angeltype_id' => $angeltype['id']]), + _('cancel'), + 'cancel' + ), + button( + page_link_to('user_angeltypes', [ + 'action' => 'update', + 'user_angeltype_id' => $user_angeltype['id'], + 'supporter' => ($supporter ? '1' : '0'), + 'confirmed' => 1, + ]), _('yes'), 'ok' ) @@ -42,9 +48,19 @@ function UserAngelTypes_delete_all_view($angeltype) msg(), info(sprintf(_('Do you really want to deny all users for %s?'), $angeltype['name']), true), buttons([ - button(page_link_to('angeltypes') . '&action=view&angeltype_id=' . $angeltype['id'], _('cancel'), 'cancel'), button( - page_link_to('user_angeltypes') . '&action=delete_all&angeltype_id=' . $angeltype['id'] . '&confirmed', + page_link_to( + 'angeltypes', + ['action' => 'view', 'angeltype_id' => $angeltype['id']] + ), + _('cancel'), + 'cancel' + ), + button( + page_link_to( + 'user_angeltypes', + ['action' => 'delete_all', 'angeltype_id' => $angeltype['id'], 'confirmed' => 1] + ), _('yes'), 'ok' ) @@ -62,9 +78,11 @@ function UserAngelTypes_confirm_all_view($angeltype) msg(), info(sprintf(_('Do you really want to confirm all users for %s?'), $angeltype['name']), true), buttons([ - button(page_link_to('angeltypes') . '&action=view&angeltype_id=' . $angeltype['id'], _('cancel'), 'cancel'), + button(page_link_to('angeltypes', ['action' => 'view', 'angeltype_id' => $angeltype['id']]), _('cancel'), + 'cancel'), button( - page_link_to('user_angeltypes') . '&action=confirm_all&angeltype_id=' . $angeltype['id'] . '&confirmed', + page_link_to('user_angeltypes', + ['action' => 'confirm_all', 'angeltype_id' => $angeltype['id'], 'confirmed' => 1]), _('yes'), 'ok' ) @@ -84,9 +102,16 @@ function UserAngelType_confirm_view($user_angeltype, $user, $angeltype) msg(), info(sprintf(_('Do you really want to confirm %s for %s?'), User_Nick_render($user), $angeltype['name']), true), buttons([ - button(page_link_to('angeltypes') . '&action=view&angeltype_id=' . $angeltype['id'], _('cancel'), 'cancel'), button( - page_link_to('user_angeltypes') . '&action=confirm&user_angeltype_id=' . $user_angeltype['id'] . '&confirmed', + page_link_to('angeltypes', ['action' => 'view', 'angeltype_id' => $angeltype['id']]), + _('cancel'), + 'cancel' + ), + button( + page_link_to( + 'user_angeltypes', + ['action' => 'confirm', 'user_angeltype_id' => $user_angeltype['id'], 'confirmed' => 1] + ), _('yes'), 'ok' ) @@ -106,9 +131,14 @@ function UserAngelType_delete_view($user_angeltype, $user, $angeltype) msg(), info(sprintf(_('Do you really want to delete %s from %s?'), User_Nick_render($user), $angeltype['name']), true), buttons([ - button(page_link_to('angeltypes') . '&action=view&angeltype_id=' . $angeltype['id'], _('cancel'), 'cancel'), button( - page_link_to('user_angeltypes') . '&action=delete&user_angeltype_id=' . $user_angeltype['id'] . '&confirmed', + page_link_to('angeltypes', ['action' => 'view', 'angeltype_id' => $angeltype['id']]), + _('cancel'), + 'cancel' + ), + button( + page_link_to('user_angeltypes', + ['action' => 'delete', 'user_angeltype_id' => $user_angeltype['id'], 'confirmed' => 1]), _('yes'), 'ok' ) @@ -132,7 +162,11 @@ function UserAngelType_add_view($angeltype, $users_source, $user_id) return page_with_title(_('Add user to angeltype'), [ msg(), buttons([ - button(page_link_to('angeltypes') . '&action=view&angeltype_id=' . $angeltype['id'], _('back'), 'back') + button( + page_link_to('angeltypes', ['action' => 'view', 'angeltype_id' => $angeltype['id']]), + _('back'), + 'back' + ) ]), form([ form_info(_('Angeltype'), $angeltype['name']), @@ -153,9 +187,16 @@ function UserAngelType_join_view($user, $angeltype) msg(), info(sprintf(_('Do you really want to add %s to %s?'), User_Nick_render($user), $angeltype['name']), true), buttons([ - button(page_link_to('angeltypes') . '&action=view&angeltype_id=' . $angeltype['id'], _('cancel'), 'cancel'), button( - page_link_to('user_angeltypes') . '&action=add&angeltype_id=' . $angeltype['id'] . '&user_id=' . $user['UID'] . '&confirmed', + page_link_to('angeltypes', ['action' => 'view', 'angeltype_id' => $angeltype['id']]), + _('cancel'), + 'cancel' + ), + button( + page_link_to( + 'user_angeltypes', + ['action' => 'add', 'angeltype_id' => $angeltype['id'], 'user_id' => $user['UID'], 'confirmed' => 1] + ), _('save'), 'ok' ) -- cgit v1.2.3-54-g00ecf