aboutsummaryrefslogtreecommitdiff
path: root/views/default/output/tags.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-05-20 02:08:21 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-05-20 02:08:21 +0000
commit9850f323a5fe899814201b0354712644f8e80092 (patch)
tree38b9f99e480b8a1eb8f5352953c7269fce0c92e1 /views/default/output/tags.php
parent6edf852e9c5e352e02140ba9f2ab93b3a8750172 (diff)
downloadelgg-9850f323a5fe899814201b0354712644f8e80092.tar.gz
elgg-9850f323a5fe899814201b0354712644f8e80092.tar.bz2
Fixes #3189 adds entity support to tags and access views
git-svn-id: http://code.elgg.org/elgg/trunk@9106 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/output/tags.php')
-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']);