30 $return = $event->getValue();
36 'name' =>
"custom{$n}",
55 $menu = $event->getValue();
59 $registered =
$menu->getItems(
'default');
60 if (empty($registered)) {
64 $has_selected =
false;
67 foreach ($registered as
$item) {
70 $item->setPriority($featured_index);
76 if ($item->getSelected()) {
99 foreach ($registered as $item) {
100 if ($is_selected($item)) {
101 $item->setSelected(
true);
107 usort($registered, [\ElggMenuBuilder::class,
'compareByPriority']);
109 $max_display_items = $event->getParam(
'max_display_items', 5);
114 if ($max_display_items &&
$num_menu_items > ($max_display_items + 1)) {
115 $more = array_splice($registered, $max_display_items);
126 foreach ($more as $item) {
127 $item->setParentName(
'more');
130 $dropdown->setChildren($more);
132 $registered[] = $dropdown;
135 $menu->getSection(
'default')->fill($registered);
elgg_get_config(string $name, $default=null)
Get an Elgg configuration value.
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
elgg_get_context()
Get the current context.
elgg_strpos()
Wrapper function for mb_strpos().
elgg_get_site_url()
Get the URL for the current (or specified) site, ending with "/".
foreach($plugin_guids as $guid) if(empty($deactivated_plugins)) $url
Models an event passed to event handlers.