function context_reaction_menu::get_active_paths in Context 7.3
Same name and namespace in other branches
- 6.3 plugins/context_reaction_menu.inc \context_reaction_menu::get_active_paths()
- 6 plugins/context_reaction_menu.inc \context_reaction_menu::get_active_paths()
Helper function to return the list of currently active paths.
The paths are grouped by menu name.
1 call to context_reaction_menu::get_active_paths()
- context_reaction_menu::execute in plugins/
context_reaction_menu.inc - Provide active trail in all menus in which our path appears.
File
- plugins/
context_reaction_menu.inc, line 131
Class
- context_reaction_menu
- Expose menu items as context reactions.
Code
function get_active_paths() {
$active_paths = array();
foreach ($this
->get_contexts() as $context) {
$paths = $this
->fetch_from_context($context);
$active_paths = array_merge($active_paths, $paths);
}
$by_menu_name = array();
foreach ($active_paths as $id) {
list($menu_name, $path) = explode(':', $id);
$by_menu_name[$menu_name][] = $path;
}
return $by_menu_name;
}