Elgg  Version 4.3
bulk_actions.php
Go to the documentation of this file.
1 <?php
10 elgg_require_css('forms/admin/users/bulk_actions');
11 elgg_require_js('forms/admin/users/bulk_actions');
12 
13 // did we search
15 $getter = $query ? 'elgg_search' : 'elgg_get_entities';
16 
17 // make selection options
19  'type' => 'user',
20  'subtype'=> null,
21  'full_view' => false,
22  'list_type' => 'table',
23  'limit' => max(25, elgg_get_config('default_limit'), (int) get_input('limit', 0)),
24  'columns' => [
25  elgg()->table_columns->checkbox(elgg_view('input/checkbox', [
26  'name' => 'user_guids',
27  'title' => elgg_echo('table_columns:fromView:checkbox'),
28  ]), [
29  'name' => 'user_guids[]',
30  ]),
31  elgg()->table_columns->icon(null, [
32  'use_hover' => false,
33  ]),
34  elgg()->table_columns->user(null, [
35  'item_view' => 'user/default/admin_column',
36  ]),
37  elgg()->table_columns->email(),
38  elgg()->table_columns->time_created(null, [
39  'format' => 'friendly',
40  ]),
41  elgg()->table_columns->entity_menu(null, [
42  'add_user_hover_admin_section' => true,
43  'admin_listing' => elgg_extract('filter', $vars, 'all'),
44  ]),
45  ],
46  'list_class' => 'elgg-admin-users',
47  'query' => $query,
48 ];
49 
50 // merge additional options
51 $options = (array) elgg_extract('options', $vars, []);
52 $options = array_merge($default_options, $options);
53 
56 });
57 if (empty($users)) {
58  echo elgg_view('page/components/no_results', [
59  'no_results' => elgg_extract('no_results', $vars, true),
60  ]);
61  return;
62 }
63 
64 // draw a menu for bulk actions
65 // the menu items will be shown as submit buttons with a custom formaction
67  'class' => ['elgg-menu-hz', 'elgg-admin-users-bulkactions-buttons'],
68  'item_contents_view' => 'navigation/menu/elements/item/submit',
69  'filter_value' => elgg_extract('filter', $vars, 'all'),
70  // @see \Elgg\Menus\AdminUsersBulk::registerActions()
71  'show_ban' => true,
72  'show_unban' => true,
73  'show_delete' => true,
74  'show_validate' => false,
75 ];
76 $menu_vars = (array) elgg_extract('menu_vars', $vars, []);
78 echo elgg_view_menu('admin:users:bulk', $menu_vars);
79 
80 echo $users;
elgg_call(int $flags, Closure $closure)
Calls a callable autowiring the arguments using public DI services and applying logic based on flags...
Definition: elgglib.php:592
elgg_require_css(string $view)
Register a CSS view name to be included in the HTML head.
if(empty($users)) $default_menu_vars
$users
elgg_echo($message_key, array $args=[], $language="")
Elgg language module Functions to manage language and translations.
Definition: languages.php:18
elgg_list_entities(array $options=[], $getter= 'elgg_get_entities', $viewer= 'elgg_view_entity_list')
Returns a string of rendered entities.
Definition: entities.php:589
elgg_view_menu($menu, array $vars=[])
Render a menu.
Definition: views.php:468
const ELGG_SHOW_DISABLED_ENTITIES
Definition: constants.php:148
get_input($variable, $default=null, $filter_result=true)
Parameter input functions.
Definition: input.php:20
$getter
elgg_require_js($name)
Request that Elgg load an AMD module onto the page.
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:547
$default_options
$query
if(empty($users)) $menu_vars
elgg echo
Translates a string.
Definition: deprecated.js:530
$vars['head']
Definition: html.php:24
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:179
var elgg
Definition: elgglib.js:4
elgg_get_config($name, $default=null)
Get an Elgg configuration value.
$options