summaryrefslogtreecommitdiff
path: root/includes/view/ShiftTypes_view.php
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2016-09-29 11:18:17 +0200
committermsquare <msquare@notrademark.de>2016-09-29 11:18:17 +0200
commite965f8d04150fbd17ee1b5fcbca5ae85bbe6d6bd (patch)
treef610d047f1cdc830ffc34881f6ea6d26ef0e3983 /includes/view/ShiftTypes_view.php
parent91dafb19ec171e747d9976cf738606759bde3aae (diff)
prohibit inline control structures on model and view
Diffstat (limited to 'includes/view/ShiftTypes_view.php')
-rw-r--r--includes/view/ShiftTypes_view.php17
1 files changed, 10 insertions, 7 deletions
diff --git a/includes/view/ShiftTypes_view.php b/includes/view/ShiftTypes_view.php
index 10431440..163d6646 100644
--- a/includes/view/ShiftTypes_view.php
+++ b/includes/view/ShiftTypes_view.php
@@ -2,27 +2,29 @@
function ShiftType_name_render($shifttype) {
global $privileges;
- if (in_array('shifttypes', $privileges))
+ if (in_array('shifttypes', $privileges)) {
return '<a href="' . shifttype_link($shifttype) . '">' . $shifttype['name'] . '</a>';
+ }
return $shifttype['name'];
}
function ShiftType_delete_view($shifttype) {
- return page_with_title(sprintf(_("Delete shifttype %s"), $shifttype['name']), array(
+ return page_with_title(sprintf(_("Delete shifttype %s"), $shifttype['name']), [
info(sprintf(_("Do you want to delete shifttype %s?"), $shifttype['name']), true),
- buttons(array(
+ buttons([
button(page_link_to('shifttypes'), _("cancel"), 'cancel'),
button(page_link_to('shifttypes') . '&action=delete&shifttype_id=' . $shifttype['id'] . '&confirmed', _("delete"), 'ok')
- ))
- ));
+ ])
+ ]);
}
function ShiftType_edit_view($name, $angeltype_id, $angeltypes, $description, $shifttype_id) {
$angeltypes_select = [
'' => _('All')
];
- foreach ($angeltypes as $angeltype)
+ foreach ($angeltypes as $angeltype) {
$angeltypes_select[$angeltype['id']] = $angeltype['name'];
+ }
return page_with_title($shifttype_id ? _('Edit shifttype') : _('Create shifttype'), [
msg(),
@@ -42,8 +44,9 @@ function ShiftType_edit_view($name, $angeltype_id, $angeltypes, $description, $s
function ShiftType_view($shifttype, $angeltype) {
$parsedown = new Parsedown();
$title = $shifttype['name'];
- if ($angeltype)
+ if ($angeltype) {
$title .= ' <small>' . sprintf(_('for team %s'), $angeltype['name']) . '</small>';
+ }
return page_with_title($title, [
msg(),
buttons([