Elgg  Version master
all.php
Go to the documentation of this file.
1 <?php
9 
11  'type_subtype_pairs' => elgg_entity_types_with_capability('restorable'),
12  'no_results' => elgg_echo('trash:no_results'),
13  'list_class' => 'elgg-listing-trash',
14  'item_view' => 'trash/entity',
15  'pagination_behaviour' => 'ajax-replace',
16  'limit' => max(20, (int) elgg_get_config('default_limit'), (int) get_input('limit')),
17  'sort_by' => [
18  'property' => 'time_deleted',
19  'direction' => 'desc',
20  ],
21  'wheres' => [],
22 ];
23 
24 $options = (array) elgg_extract('options', $vars, []);
25 $options = array_merge($defaults, $options);
26 
27 // ensure only deleted items are shown
28 $options['wheres'][] = function(QueryBuilder $qb, $main_alias) {
29  return $qb->compare("{$main_alias}.deleted", '=', 'yes', ELGG_VALUE_STRING);
30 };
31 
32 $vars['options'] = $options;
33 echo elgg_view('trash/elements/notice', $vars);
34 
35 echo elgg_call(ELGG_SHOW_DELETED_ENTITIES, function() use ($options) {
37 });
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:304
elgg_get_config(string $name, $default=null)
Get an Elgg configuration value.
$options
Definition: all.php:24
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
$vars['options']
Definition: all.php:32
Database abstraction query builder.
$defaults
Definition: all.php:10
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_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_SHOW_DELETED_ENTITIES
Definition: constants.php:127
elgg_list_entities(array $options=[], callable $getter=null, callable $viewer=null)
Returns a string of rendered entities.
Definition: entities.php:551
const ELGG_VALUE_STRING
Definition: constants.php:112
elgg_entity_types_with_capability(string $capability)
Returns an array of type/subtypes with the requested capability enabled.
Definition: entities.php:757
$qb
Definition: queue.php:12