54 if (is_array($registered_items)) {
55 $items->merge($registered_items);
62 if (!isset(
$params[
'sort_by'])) {
63 $params[
'sort_by'] =
'priority';
69 $items = $this->events->triggerResults(
'register',
"menu:{$name}:{$entity->type}:{$entity->subtype}",
$params,
$items);
74 $items = $this->events->triggerResults(
'register',
"menu:{$name}:{$annotation->getType()}:{$annotation->getSubtype()}",
$params,
$items);
79 $items = $this->events->triggerResults(
'register',
"menu:{$name}:{$relationship->getType()}:{$relationship->getSubtype()}",
$params,
$items);
101 $builder = new \ElggMenuBuilder($menu->
getItems());
102 $builder->setSelected($selected_menu_item_name);
104 $params[
'menu'] = $builder->getMenu($sort_by);
105 $params[
'selected_item'] = $builder->getSelected();
110 $params[
'menu'] = $this->events->triggerResults(
'prepare',
"menu:{$name}:{$entity->type}:{$entity->subtype}",
$params,
$params[
'menu']);
115 $params[
'menu'] = $this->events->triggerResults(
'prepare',
"menu:{$name}:{$annotation->getType()}:{$annotation->getSubtype()}",
$params,
$params[
'menu']);
120 $params[
'menu'] = $this->events->triggerResults(
'prepare',
"menu:{$name}:{$relationship->getType()}:{$relationship->getSubtype()}",
$params,
$params[
'menu']);
143 if (
elgg_extract(
'prepare_vertical', $params) !==
true) {
147 $prepare =
function(
\ElggMenuItem $menu_item) use (&$prepare) {
148 $child_menu_vars = $menu_item->getChildMenuOptions();
149 if (empty($child_menu_vars[
'display'])) {
150 $child_menu_vars[
'display'] =
'toggle';
153 $menu_item->setChildMenuOptions($child_menu_vars);
155 foreach ($menu_item->getChildren() as $child_menu_item) {
156 $prepare($child_menu_item);
163 foreach ($section as $menu_item) {
164 $prepare($menu_item);
180 $selected_item =
elgg_extract(
'selected_item', $params);
185 $parent = $selected_item->getParent();
186 while ($parent instanceof \ElggMenuItem) {
187 $parent->setSelected();
188 $parent->addItemClass(
'elgg-has-selected-child');
189 $parent = $parent->getParent();
204 if (
elgg_extract(
'prepare_dropdown', $params) !==
true) {
216 'name' =>
'entity-menu-toggle',
217 'icon' =>
'ellipsis-v',
222 'display' =>
'dropdown',
223 'data-position' => json_encode([
224 'at' =>
'right bottom',
226 'collision' =>
'fit fit',
228 'class' =>
"elgg-{$menu_name}-dropdown-menu",
247 $item_contents_view =
elgg_extract(
'item_contents_view', $params,
'navigation/menu/elements/item/url');
249 $prepare =
function(
\ElggMenuItem $menu_item) use (&$prepare, $item_contents_view) {
250 if (!$menu_item->hasItemContentsView()) {
251 $menu_item->setItemContentsView($item_contents_view);
254 foreach ($menu_item->getChildren() as $child_menu_item) {
255 $prepare($child_menu_item);
262 foreach ($section as $menu_item) {
263 $prepare($menu_item);
284 $new_name =
implode(
'__', $names);
289 foreach ($names as
$name) {
296 $item->setSection($name);
299 $item->setData(
'menu_name', $name);
301 $all_items->add($item);
321 if (is_array($item)) {
330 $prepared_items->add($item);
333 return $prepared_items;
346 $this->menus[$menu_name][] = $menu_item;
359 if (!isset($this->menus[$menu_name])) {
363 foreach ($this->menus[$menu_name] as
$index => $menu_item) {
364 if ($menu_item->getName() === $item_name) {
366 unset($this->menus[$menu_name][
$index]);
$params
Saves global plugin settings.
if(!$user||!$user->canDelete()) $name
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
$relationship
Elgg default relationship view.
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
$config
Advanced site settings, debugging section.
if($who_can_change_language=== 'nobody') elseif($who_can_change_language=== 'admin_only'&&!elgg_is_admin_logged_in()) $options