Elgg  Version 3.0
filter.php
Go to the documentation of this file.
1 <?php
2 
16 $filter_value = elgg_extract('filter_value', $vars);
17 $filter_tabs = (array) elgg_extract('filter', $vars, []);
18 foreach ($filter_tabs as $name => $tab) {
19  if (!is_array($tab)) {
20  continue;
21  }
22  if (!isset($tab['name'])) {
23  $tab['name'] = $name;
24  }
25  if (!isset($tab['selected']) && $filter_value) {
26  $tab['selected'] = $tab['name'] == $filter_value;
27  }
29 }
30 
31 $filter_id = elgg_extract('filter_id', $vars);
32 $menu_name = $filter_id ? "filter:$filter_id" : 'filter';
33 
36 $menu_params['sort_by'] = 'priority';
37 $menu_params['class'] = 'elgg-menu-filter';
38 
if(!$user||!$user->canDelete()) $name
Definition: delete.php:22
static factory($options)
Create an ElggMenuItem from an associative array.
elgg_view_menu($menu, array $vars=[])
Render a menu.
Definition: views.php:755
elgg echo
Translates a string.
Definition: languages.js:43
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
$vars['type']
Definition: save.php:11