Elgg  Version 6.1
online.php
Go to the documentation of this file.
1 <?php
7 use Elgg\Values;
8 
9 elgg_unregister_event_handler('register', 'menu:filter:admin/users', 'Elgg\Menus\FilterSortItems::registerTimeCreatedSorting');
10 elgg_register_event_handler('register', 'menu:filter:admin/users', 'Elgg\Menus\FilterSortItems::registerLastActionSorting', 499);
11 
12 echo elgg_view('admin/users/header', [
13  'filter' => 'online',
14 ]);
15 
16 echo elgg_view_form('admin/users/bulk_actions', [
17  'prevent_double_submit' => false,
18 ], [
19  'filter' => 'online',
20  'options' => [
21  'wheres' => [
22  function(QueryBuilder $qb, $main_alias) {
23  return $qb->compare("{$main_alias}.last_action", '>=', Values::normalizeTimestamp('-10 minutes'), ELGG_VALUE_TIMESTAMP);
24  }
25  ],
26  'sort_by' => get_input('sort_by', [
27  'property' => 'last_action',
28  'property_type' => 'attribute',
29  'direction' => 'desc',
30  ]),
31  ],
32  'menu_vars' => [
33  'show_unban' => false,
34  ],
35 ]);
elgg_register_event_handler(string $event, string $type, callable|string $callback, int $priority=500)
Helper functions for event handling.
Definition: events.php:48
elgg_unregister_event_handler(string $event, string $type, callable|string $callback)
Unregisters a callback for an event.
Definition: events.php:62
elgg_view_form(string $action, array $form_vars=[], array $body_vars=[])
Definition: views.php:1033
Saves user notification settings.
Database abstraction query builder.
get_input(string $variable, $default=null, bool $filter_result=true)
Parameter input functions.
Definition: input.php:20
elgg_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition: views.php:156
compare(string $x, string $comparison, $y=null, string $type=null, bool $case_sensitive=null)
Build value comparison clause.
const ELGG_VALUE_TIMESTAMP
Definition: constants.php:115
$qb
Definition: queue.php:12