From d71e7bbfad2f07f82df0c515608996d250fd4182 Mon Sep 17 00:00:00 2001 From: Bot Date: Mon, 2 Jan 2017 15:43:36 +0100 Subject: Formatting --- includes/helper/email_helper.php | 16 +++++++++------ includes/helper/graph_helper.php | 27 +++++++++++++------------ includes/helper/internationalization_helper.php | 12 +++++++---- includes/helper/message_helper.php | 6 +++--- 4 files changed, 35 insertions(+), 26 deletions(-) (limited to 'includes/helper') diff --git a/includes/helper/email_helper.php b/includes/helper/email_helper.php index 934193e2..35bdbc9a 100644 --- a/includes/helper/email_helper.php +++ b/includes/helper/email_helper.php @@ -3,22 +3,26 @@ function engelsystem_email_to_user($recipient_user, $title, $message, $not_if_its_me = false) { global $user; - + if ($not_if_its_me && $user['UID'] == $recipient_user['UID']) { return true; } - + gettext_locale($recipient_user['Sprache']); - - $message = sprintf(_("Hi %s,"), $recipient_user['Nick']) . "\n\n" . _("here is a message for you from the engelsystem:") . "\n\n" . $message . "\n\n" . _("This email is autogenerated and has not to be signed. You got this email because you are registered in the engelsystem."); - + + $message = sprintf(_("Hi %s,"), $recipient_user['Nick']) . "\n\n" + . _("here is a message for you from the engelsystem:") . "\n\n" + . $message . "\n\n" + . _("This email is autogenerated and has not to be signed. You got this email because you are registered in the engelsystem."); + gettext_locale(); return engelsystem_email($recipient_user['email'], $title, $message); } function engelsystem_email($address, $title, $message) { - $result = mail($address, $title, $message, "Content-Type: text/plain; charset=UTF-8\r\nFrom: Engelsystem "); + $result = mail($address, $title, $message, + "Content-Type: text/plain; charset=UTF-8\r\nFrom: Engelsystem "); if ($result === false) { engelsystem_error('Unable to send email.'); } diff --git a/includes/helper/graph_helper.php b/includes/helper/graph_helper.php index c2d0f8a2..d844213c 100644 --- a/includes/helper/graph_helper.php +++ b/includes/helper/graph_helper.php @@ -2,10 +2,11 @@ /** * Renders a bargraph - * @param string $key keyname of the x-axis - * @param array $row_names keynames for the data rows - * @param unknown $colors colors for the data rows - * @param unknown $data the data + * + * @param string $key keyname of the x-axis + * @param array $row_names keynames for the data rows + * @param unknown $colors colors for the data rows + * @param unknown $data the data */ function bargraph($dom_id, $key, $row_names, $colors, $data) { @@ -13,7 +14,7 @@ function bargraph($dom_id, $key, $row_names, $colors, $data) foreach ($data as $dataset) { $labels[] = $dataset[$key]; } - + $datasets = []; foreach ($row_names as $row_key => $name) { $values = []; @@ -21,20 +22,20 @@ function bargraph($dom_id, $key, $row_names, $colors, $data) $values[] = $dataset[$row_key]; } $datasets[] = [ - 'label' => $name, - 'fillColor' => $colors[$row_key], - 'data' => $values - ]; + 'label' => $name, + 'fillColor' => $colors[$row_key], + 'data' => $values + ]; } - + return ' '; } diff --git a/includes/helper/internationalization_helper.php b/includes/helper/internationalization_helper.php index 4abf8c4d..d4df1cb7 100644 --- a/includes/helper/internationalization_helper.php +++ b/includes/helper/internationalization_helper.php @@ -31,7 +31,7 @@ function gettext_init() if (isset($_REQUEST['set_locale']) && isset($locales[$_REQUEST['set_locale']])) { $_SESSION['locale'] = $_REQUEST['set_locale']; - } elseif (! isset($_SESSION['locale'])) { + } elseif (!isset($_SESSION['locale'])) { $_SESSION['locale'] = $default_locale; } @@ -51,7 +51,7 @@ function gettext_locale($locale = null) if ($locale == null) { $locale = $_SESSION['locale']; } - + putenv('LC_ALL=' . $locale); setlocale(LC_ALL, $locale); } @@ -65,10 +65,14 @@ function make_langselect() { global $locales; $URL = $_SERVER["REQUEST_URI"] . (strpos($_SERVER["REQUEST_URI"], "?") > 0 ? '&' : '?') . "set_locale="; - + $items = []; foreach ($locales as $locale => $name) { - $items[] = toolbar_item_link(htmlspecialchars($URL) . $locale, '', '' . $name . ' ' . $name); + $items[] = toolbar_item_link( + htmlspecialchars($URL) . $locale, + '', + '' . $name . ' ' . $name + ); } return $items; } diff --git a/includes/helper/message_helper.php b/includes/helper/message_helper.php index 323eee4d..a085aa0e 100644 --- a/includes/helper/message_helper.php +++ b/includes/helper/message_helper.php @@ -5,7 +5,7 @@ */ function msg() { - if (! isset($_SESSION['msg'])) { + if (!isset($_SESSION['msg'])) { return ""; } $msg = $_SESSION['msg']; @@ -48,8 +48,8 @@ function alert($class, $msg, $immediatly = false) } return '
' . $msg . '
'; } - - if (! isset($_SESSION['msg'])) { + + if (!isset($_SESSION['msg'])) { $_SESSION['msg'] = ""; } $_SESSION['msg'] .= alert($class, $msg, true); -- cgit v1.2.3-54-g00ecf