I have a function that returns sets of variables. Now, I want to control the return value by using node status. Basically I dont want the value to be returned when the node is unpublished. Any idea? Here is the function by the way. I just need to add a condition in the return value like this if($node->status == 1){ return $omniture_variables; }
function my_module_omniture_variables() {
$current_day = date('D');
$current_hour = date('G');
.....
$omniture_variables['variables'] = array(
....
);
//Sets omniture variables
if(module_exists('omniture')) {
....
}
if(count($extra_variables) > 0) {
$omniture_variables['variables'] = array_merge($omniture_variables['variables'], $extra_variables);
}
return $omniture_variables;
}