From 356b2582f3e6a43ecf2607acad4a7fe0b37f659a Mon Sep 17 00:00:00 2001 From: Bot Date: Tue, 3 Jan 2017 03:22:48 +0100 Subject: PPHDoc, formatting, fixes, cleanup --- includes/helper/email_helper.php | 25 +++++++++++++++-- includes/helper/graph_helper.php | 10 ++++--- includes/helper/internationalization_helper.php | 6 +++- includes/helper/message_helper.php | 37 +++++++++++++++++++------ 4 files changed, 63 insertions(+), 15 deletions(-) (limited to 'includes/helper') diff --git a/includes/helper/email_helper.php b/includes/helper/email_helper.php index 35bdbc9a..18203ecb 100644 --- a/includes/helper/email_helper.php +++ b/includes/helper/email_helper.php @@ -1,5 +1,12 @@ "); + $result = mail( + $address, + $title, + $message, + "Content-Type: text/plain; charset=UTF-8\r\nFrom: Engelsystem " + ); + if ($result === false) { engelsystem_error('Unable to send email.'); } + + return true; } diff --git a/includes/helper/graph_helper.php b/includes/helper/graph_helper.php index d844213c..12c7df6c 100644 --- a/includes/helper/graph_helper.php +++ b/includes/helper/graph_helper.php @@ -3,10 +3,12 @@ /** * 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 $dom_id + * @param string $key key name of the x-axis + * @param array $row_names key names for the data rows + * @param array $colors colors for the data rows + * @param array $data the data + * @return string */ function bargraph($dom_id, $key, $row_names, $colors, $data) { diff --git a/includes/helper/internationalization_helper.php b/includes/helper/internationalization_helper.php index d4df1cb7..ee9339e2 100644 --- a/includes/helper/internationalization_helper.php +++ b/includes/helper/internationalization_helper.php @@ -8,6 +8,8 @@ $default_locale = 'en_US.UTF-8'; /** * Return currently active locale + * + * @return string */ function locale() { @@ -16,6 +18,8 @@ function locale() /** * Returns two letter language code from currently active locale + * + * @return string */ function locale_short() { @@ -59,7 +63,7 @@ function gettext_locale($locale = null) /** * Renders language selection. * - * @return string + * @return array */ function make_langselect() { diff --git a/includes/helper/message_helper.php b/includes/helper/message_helper.php index a085aa0e..613ac32e 100644 --- a/includes/helper/message_helper.php +++ b/includes/helper/message_helper.php @@ -2,6 +2,8 @@ /** * Gibt zwischengespeicherte Fehlermeldungen zurück und löscht den Zwischenspeicher + * + * @return string */ function msg() { @@ -15,34 +17,51 @@ function msg() /** * Rendert eine Information + * + * @param string $msg + * @param bool $immediately + * @return string */ -function info($msg, $immediatly = false) +function info($msg, $immediately = false) { - return alert('info', $msg, $immediatly); + return alert('info', $msg, $immediately); } /** * Rendert eine Fehlermeldung + * + * @param string $msg + * @param bool $immediately + * @return string */ -function error($msg, $immediatly = false) +function error($msg, $immediately = false) { - return alert('danger', $msg, $immediatly); + return alert('danger', $msg, $immediately); } /** * Rendert eine Erfolgsmeldung + * + * @param string $msg + * @param bool $immediately + * @return string */ -function success($msg, $immediatly = false) +function success($msg, $immediately = false) { - return alert('success', $msg, $immediatly); + return alert('success', $msg, $immediately); } /** * Renders an alert with given alert-* class. + * + * @param string $class + * @param string $msg + * @param bool $immediately + * @return string|null */ -function alert($class, $msg, $immediatly = false) +function alert($class, $msg, $immediately = false) { - if ($immediatly) { + if ($immediately) { if ($msg == "") { return ""; } @@ -53,4 +72,6 @@ function alert($class, $msg, $immediatly = false) $_SESSION['msg'] = ""; } $_SESSION['msg'] .= alert($class, $msg, true); + + return null; } -- cgit v1.2.3-54-g00ecf