forked from Elgg/community_plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcategory_list.php
More file actions
36 lines (27 loc) · 1.05 KB
/
category_list.php
File metadata and controls
36 lines (27 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/**
* Category listing (not search - search goes against the search mod)
* Must keep the confusing name because previous version bypassed the
* page handler and hit this script directly.
*/
require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
global $CONFIG;
// get filter
$category = get_input('category');
$category_label = $CONFIG->plugincats[$category];
$title = sprintf(elgg_echo('plugins:category:title'), $category_label);
// Get objects
set_context('search');
if ($category) {
if ($category == 'all') {
$title = sprintf(elgg_echo('plugins:category:title'), elgg_echo('plugins:cat:all'));
$list = list_entities('object', 'plugin_project', 0, 10, true, false, true);
} else {
$list = list_entities_from_metadata("plugincat", $category, "object", "plugin_project", 0, 10, true, false, true);
}
}
set_context('plugins');
$sidebar = elgg_view('plugins/search/sidebar');
$main = elgg_view('plugins/search/main', array('area1' => $list));
$body = elgg_view_layout('plugins_layout', $main, $sidebar);
page_draw($title, $body);