_getVariable($varname, $_ptr, $search_parents, false); if (is_object($_var)) { return $_var->value; } else { return null; } } else { $_result = array(); if ($_ptr === null) { $_ptr = $data; } while ($_ptr !== null) { foreach ($_ptr->tpl_vars AS $key => $var) { if (!array_key_exists($key, $_result)) { $_result[$key] = $var->value; } } // not found, try at parent if ($search_parents) { $_ptr = $_ptr->parent; } else { $_ptr = null; } } if ($search_parents && isset(Smarty::$global_tpl_vars)) { foreach (Smarty::$global_tpl_vars AS $key => $var) { if (!array_key_exists($key, $_result)) { $_result[$key] = $var->value; } } } return $_result; } } }