31 if (
elgg_extract(
'segments', $current_route->getMatchedParameters()) !==
'plugins' && $current_route->getName() !==
'admin:plugin_settings') {
37 if (empty($active_plugins)) {
42 $plugins_with_settings = [];
44 foreach ($active_plugins as
$plugin) {
53 'name' =>
"plugin:settings:{$plugin_id}",
58 'section' =>
'plugin_settings',
62 if (empty($plugins_with_settings)) {
67 $return = $event->getValue();
69 ksort($plugins_with_settings);
71 foreach ($plugins_with_settings as $plugin_item) {
94 $return = $event->getValue();
97 'name' =>
'1_account',
98 'text' =>
elgg_echo(
'usersettings:user:opt:linktext'),
100 'username' =>
$user->username,
102 'section' =>
'configure',
106 'name' =>
'1_notifications',
107 'text' =>
elgg_echo(
'usersettings:notifications:menu:page'),
109 'username' =>
$user->username,
111 'section' =>
'configure',
115 'name' =>
'1_statistics',
116 'text' =>
elgg_echo(
'usersettings:statistics:opt:linktext'),
118 'username' =>
$user->username,
120 'section' =>
'configure',
140 $return = $event->getValue();
143 'name' =>
'1_plugins',
144 'text' =>
elgg_echo(
'usersettings:plugins:opt:linktext'),
146 'section' =>
'configure',
147 'show_with_empty_children' =>
false,
151 foreach ($active_plugins as
$plugin) {
157 $title = $plugin->getDisplayName();
166 'username' =>
$user->username,
169 'parent_name' =>
'1_plugins',
170 'section' =>
'configure',
192 $return = $event->getValue();
195 foreach ($return as $menu_item) {
196 $section_name = $menu_item->getSection();
197 if (!in_array($section_name, [
'configure',
'administer',
'information'])) {
201 $menu_item->setSection(
'default');
202 if (empty($menu_item->getParentName())) {
203 $menu_item->setParentName($section_name);
207 $remove_items[] = $menu_item->getID();
209 elgg_deprecated_notice(
"The menu item [{$menu_item->getID()}] is using an old section of the admin page menu. These sections have been moved to the 'admin_header' menu. Please update your menu item configuration.",
'5.0');
212 foreach ($remove_items as
$id) {
214 $return->remove($id);
elgg_get_plugins(string $status= 'active')
Returns an ordered list of plugins.
elgg_deprecated_notice(string $msg, string $dep_version)
Log a notice about deprecated use of a function, view, etc.
elgg_is_admin_logged_in()
Returns whether or not the viewer is currently logged in and an admin user.
elgg_in_context(string $context)
Check if this context exists anywhere in the stack.
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
$plugin_id
Remove all user and plugin settings from the give plugin ID.
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
elgg_language_key_exists(string $key, string $language= 'en')
Check if a given language key exists.
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
elgg_get_current_route()
Get the route for the current request.
elgg_generate_url(string $name, array $parameters=[])
Generate a URL for named route.
if(!$plugin) $plugin_name
$id
Generic annotation delete action.
elgg_view_exists(string $view, string $viewtype= '', bool $recurse=true)
Returns whether the specified view exists.
Models an event passed to event handlers.
elgg_register_menu_item(string $menu_name, array|\ElggMenuItem $menu_item)
Elgg navigation library Functions for managing menus and other navigational elements.