$label, 'href' => $link, 'selected' => $selected ); if (!$group) { $group = 'default'; } if ($onclick) { $js = "onclick=\"javascript:return confirm('" . elgg_echo('deleteconfirm') . "')\""; $item['vars'] = array('js' => $js); } // submenu items were added in the page setup hook usually by checking // the context. We'll pass in the current context here, which will // emulate that effect. // if context == 'main' (default) it probably means they always wanted // the menu item to show up everywhere. $context = elgg_get_context(); if ($context == 'main') { $context = 'all'; } return elgg_add_submenu_item($item, $context, $group); } /** * Add an entry to the submenu. * * @param array $item The item as: * * array( * 'title' => 'Text to display', * 'url' => 'URL of the link', * 'id' => 'entry_unique_id' //used by children items to identify parents * 'parent_id' => 'id_of_parent', * 'selected' => BOOL // Is this item selected? (If NULL or unset will attempt to guess) * 'vars' => array() // Array of vars to pass to the navigation/submenu_item view * ) * * * @param string $context Context in which to display this menu item. 'all' * will make it show up all the time. Use sparingly. * @param string $group Group for the item. Each submenu group has its own