90 if (is_array($menu_item)) {
95 elgg_log(
"Unable to add menu item '{$menu_item_name}' to '$menu_name' menu",
'WARNING');
101 elgg_log(
'Second argument of elgg_register_menu_item() must be an instance of ' 102 .
'ElggMenuItem or an array of menu item factory options',
'ERROR');
111 $menus[$menu_name][] = $menu_item;
132 if (!isset($menus[$menu_name])) {
136 foreach ($menus[$menu_name] as
$index => $menu_object) {
138 if ($menu_object instanceof
ElggMenuItem && $menu_object->getName() == $item_name) {
140 unset($menus[$menu_name][
$index]);
176 if (!empty($logged_in_user) && ($logged_in_user->guid !==
$owner->guid)) {
183 if (!
$owner instanceof \
ElggEntity || empty($entity_type) || empty($entity_subtype) || !
$owner->canWriteToContainer(0, $entity_type, $entity_subtype)) {
192 elgg_deprecated_notice(
'Using handler for fallback HREF determination is no longer supported in ' . __METHOD__,
'4.0');
204 'icon' =>
$name ===
'add' ?
'plus' :
'',
207 'link_class' =>
'elgg-button elgg-button-action',
elgg_language_key_exists($key, $language= 'en')
Check if a given language key exists.
elgg_unregister_menu_item($menu_name, $item_name)
Remove an item from a menu.
elgg_deprecated_notice(string $msg, string $dep_version)
Log a notice about deprecated use of a function, view, etc.
if(!$user||!$user->canDelete()) $name
elgg_echo($message_key, array $args=[], $language="")
Elgg language module Functions to manage language and translations.
elgg_set_config($name, $value)
Set an Elgg configuration value.
elgg_log($message, $level=\Psr\Log\LogLevel::NOTICE)
Log a message.
elgg_generate_url($name, array $parameters=[])
Generate a URL for named route.
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
elgg_register_menu_item($menu_name, $menu_item)
Elgg navigation library Functions for managing menus and other navigational elements.
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
_elgg_services()
Get the global service provider.
elgg_get_logged_in_user_entity()
Return the current logged in user, or null if no user is logged in.
elgg_register_title_button($handler=null, $name= 'add', $entity_type= '', $entity_subtype= '')
Convenience function for registering a button to the title menu.