95 if (!isset($CONFIG->menus[$menu_name])) {
96 $CONFIG->menus[$menu_name] = array();
99 if (is_array($menu_item)) {
102 elgg_log(
"Unable to add menu item '{$menu_item['name']}' to '$menu_name' menu",
'WARNING');
109 $CONFIG->menus[$menu_name][] =
$item;
125 if (!isset($CONFIG->menus[$menu_name])) {
129 foreach ($CONFIG->menus[$menu_name] as $index => $menu_object) {
131 if ($menu_object->getName() == $item_name) {
132 $item = $CONFIG->menus[$menu_name][$index];
133 unset($CONFIG->menus[$menu_name][$index]);
153 if (!isset($CONFIG->menus[$menu_name])) {
157 foreach ($CONFIG->menus[$menu_name] as $menu_object) {
159 if ($menu_object->getName() == $item_name) {
179 if (!isset($CONFIG->menus[$menu_name])) {
183 foreach ($CONFIG->menus[$menu_name] as $index => $menu_object) {
185 if ($menu_object->getName() == $item_name) {
186 return $CONFIG->menus[$menu_name][$index];
223 'href' =>
"$handler/$name/$guid",
225 'link_class' =>
'elgg-button elgg-button-action',
246 if (!isset($CONFIG->breadcrumbs)) {
247 $CONFIG->breadcrumbs = array();
250 $CONFIG->breadcrumbs[] = array(
'title' =>
$title,
'link' => $link);
262 if (empty($CONFIG->breadcrumbs) || !is_array($CONFIG->breadcrumbs)) {
265 return array_pop($CONFIG->breadcrumbs);
282 if (isset($CONFIG->breadcrumbs) && is_array($CONFIG->breadcrumbs)) {
283 $breadcrumbs = $CONFIG->breadcrumbs;
285 $breadcrumbs = array();
289 'breadcrumbs' => $breadcrumbs,
292 if (!is_array($breadcrumbs)) {
312 foreach (array_keys($breadcrumbs) as $i) {
313 $breadcrumbs[$i][
'title'] =
elgg_get_excerpt($breadcrumbs[$i][
'title'], 100);
332 $registered =
$return[
'default'];
338 foreach ($registered as $index =>
$item) {
341 unset($registered[$index]);
354 $return[
'default'] = $featured;
355 if (count($registered) > 0) {
360 $max_display_items = 5;
366 $return[
'more'] = array_splice(
$return[
'default'], $max_display_items);
372 foreach (
$return as $section) {
375 foreach ($section as
$item) {
376 if ($item->getSelected()) {
386 foreach (
$return as $section_name => $section) {
394 if (
$item->getHref() == $current_url) {
416 if (
$item->annotation_id == 0) {
420 'href' =>
"#comments-add-$object->guid",
477 'href' =>
"$handler/edit/{$entity->getGUID()}",
487 'href' =>
"action/$handler/delete?guid={$entity->getGUID()}",
508 'name' =>
'collapse',
510 'href' =>
"#elgg-widget-content-$widget->guid",
511 'link_class' =>
'elgg-widget-collapse-button',
522 'href' =>
"action/widgets/delete?widget_guid=$widget->guid",
524 'link_class' =>
'elgg-widget-delete-button',
525 'id' =>
"elgg-widget-delete-button-$widget->guid",
526 'data-elgg-widget-type' =>
$widget->handler,
533 'name' =>
'settings',
536 'href' =>
"#widget-edit-$widget->guid",
537 'link_class' =>
"elgg-widget-edit-button",
556 'name' =>
'register',
557 'href' =>
'register',
559 'link_class' =>
'registration_link',
564 'name' =>
'forgotpassword',
565 'href' =>
'forgotpassword',
566 'text' =>
elgg_echo(
'user:password:lost'),
567 'link_class' =>
'forgot_link',
592 'href' =>
'http://elgg.org',
613 if (is_array($return_value)) {
614 $return_value[] =
'navigation/menu/user_hover/contents';
617 return $return_value;
621 $events->registerHandler(
'init',
'system',
'_elgg_nav_init');
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
elgg_push_breadcrumb($title, $link=null)
Adds a breadcrumb to the breadcrumbs stack.
elgg_is_logged_in()
Returns whether or not the user is currently logged in.
elgg_unregister_menu_item($menu_name, $item_name)
Remove an item from a menu.
elgg_add_action_tokens_to_url($url, $html_encode=false)
Adds action tokens to URL.
_elgg_login_menu_setup($hook, $type, $return, $params)
Add the register and forgot password links to login menu private.
elgg_is_admin_logged_in()
Returns whether or not the viewer is currently logged in and an admin user.
elgg_view_icon($name, $vars=array())
View one of the elgg sprite icons.
if($guid==elgg_get_logged_in_user_guid()) $name
elgg_get_menu_item($menu_name, $item_name)
Get a menu item registered for a menu.
$guid
Removes an admin notice.
elgg_extract($key, array $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
elgg_register_plugin_hook_handler($hook, $type, $callback, $priority=500)
_elgg_widget_menu_setup($hook, $type, $return, $params)
Widget menu is a set of widget controls private.
elgg_prepare_breadcrumbs($hook, $type, $breadcrumbs, $params)
Hook handler to turn titles into 100-character excerpts.
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
elgg_in_context($context)
Check if this context exists anywhere in the stack.
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
elgg_get_breadcrumbs()
Returns all breadcrumbs as an array of array('title' => 'Title', 'link' => 'URL') ...
elgg_register_title_button($handler=null, $name= 'add')
Convenience function for registering a button to the title menu.
elgg_get_context()
Get the current context.
elgg global
Pointer to the global context.
elgg_get_site_url($site_guid=0)
Get the URL for the current (or specified) site.
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
elgg_register_menu_item($menu_name, $menu_item)
Register an item for an Elgg menu.
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype= '')
Return a parsed view.
_elgg_entity_menu_setup($hook, $type, $return, $params)
Entity menu is list of links and info on any entity private.
elgg_log($message, $level= 'NOTICE')
Display or log a message.
_elgg_site_menu_setup($hook, $type, $return, $params)
Set up the site menu.
elgg_get_version($human_readable=false)
Get the current Elgg version information.
_elgg_nav_init()
Navigation initialization private.
elgg_register_ajax_view($view)
Register a view to be available for ajax calls.
elgg_get_excerpt($text, $num_chars=250)
Returns an excerpt.
elgg_get_logged_in_user_entity()
Return the current logged in user, or null if no user is logged in.
_elgg_nav_public_pages($hook_name, $entity_type, $return_value, $params)
Extend public pages.
_elgg_river_menu_setup($hook, $type, $return, $params)
Add the comment and like links to river actions menu private.
elgg_pop_breadcrumb()
Removes last breadcrumb entry.
elgg_is_menu_item_registered($menu_name, $item_name)
Check if a menu item has been registered.