Elgg
Version master
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
views
default
navigation
filter.php
Go to the documentation of this file.
1
<?php
15
$filter_tabs
= (array)
elgg_extract
(
'filter'
,
$vars
, []);
16
foreach
(
$filter_tabs
as
$name
=> $tab) {
17
if
(!is_array($tab)) {
18
continue
;
19
}
20
21
if
(!isset($tab[
'name'
])) {
22
$tab[
'name'
] =
$name
;
23
}
24
25
$filter_tabs
[
$name
] =
ElggMenuItem::factory
($tab);
26
}
27
28
$filter_id
=
elgg_extract
(
'filter_id'
,
$vars
,
'filter'
);
29
30
$menu_params
=
$vars
;
31
$menu_params
[
'filter_id'
] =
$filter_id
;
32
$menu_params
[
'items'
] =
$filter_tabs
;
33
$menu_params
[
'sort_by'
] =
'priority'
;
34
$menu_params
[
'class'
] =
'elgg-menu-filter'
;
35
$menu_params
[
'selected_item_name'
] =
elgg_extract
(
'selected_item_name'
,
$vars
,
elgg_extract
(
'filter_value'
,
$vars
));
// for BC
36
37
echo
elgg_view_menu
(
"filter:{$filter_id}"
,
$menu_params
);
$name
if(!$user||!$user->canDelete()) $name
Definition:
delete.php:22
$menu_params
$menu_params
Definition:
filter.php:30
ElggMenuItem\factory
static factory(array $options)
Create an ElggMenuItem from an associative array.
Definition:
ElggMenuItem.php:130
elgg_extract
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_menu
elgg_view_menu($menu, array $vars=[])
Render a menu.
Definition:
views.php:441
$filter_id
foreach($filter_tabs as $name=> $tab) $filter_id
Definition:
filter.php:28
$vars
$vars
Definition:
theme.php:5
$filter_tabs
$filter_tabs
Renders a filter menu.
Definition:
filter.php:15
Generated on Sat Sep 7 2024 00:02:47 for Elgg by
1.8.11