Elgg  Version 3.0
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);
13 
14 // @todo this should occur in the controller code
16 
18 
19 // needed for expected plugin view rendering, there are usecases where this is not set so forcing it here
20 elgg_push_context('admin');
21 
23  'limit' => 0,
24  'full_view' => true,
25  'list_type_toggle' => false,
26  'pagination' => false,
27  'display_reordering' => true,
28 ]);
29 
30 $plugins_list .= "<div id='elgg-plugin-list-cover'></div>";
31 
33 
34 if ($list_only) {
36  return;
37 }
38 
39 echo elgg_view('admin/plugins/categories', ['plugins' => $installed_plugins]);
40 
41 elgg_register_menu_item('title', [
42  'name' => 'activate-all',
43  'href' => 'action/admin/plugins/activate_all',
44  'text' => elgg_echo('admin:plugins:activate_all'),
45  'link_class' => 'elgg-button elgg-button-submit elgg-plugins-toggle',
46  'data-desired-state' => 'active',
47  'is_action' => true,
48 ]);
49 elgg_register_menu_item('title', [
50  'name' => 'dactivate-all',
51  'href' => 'action/admin/plugins/deactivate_all',
52  'text' => elgg_echo('admin:plugins:deactivate_all'),
53  'link_class' => 'elgg-button elgg-button-submit elgg-plugins-toggle',
54  'data-desired-state' => 'inactive',
55  'is_action' => true,
56 ]);
57 
58 
60  'id' => 'elgg-plugin-list',
61 ], $plugins_list);
$installed_plugins
Definition: plugins.php:17
elgg_view_entity_list($entities, array $vars=[])
Returns a rendered list of entities with pagination.
Definition: views.php:996
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
$list_only
Definition: plugins.php:12
elgg_require_js($name)
Request that Elgg load an AMD module onto the page.
Definition: elgglib.php:168
$plugins_list
Definition: plugins.php:22
elgg_format_element($tag_name, array $attributes=[], $text= '', array $options=[])
Format an HTML element.
Definition: output.php:168
elgg_pop_context()
Removes and returns the top context string from the stack.
Definition: pageowner.php:222
elgg echo
Translates a string.
Definition: languages.js:43
elgg_register_menu_item($menu_name, $menu_item)
Register an item for an Elgg menu.
Definition: navigation.php:100
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1131
elgg_get_plugins($status= 'active')
Returns an ordered list of plugins.
Definition: plugins.php:76
elgg_push_context($context)
Push a context onto the top of the stack.
Definition: pageowner.php:212
$vars['type']
Definition: save.php:11
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:246
_elgg_generate_plugin_entities()
Elgg plugins library Contains functions for managing plugins.
Definition: plugins.php:17