custom/menu_helper/menu_helper_active/menu_helper_active.module, line 69
_menu_helper_active_item_state($on=TRUE)Set the active item state to use custom active path.
This function allow the menu_helper_tree_output() function to set (and unset) the active menu item before and after rendering a menu. It is very important to not completely over-write the active menu item which could be used by another module or theme.
$on Boolean to set whether to change current path to active path or vice-versa
A boolean set to TRUE is the state was changed or FALSE if there is no active path
<?php
function _menu_helper_active_item_state($on=TRUE) {
static $current_path;
static $active_path;
// Store both default paths
if (!isset($current_path ) ) {
$current_path = $_GET['q'];
}
if (!isset($active_path) ) {
$active_path = _menu_helper_active_get_active_path();
}
// Do not change anything if there is not active path
if (!$active_path) {
return FALSE;
}
if ($on) {
$_GET['q'] = $active_path; // aka menu_set_active_item($active_item_path );
}
else {
$_GET['q'] = $current_path;
}
return TRUE;
}
?>