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/ShiftTypes_view.php | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) (limited to 'includes/view/ShiftTypes_view.php') diff --git a/includes/view/ShiftTypes_view.php b/includes/view/ShiftTypes_view.php index e0750617..74e0d7c0 100644 --- a/includes/view/ShiftTypes_view.php +++ b/includes/view/ShiftTypes_view.php @@ -24,7 +24,10 @@ function ShiftType_delete_view($shifttype) buttons([ button(page_link_to('shifttypes'), _('cancel'), 'cancel'), button( - page_link_to('shifttypes') . '&action=delete&shifttype_id=' . $shifttype['id'] . '&confirmed', + page_link_to( + 'shifttypes', + ['action' => 'delete', 'shifttype_id' => $shifttype['id'], 'confirmed' => 1] + ), _('delete'), 'ok btn-danger' ) @@ -81,12 +84,16 @@ function ShiftType_view($shifttype, $angeltype) buttons([ button(page_link_to('shifttypes'), shifttypes_title(), 'back'), $angeltype ? button( - page_link_to('angeltypes') . '&action=view&angeltype_id=' . $angeltype['id'], + page_link_to('angeltypes', ['action' => 'view', 'angeltype_id' => $angeltype['id']]), $angeltype['name'] ) : '', - button(page_link_to('shifttypes') . '&action=edit&shifttype_id=' . $shifttype['id'], _('edit'), 'edit'), button( - page_link_to('shifttypes') . '&action=delete&shifttype_id=' . $shifttype['id'], + page_link_to('shifttypes', ['action' => 'edit', 'shifttype_id' => $shifttype['id']]), + _('edit'), + 'edit' + ), + button( + page_link_to('shifttypes', ['action' => 'delete', 'shifttype_id' => $shifttype['id']]), _('delete'), 'delete' ) @@ -103,11 +110,22 @@ function ShiftType_view($shifttype, $angeltype) function ShiftTypes_list_view($shifttypes) { foreach ($shifttypes as &$shifttype) { - $shifttype['name'] = '' . $shifttype['name'] . ''; + $shifttype['name'] = '' + . $shifttype['name'] + . ''; $shifttype['actions'] = table_buttons([ - button(page_link_to('shifttypes') . '&action=edit&shifttype_id=' . $shifttype['id'], _('edit'), 'btn-xs'), button( - page_link_to('shifttypes') . '&action=delete&shifttype_id=' . $shifttype['id'], + page_link_to( + 'shifttypes', + ['action' => 'edit', 'shifttype_id' => $shifttype['id']] + ), + _('edit'), + 'btn-xs' + ), + button( + page_link_to('shifttypes', ['action' => 'delete', 'shifttype_id' => $shifttype['id']]), _('delete'), 'btn-xs' ) @@ -117,7 +135,7 @@ function ShiftTypes_list_view($shifttypes) return page_with_title(shifttypes_title(), [ msg(), buttons([ - button(page_link_to('shifttypes') . '&action=edit', _('New shifttype'), 'add') + button(page_link_to('shifttypes', ['action' => 'edit']), _('New shifttype'), 'add') ]), table([ 'name' => _('Name'), -- cgit v1.2.3-54-g00ecf