Elgg  Version 5.1
plugins.php
Go to the documentation of this file.
1 <?php
10 elgg_require_js('admin/plugins');
11 
12 $list_only = (bool) elgg_extract('list_only', $vars, false);
14 
15 // @todo this should occur in the controller code
16 _elgg_services()->plugins->generateEntities();
17 
19 
20 // needed for expected plugin view rendering, there are usecases where this is not set so forcing it here
21 elgg_push_context('admin');
22 
24  'limit' => false,
25  'full_view' => true,
26  'pagination' => false,
27  'display_reordering' => true,
28  'active_filter' => $active_filter,
29 ]);
30 
31 $plugins_list .= "<div id='elgg-plugin-list-cover'></div>";
32 
34 
35 if ($list_only) {
36  echo $plugins_list;
37  return;
38 }
39 
40 echo elgg_view('admin/plugins/categories', [
41  'plugins' => $installed_plugins,
42  'active_filter' => $active_filter,
43 ]);
44 
45 elgg_register_menu_item('title', [
46  'name' => 'activate-all',
47  'href' => elgg_generate_action_url('admin/plugins/activate_all'),
48  'text' => elgg_echo('admin:plugins:activate_all'),
49  'link_class' => 'elgg-button elgg-button-submit elgg-plugins-toggle',
50  'data-desired-state' => 'active',
51 ]);
52 elgg_register_menu_item('title', [
53  'name' => 'dactivate-all',
54  'href' => elgg_generate_action_url('admin/plugins/deactivate_all'),
55  'text' => elgg_echo('admin:plugins:deactivate_all'),
56  'link_class' => 'elgg-button elgg-button-submit elgg-plugins-toggle',
57  'data-desired-state' => 'inactive',
58 ]);
59 
60 
61 echo elgg_format_element('div', [
62  'id' => 'elgg-plugin-list',
63 ], $plugins_list);
elgg_get_plugins(string $status= 'active')
Returns an ordered list of plugins.
Definition: plugins.php:55
elgg_generate_action_url(string $action, array $query=[], bool $add_csrf_tokens=true)
Generate an action URL.
$installed_plugins
Definition: plugins.php:18
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
elgg_strtolower()
Wrapper function for mb_strtolower().
Definition: mb_wrapper.php:161
$list_only
Definition: plugins.php:12
get_input(string $variable, $default=null, bool $filter_result=true)
Parameter input functions.
Definition: input.php:20
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:254
elgg_pop_context()
Removes and returns the top context string from the stack.
Definition: context.php:62
elgg_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition: views.php:177
$plugins_list
Definition: plugins.php:23
$active_filter
Definition: plugins.php:13
elgg_view_entity_list(array $entities, array $vars=[])
Returns a rendered list of entities with pagination.
Definition: views.php:657
elgg_push_context(string $context)
Push a context onto the top of the stack.
Definition: context.php:52
$vars
Definition: theme.php:5
_elgg_services()
Get the global service provider.
Definition: elgglib.php:346
elgg_format_element(string $tag_name, array $attributes=[], string $text= '', array $options=[])
Format an HTML element.
Definition: output.php:145
elgg_require_js(string $name)
Request that Elgg load an AMD module onto the page.
elgg_register_menu_item(string $menu_name, array|\ElggMenuItem $menu_item)
Elgg navigation library Functions for managing menus and other navigational elements.
Definition: navigation.php:83