From 91b7bf19a5f47b8e8f79311738d5b0a5d340502c Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Mon, 30 Mar 2015 17:28:12 +0200 Subject: [PATCH] Added functions to help with the data assign to the variables --- pandora_console/include/functions.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 1078940e0f..c70d6868d3 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -2318,4 +2318,26 @@ function set_pandora_error_for_header($message, $title = null) { $_SESSION["alert_msg"] .= ui_print_error_message($message_config, '', true); } + +function set_if_defined (&$var, $test) { + if (isset($test)) { + $var = $test; + + return true; + } + else { + return false; + } +} + +function set_unless_defined (&$var, $default) { + if (! isset($var)) { + $var = $default; + + return true; + } + else { + return false; + } +} ?>