diff options
Diffstat (limited to 'mod/categories/views/default/categories/list.php')
-rw-r--r-- | mod/categories/views/default/categories/list.php | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/mod/categories/views/default/categories/list.php b/mod/categories/views/default/categories/list.php new file mode 100644 index 000000000..b6f9f4302 --- /dev/null +++ b/mod/categories/views/default/categories/list.php @@ -0,0 +1,41 @@ +<?php + + $categories = $vars['config']->site->categories; + + if ($categories) { + if (!is_array($categories)) $categories = array($categories); + + if (!empty($vars['subtype'])) { + $flag = array(); + $owner_guid = ''; + if (isset($vars['owner_guid'])) $owner_guid = (int) $vars['owner_guid']; + if ($cats = get_tags(0,999,'universal_categories','object',$vars['subtype'],$owner_guid)) + foreach($cats as $cat) + $flag[] = $cat->tag; + + } else { + $flag = null; + } + + if (is_null($flag) || !empty($flag)) { + +?> + + <h2><?php echo elgg_echo('categories'); ?></h2> + <div class="categories"> + <?php + + $catstring = ''; + if (!empty($categories)) { + foreach($categories as $category) { + if (is_null($flag) || (is_array($flag) && in_array($category,$flag))) + $catstring .= '<li><a href="'.$vars['baseurl'].urlencode($category).'">'. $category .'</a></li>'; + } + } + if (!empty($catstring)) echo "<ul>{$catstring}</ul>"; + + ?> + </div> +<?php } + +}?>
\ No newline at end of file |