mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-20 20:34:54 +02:00
Added functions to help with the data assign to the variables
This commit is contained in:
parent
9920fa9a3f
commit
91b7bf19a5
@ -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;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user