summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/helper/internationalization_helper.php6
-rw-r--r--includes/model/User_model.php4
-rw-r--r--includes/pages/admin_active.php4
-rw-r--r--includes/pages/admin_groups.php4
-rw-r--r--includes/pages/admin_questions.php2
-rw-r--r--includes/pages/admin_rooms.php2
-rw-r--r--includes/pages/guest_stats.php2
-rw-r--r--includes/pages/user_shifts.php8
-rw-r--r--includes/sys_menu.php2
-rw-r--r--includes/sys_template.php12
-rw-r--r--includes/view/AngelTypes_view.php8
-rw-r--r--includes/view/User_view.php8
12 files changed, 31 insertions, 31 deletions
diff --git a/includes/helper/internationalization_helper.php b/includes/helper/internationalization_helper.php
index 1f4f3558..60451197 100644
--- a/includes/helper/internationalization_helper.php
+++ b/includes/helper/internationalization_helper.php
@@ -1,8 +1,8 @@
<?php
-$locales = array(
+$locales = [
'de_DE.UTF-8' => "Deutsch",
'en_US.UTF-8' => "English"
-);
+];
$default_locale = 'en_US.UTF-8';
@@ -61,7 +61,7 @@ function make_langselect() {
global $locales;
$URL = $_SERVER["REQUEST_URI"] . (strpos($_SERVER["REQUEST_URI"], "?") > 0 ? '&' : '?') . "set_locale=";
- $items = array();
+ $items = [];
foreach ($locales as $locale => $name) {
$items[] = toolbar_item_link(htmlspecialchars($URL) . $locale, '', '<img src="pic/flag/' . $locale . '.png" alt="' . $name . '" title="' . $name . '"> ' . $name);
}
diff --git a/includes/model/User_model.php b/includes/model/User_model.php
index 7f9170df..576bb3f5 100644
--- a/includes/model/User_model.php
+++ b/includes/model/User_model.php
@@ -71,7 +71,7 @@ function User_tshirts_count() {
* Returns all column names for sorting in an array.
*/
function User_sortable_columns() {
- return array(
+ return [
'Nick',
'Name',
'Vorname',
@@ -84,7 +84,7 @@ function User_sortable_columns() {
'force_active',
'Tshirt',
'lastLogIn'
- );
+ ];
}
/**
diff --git a/includes/pages/admin_active.php b/includes/pages/admin_active.php
index 733bd506..8d71b147 100644
--- a/includes/pages/admin_active.php
+++ b/includes/pages/admin_active.php
@@ -47,7 +47,7 @@ function admin_active() {
WHERE `User`.`Gekommen` = 1 AND `User`.`force_active`=0
GROUP BY `User`.`UID`
ORDER BY `force_active` DESC, `shift_length` DESC" . $limit);
- $user_nicks = array();
+ $user_nicks = [];
foreach ($users as $usr) {
sql_query("UPDATE `User` SET `Aktiv` = 1 WHERE `UID`='" . sql_escape($usr['UID']) . "'");
$user_nicks[] = User_Nick_render($usr);
@@ -139,7 +139,7 @@ function admin_active() {
$usr['force_active'] = glyph_bool($usr['force_active'] == 1);
$usr['tshirt'] = glyph_bool($usr['Tshirt'] == 1);
- $actions = array();
+ $actions = [];
if ($usr['Aktiv'] == 0) {
$actions[] = '<a href="' . page_link_to('admin_active') . '&amp;active=' . $usr['UID'] . ($show_all_shifts ? '&amp;show_all_shifts=' : '') . '&amp;search=' . $search . '">' . _("set active") . '</a>';
}
diff --git a/includes/pages/admin_groups.php b/includes/pages/admin_groups.php
index 69b6bf39..388e2c68 100644
--- a/includes/pages/admin_groups.php
+++ b/includes/pages/admin_groups.php
@@ -8,10 +8,10 @@ function admin_groups() {
$html = "";
$groups = sql_select("SELECT * FROM `Groups` ORDER BY `Name`");
if (! isset($_REQUEST["action"])) {
- $groups_table = array();
+ $groups_table = [];
foreach ($groups as $group) {
$privileges = sql_select("SELECT * FROM `GroupPrivileges` JOIN `Privileges` ON (`GroupPrivileges`.`privilege_id` = `Privileges`.`id`) WHERE `group_id`='" . sql_escape($group['UID']) . "'");
- $privileges_html = array();
+ $privileges_html = [];
foreach ($privileges as $priv) {
$privileges_html[] = $priv['name'];
diff --git a/includes/pages/admin_questions.php b/includes/pages/admin_questions.php
index f67c6ce8..8e7507da 100644
--- a/includes/pages/admin_questions.php
+++ b/includes/pages/admin_questions.php
@@ -22,7 +22,7 @@ function admin_questions() {
global $user;
if (! isset($_REQUEST['action'])) {
- $unanswered_questions_table = array();
+ $unanswered_questions_table = [];
$questions = sql_select("SELECT * FROM `Questions` WHERE `AID` IS NULL");
foreach ($questions as $question) {
$user_source = User($question['UID']);
diff --git a/includes/pages/admin_rooms.php b/includes/pages/admin_rooms.php
index 155fd7b3..d34d4386 100644
--- a/includes/pages/admin_rooms.php
+++ b/includes/pages/admin_rooms.php
@@ -107,7 +107,7 @@ function admin_rooms() {
}
sql_query("DELETE FROM `NeededAngelTypes` WHERE `room_id`='" . sql_escape($room_id) . "'");
- $needed_angeltype_info = array();
+ $needed_angeltype_info = [];
foreach ($angeltypes_count as $angeltype_id => $angeltype_count) {
$angeltype = AngelType($angeltype_id);
if ($angeltype === false) {
diff --git a/includes/pages/guest_stats.php b/includes/pages/guest_stats.php
index aec2d7d4..71fde137 100644
--- a/includes/pages/guest_stats.php
+++ b/includes/pages/guest_stats.php
@@ -5,7 +5,7 @@ function guest_stats() {
if (isset($_REQUEST['api_key'])) {
if ($_REQUEST['api_key'] == $api_key) {
- $stats = array();
+ $stats = [];
list($user_count) = sql_select("SELECT count(*) as `user_count` FROM `User`");
$stats['user_count'] = $user_count['user_count'];
diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php
index b6a3c9f5..52167f14 100644
--- a/includes/pages/user_shifts.php
+++ b/includes/pages/user_shifts.php
@@ -660,9 +660,9 @@ function view_user_shifts() {
$style = " text-decoration: line-through;";
}
if (in_array('user_shifts_admin', $privileges)) {
- $entry_list[] = "<span style=\"$style\">" . User_Nick_render($entry) . ' ' . table_buttons(array(
+ $entry_list[] = "<span style=\"$style\">" . User_Nick_render($entry) . ' ' . table_buttons([
button(page_link_to('user_shifts') . '&entry_id=' . $entry['id'], glyph('trash'), 'btn-xs')
- )) . '</span>';
+ ]) . '</span>';
} else {
$entry_list[] = "<span style=\"$style\">" . User_Nick_render($entry) . "</span>";
}
@@ -796,9 +796,9 @@ function view_user_shifts() {
$freeloader = 0;
foreach ($entries as $entry) {
if (in_array('user_shifts_admin', $privileges)) {
- $member = User_Nick_render($entry) . ' ' . table_buttons(array(
+ $member = User_Nick_render($entry) . ' ' . table_buttons([
button(page_link_to('user_shifts') . '&entry_id=' . $entry['id'], glyph('trash'), 'btn-xs')
- ));
+ ]);
} else {
$member = User_Nick_render($entry);
}
diff --git a/includes/sys_menu.php b/includes/sys_menu.php
index 42376019..112c490f 100644
--- a/includes/sys_menu.php
+++ b/includes/sys_menu.php
@@ -17,7 +17,7 @@ function page_link_to_absolute($page) {
function header_toolbar() {
global $page, $privileges, $user, $enable_tshirt_size, $max_freeloadable_shifts;
- $toolbar_items = array();
+ $toolbar_items = [];
if (isset($user)) {
$toolbar_items[] = toolbar_item_link(page_link_to('shifts') . '&amp;action=next', 'time', User_shift_state_render($user));
diff --git a/includes/sys_template.php b/includes/sys_template.php
index 43ca66f2..829d45bc 100644
--- a/includes/sys_template.php
+++ b/includes/sys_template.php
@@ -3,12 +3,12 @@
/**
* Liste der verfügbaren Themes
*/
-$themes = array(
+$themes = [
'3' => "Engelsystem 32c3",
"2" => "Engelsystem cccamp15",
"0" => "Engelsystem light",
"1" => "Engelsystem dark"
-);
+];
/**
* Display muted (grey) text.
@@ -56,7 +56,7 @@ function heading($content, $number = 1) {
* @param array $items
* @return string
*/
-function toolbar($items = array(), $right = false) {
+function toolbar($items = [], $right = false) {
return '<ul class="nav navbar-nav' . ($right ? ' navbar-right' : '') . '">' . join("\n", $items) . '</ul>';
}
@@ -199,7 +199,7 @@ function form_checkboxes($name, $label, $items, $selected) {
* @param
* disabled Wie selected, nur dass die entsprechenden Checkboxen deaktiviert statt markiert sind
*/
-function form_multi_checkboxes($names, $label, $items, $selected, $disabled = array()) {
+function form_multi_checkboxes($names, $label, $items, $selected, $disabled = []) {
$html = "<table><thead><tr>";
foreach ($names as $title) {
$html .= "<th>$title</th>";
@@ -399,11 +399,11 @@ function button_glyph($href, $glyph, $class = "") {
/**
* Rendert eine Toolbar mit Knöpfen
*/
-function buttons($buttons = array ()) {
+function buttons($buttons = []) {
return '<div class="form-group">' . table_buttons($buttons) . '</div>';
}
-function table_buttons($buttons = array()) {
+function table_buttons($buttons = []) {
return '<div class="btn-group">' . join(' ', $buttons) . '</div>';
}
diff --git a/includes/view/AngelTypes_view.php b/includes/view/AngelTypes_view.php
index 65abe0f3..7e8663a1 100644
--- a/includes/view/AngelTypes_view.php
+++ b/includes/view/AngelTypes_view.php
@@ -38,17 +38,17 @@ function AngelType_render_membership($user_angeltype) {
}
function AngelType_delete_view($angeltype) {
- return page_with_title(sprintf(_("Delete angeltype %s"), $angeltype['name']), array(
+ return page_with_title(sprintf(_("Delete angeltype %s"), $angeltype['name']), [
info(sprintf(_("Do you want to delete angeltype %s?"), $angeltype['name']), true),
buttons([
button(page_link_to('angeltypes'), _("cancel"), 'cancel'),
button(page_link_to('angeltypes') . '&action=delete&angeltype_id=' . $angeltype['id'] . '&confirmed', _("delete"), 'ok')
])
- ));
+ ]);
}
function AngelType_edit_view($name, $restricted, $description, $coordinator_mode, $requires_driver_license) {
- return page_with_title(sprintf(_("Edit %s"), $name), array(
+ return page_with_title(sprintf(_("Edit %s"), $name), [
buttons([
button(page_link_to('angeltypes'), _("Angeltypes"), 'back')
]),
@@ -62,7 +62,7 @@ function AngelType_edit_view($name, $restricted, $description, $coordinator_mode
form_info("", _("Please use markdown for the description.")),
form_submit('submit', _("Save"))
])
- ));
+ ]);
}
function AngelType_view($angeltype, $members, $user_angeltype, $admin_user_angeltypes, $admin_angeltypes, $coordinator, $user_driver_license, $user) {
diff --git a/includes/view/User_view.php b/includes/view/User_view.php
index 5c258fc7..3e365ea2 100644
--- a/includes/view/User_view.php
+++ b/includes/view/User_view.php
@@ -97,11 +97,11 @@ function Users_view($users, $order_by, $arrived_count, $active_count, $force_act
$user['force_active'] = glyph_bool($user['force_active']);
$user['Tshirt'] = glyph_bool($user['Tshirt']);
$user['lastLogIn'] = date(_('m/d/Y h:i a'), $user['lastLogIn']);
- $user['actions'] = table_buttons(array(
+ $user['actions'] = table_buttons([
button_glyph(page_link_to('admin_user') . '&id=' . $user['UID'], 'edit', 'btn-xs')
- ));
+ ]);
}
- $users[] = array(
+ $users[] = [
'Nick' => '<strong>' . _('Sum') . '</strong>',
'Gekommen' => $arrived_count,
'got_voucher' => $voucher_count,
@@ -110,7 +110,7 @@ function Users_view($users, $order_by, $arrived_count, $active_count, $force_act
'freeloads' => $freeloads_count,
'Tshirt' => $tshirts_count,
'actions' => '<strong>' . count($users) . '</strong>'
- );
+ ];
return page_with_title(_('All users'), [
msg(),