aboutsummaryrefslogtreecommitdiff
path: root/mod/categories
diff options
context:
space:
mode:
Diffstat (limited to 'mod/categories')
-rw-r--r--mod/categories/listing.php25
-rw-r--r--mod/categories/views/default/categories/list.php13
2 files changed, 26 insertions, 12 deletions
diff --git a/mod/categories/listing.php b/mod/categories/listing.php
index ecc1bede5..3a7ca6e8d 100644
--- a/mod/categories/listing.php
+++ b/mod/categories/listing.php
@@ -18,17 +18,20 @@ $owner_guid = get_input("owner_guid", 0);
$subtype = get_input("subtype", ELGG_ENTITIES_ANY_VALUE);
$type = get_input("type", 'object');
-$objects = list_entities_from_metadata('universal_categories',
- $category,
- $type,
- $subtype,
- $owner_guid,
- $limit,
- false,
- false,
- true,
- false);
-
+$params = array(
+ 'metadata_name' => 'universal_categories',
+ 'metadata_value' => $category,
+ 'types' => $type,
+ 'subtypes' => $subtype,
+ 'owner_guid' => $owner_guid,
+ 'limit' => $limit,
+ 'full_view' => FALSE,
+ 'metadata_case_sensitive' => FALSE,
+);
+$current_context = get_context();
+set_context('search');
+$objects = elgg_list_entities_from_metadata($params);
+set_context($current_context);
$title = sprintf(elgg_echo('categories:results'), $category);
diff --git a/mod/categories/views/default/categories/list.php b/mod/categories/views/default/categories/list.php
index 161a21655..9b62eff51 100644
--- a/mod/categories/views/default/categories/list.php
+++ b/mod/categories/views/default/categories/list.php
@@ -13,7 +13,18 @@ if ($categories) {
if (isset($vars['owner_guid'])) {
$owner_guid = (int) $vars['owner_guid'];
}
- if ($cats = get_tags(0,999,'universal_categories','object',$vars['subtype'],$owner_guid)) {
+
+ elgg_register_tag_metadata_name('universal_categories');
+ $params = array(
+ 'threshold' => 1,
+ 'limit' => 999,
+ 'tag_names' => array('universal_categories'),
+ 'types' => 'object',
+ 'subtypes' => $vars['subtype'],
+ 'owner_guid' => $owner_guid,
+ );
+ $cats = elgg_get_tags($params);
+ if ($cats) {
foreach($cats as $cat) {
$flag[] = $cat->tag;
}