aboutsummaryrefslogtreecommitdiff
path: root/views/default/output
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/output')
-rw-r--r--views/default/output/tags.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/views/default/output/tags.php b/views/default/output/tags.php
index 345b256c4..57cb21ea7 100644
--- a/views/default/output/tags.php
+++ b/views/default/output/tags.php
@@ -1,17 +1,19 @@
<?php
/**
* Elgg tags
- *
* Tags can be a single string (for one tag) or an array of strings
*
- * @package Elgg
- * @subpackage Core
- *
- * @uses $vars['tags'] The tags to display
- * @uses $vars['type'] The entity type, optional
+ * @uses $vars['value'] Array of tags or a string
+ * @uses $vars['type'] The entity type, optional
* @uses $vars['subtype'] The entity subtype, optional
+ * @uses $vars['entity'] Optional. Entity whose tags are being displayed (metadata ->tags)
*/
+if (isset($vars['entity'])) {
+ $defaults['value'] = $vars['entity']->tags;
+ unset($vars['entity']);
+}
+
if (!empty($vars['subtype'])) {
$subtype = "&subtype=" . urlencode($vars['subtype']);
} else {
@@ -27,6 +29,10 @@ if (empty($vars['tags']) && !empty($vars['value'])) {
$vars['tags'] = $vars['value'];
}
+if (empty($vars['tags']) && isset($vars['entity'])) {
+ $vars['tags'] = $vars['entity']->tags;
+}
+
if (!empty($vars['tags'])) {
if (!is_array($vars['tags'])) {
$vars['tags'] = array($vars['tags']);