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);
98 $sort_by =
$menu->getSortBy();
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']);
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);
164 $prepare($menu_item);
185 $parent = $selected_item->getParent();
187 $parent->setSelected();
188 $parent->addItemClass(
'elgg-has-selected-child');
189 $parent = $parent->getParent();
214 $menu->getSection(
'default')->fill([
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);
263 $prepare($menu_item);
284 $new_name = implode(
'__', $names);
289 foreach ($names as
$name) {
301 $all_items->add(
$item);
307 return new UnpreparedMenu(
$params, $all_items);
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]);
if(! $user||! $user->canDelete()) $name
$params
Saves global plugin settings.
return[ 'admin/delete_admin_notices'=>['access'=> 'admin'], 'admin/menu/save'=>['access'=> 'admin'], 'admin/plugins/activate'=>['access'=> 'admin'], 'admin/plugins/activate_all'=>['access'=> 'admin'], 'admin/plugins/deactivate'=>['access'=> 'admin'], 'admin/plugins/deactivate_all'=>['access'=> 'admin'], 'admin/plugins/set_priority'=>['access'=> 'admin'], 'admin/security/security_txt'=>['access'=> 'admin'], 'admin/security/settings'=>['access'=> 'admin'], 'admin/security/regenerate_site_secret'=>['access'=> 'admin'], 'admin/site/cache/invalidate'=>['access'=> 'admin'], 'admin/site/flush_cache'=>['access'=> 'admin'], 'admin/site/icons'=>['access'=> 'admin'], 'admin/site/set_maintenance_mode'=>['access'=> 'admin'], 'admin/site/set_robots'=>['access'=> 'admin'], 'admin/site/theme'=>['access'=> 'admin'], 'admin/site/unlock_upgrade'=>['access'=> 'admin'], 'admin/site/settings'=>['access'=> 'admin'], 'admin/upgrade'=>['access'=> 'admin'], 'admin/upgrade/reset'=>['access'=> 'admin'], 'admin/user/ban'=>['access'=> 'admin'], 'admin/user/bulk/ban'=>['access'=> 'admin'], 'admin/user/bulk/delete'=>['access'=> 'admin'], 'admin/user/bulk/unban'=>['access'=> 'admin'], 'admin/user/bulk/validate'=>['access'=> 'admin'], 'admin/user/change_email'=>['access'=> 'admin'], 'admin/user/delete'=>['access'=> 'admin'], 'admin/user/login_as'=>['access'=> 'admin'], 'admin/user/logout_as'=>[], 'admin/user/makeadmin'=>['access'=> 'admin'], 'admin/user/resetpassword'=>['access'=> 'admin'], 'admin/user/removeadmin'=>['access'=> 'admin'], 'admin/user/unban'=>['access'=> 'admin'], 'admin/user/validate'=>['access'=> 'admin'], 'annotation/delete'=>[], 'avatar/upload'=>[], 'comment/save'=>[], 'diagnostics/download'=>['access'=> 'admin'], 'entity/chooserestoredestination'=>[], 'entity/delete'=>[], 'entity/mute'=>[], 'entity/restore'=>[], 'entity/subscribe'=>[], 'entity/trash'=>[], 'entity/unmute'=>[], 'entity/unsubscribe'=>[], 'login'=>['access'=> 'logged_out'], 'logout'=>[], 'notifications/mute'=>['access'=> 'public'], 'plugins/settings/remove'=>['access'=> 'admin'], 'plugins/settings/save'=>['access'=> 'admin'], 'plugins/usersettings/save'=>[], 'register'=>['access'=> 'logged_out', 'middleware'=>[\Elgg\Router\Middleware\RegistrationAllowedGatekeeper::class,],], 'river/delete'=>[], 'settings/notifications'=>[], 'settings/notifications/subscriptions'=>[], 'user/changepassword'=>['access'=> 'public'], 'user/requestnewpassword'=>['access'=> 'public'], 'useradd'=>['access'=> 'admin'], 'usersettings/save'=>[], 'widgets/add'=>[], 'widgets/delete'=>[], 'widgets/move'=>[], 'widgets/save'=>[],]
if($who_can_change_language==='nobody') elseif($who_can_change_language==='admin_only' &&!elgg_is_admin_logged_in()) $options
$config
Advanced site settings, debugging section.
$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.
elgg_echo(string $message_key, array $args=[], string $language='')
Elgg language module Functions to manage language and translations.
if(parse_url(elgg_get_site_url(), PHP_URL_PATH) !=='/') if(file_exists(elgg_get_root_path() . 'robots.txt'))
Set robots.txt.