Added functions to help with the data assign to the variables

This commit is contained in:
Alejandro Gallardo Escobar 2015-03-30 17:28:12 +02:00
parent 9920fa9a3f
commit 91b7bf19a5
1 changed files with 22 additions and 0 deletions

View File

@ -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;
}
}
?>