diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-10-16 20:26:12 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-10-16 20:26:12 +0000 |
commit | c66831fa5138a277a9729174caf14c7eb323fb07 (patch) | |
tree | 2444b54badf4914b59c88700cc1ce30a57ae7ff1 /views/default/output/tags.php | |
parent | 8048313e87b9fd5ab6734e29a0e951524fa33e45 (diff) | |
download | elgg-c66831fa5138a277a9729174caf14c7eb323fb07.tar.gz elgg-c66831fa5138a277a9729174caf14c7eb323fb07.tar.bz2 |
Standardizing views.`
git-svn-id: http://code.elgg.org/elgg/trunk@3555 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/output/tags.php')
-rw-r--r-- | views/default/output/tags.php | 95 |
1 files changed, 46 insertions, 49 deletions
diff --git a/views/default/output/tags.php b/views/default/output/tags.php index 901fa806b..f394d084f 100644 --- a/views/default/output/tags.php +++ b/views/default/output/tags.php @@ -1,55 +1,52 @@ <?php +/** + * Elgg tags + * Displays a list of tags, separated by commas + * + * Tags can be a single string (for one tag) or an array of strings + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + * + * @uses $vars['tags'] The tags to display + * @uses $vars['tagtype'] The tagtype, optionally + */ - /** - * Elgg tags - * Displays a list of tags, separated by commas - * - * Tags can be a single string (for one tag) or an array of strings - * - * @package Elgg - * @subpackage Core +if (!empty($vars['subtype'])) { + $subtype = "&subtype=" . urlencode($vars['subtype']); +} else { + $subtype = ""; +} +if (!empty($vars['object'])) { + $object = "&object=" . urlencode($vars['object']); +} else { + $object = ""; +} - * @author Curverider Ltd +if (empty($vars['tags']) && !empty($vars['value'])) { + $vars['tags'] = $vars['value']; +} - * @link http://elgg.org/ - * - * @uses $vars['tags'] The tags to display - * @uses $vars['tagtype'] The tagtype, optionally - */ - - if (!empty($vars['subtype'])) { - $subtype = "&subtype=" . urlencode($vars['subtype']); - } else { - $subtype = ""; - } - if (!empty($vars['object'])) { - $object = "&object=" . urlencode($vars['object']); - } else { - $object = ""; +if (!empty($vars['tags'])) { + $tagstr = ""; + if (!is_array($vars['tags'])) { + $vars['tags'] = array($vars['tags']); } - if (empty($vars['tags']) && !empty($vars['value'])) - $vars['tags'] = $vars['value']; - if (!empty($vars['tags'])) { - - $tagstr = ""; - if (!is_array($vars['tags'])) - $vars['tags'] = array($vars['tags']); - - foreach($vars['tags'] as $tag) { - if (!empty($tagstr)) { - $tagstr .= ", "; - } - if (!empty($vars['type'])) { - $type = "&type={$vars['type']}"; - } else { - $type = ""; - } - if (is_string($tag)) { - $tagstr .= "<a rel=\"tag\" href=\"{$vars['url']}tag/".urlencode($tag) . "{$type}{$subtype}{$object}\">" . htmlentities($tag, ENT_QUOTES, 'UTF-8') . "</a>"; - } - } - echo $tagstr; - - } -?>
\ No newline at end of file + foreach($vars['tags'] as $tag) { + if (!empty($tagstr)) { + $tagstr .= ", "; + } + if (!empty($vars['type'])) { + $type = "&type={$vars['type']}"; + } else { + $type = ""; + } + if (is_string($tag)) { + $tagstr .= "<a rel=\"tag\" href=\"{$vars['url']}tag/".urlencode($tag) . "{$type}{$subtype}{$object}\">" . htmlentities($tag, ENT_QUOTES, 'UTF-8') . "</a>"; + } + } + echo $tagstr; +}
\ No newline at end of file |