diff options
author | Cash Costello <cash.costello@gmail.com> | 2012-01-18 15:28:38 -0800 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2012-01-18 15:28:38 -0800 |
commit | 34b77f9b8cec3368789f48ad466b9a3de0506fa4 (patch) | |
tree | cca3fdf1986fb12a6ce4be92ce494f29ac4f688b /views/default/output | |
parent | 83b790ae5d39161976b7b74ea3fb24b82b537603 (diff) | |
parent | c305d4e8b91b57977802bd29a163ec1f1087582b (diff) | |
download | elgg-34b77f9b8cec3368789f48ad466b9a3de0506fa4.tar.gz elgg-34b77f9b8cec3368789f48ad466b9a3de0506fa4.tar.bz2 |
Merge pull request #138 from hypeJunction/tags_html_markup
Fixes #4282 tags html markup issues
Diffstat (limited to 'views/default/output')
-rw-r--r-- | views/default/output/tags.php | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/views/default/output/tags.php b/views/default/output/tags.php index 6dedfacc7..3082dd41e 100644 --- a/views/default/output/tags.php +++ b/views/default/output/tags.php @@ -7,6 +7,9 @@ * @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) + * @uses $vars['list_class'] Optional. Additional classes to be passed to <ul> element + * @uses $vars['item_class'] Optional. Additional classes to be passed to <li> elements + * @uses $vars['icon_class'] Optional. Additional classes to be passed to tags icon image */ if (isset($vars['entity'])) { @@ -38,9 +41,19 @@ if (!empty($vars['tags'])) { $vars['tags'] = array($vars['tags']); } - echo '<div>'; - echo elgg_view_icon('tag'); - echo '<ul class="elgg-tags">'; + $list_class = "elgg-tags"; + if (isset($vars['list_class'])) { + $list_class = "$list_class {$vars['list_class']}"; + } + + $item_class = "elgg-tag"; + if (isset($vars['item_class'])) { + $item_class = "$item_class {$vars['item_class']}"; + } + + $icon_class = elgg_extract('icon_class', $vars); + $list_items = '<li>' . elgg_view_icon('tag', $icon_class) . '</li>'; + foreach($vars['tags'] as $tag) { if (!empty($vars['type'])) { $type = "&type={$vars['type']}"; @@ -49,11 +62,20 @@ if (!empty($vars['tags'])) { } $url = elgg_get_site_url() . 'search?q=' . urlencode($tag) . "&search_type=tags{$type}{$subtype}{$object}"; if (is_string($tag)) { - echo '<li>'; - echo elgg_view('output/url', array('href' => $url, 'text' => $tag, 'rel' => 'tag')); - echo '</li>'; + $list_items .= "<li class=\"$item_class\">"; + $list_items .= elgg_view('output/url', array('href' => $url, 'text' => $tag, 'rel' => 'tag')); + $list_items .= '</li>'; } } - echo '</ul>'; - echo '</div>'; + + $list = <<<___HTML + <div class="clearfix"> + <ul class="$list_class"> + $list_items + </ul> + </div> +___HTML; + + echo $list; } + |