diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-04-16 01:56:18 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-04-16 01:56:18 +0000 |
commit | fc5ef85ec2fa45afb44795109899d93329f7b2c4 (patch) | |
tree | 8d8f958ca42012c2ea753136859f54eda7796ab7 /mod/categories/views/default/categories | |
parent | f29b327342068543b8a2a3f0f487953468f3c9a5 (diff) | |
download | elgg-fc5ef85ec2fa45afb44795109899d93329f7b2c4.tar.gz elgg-fc5ef85ec2fa45afb44795109899d93329f7b2c4.tar.bz2 |
Merged [5623]:head from 1.7 to trunk.
git-svn-id: http://code.elgg.org/elgg/trunk@5760 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/categories/views/default/categories')
-rw-r--r-- | mod/categories/views/default/categories/list.php | 54 | ||||
-rw-r--r-- | mod/categories/views/default/categories/settings.php | 22 | ||||
-rw-r--r-- | mod/categories/views/default/categories/view.php | 29 |
3 files changed, 58 insertions, 47 deletions
diff --git a/mod/categories/views/default/categories/list.php b/mod/categories/views/default/categories/list.php index b6f9f4302..161a21655 100644 --- a/mod/categories/views/default/categories/list.php +++ b/mod/categories/views/default/categories/list.php @@ -1,41 +1,51 @@ <?php - $categories = $vars['config']->site->categories; - - if ($categories) { - if (!is_array($categories)) $categories = array($categories); - +$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) + 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 + ?> + +<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))) + 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 } + if (!empty($catstring)) { + echo "<ul>{$catstring}</ul>"; + } + + ?> +</div> + <?php + } -}?>
\ No newline at end of file +} diff --git a/mod/categories/views/default/categories/settings.php b/mod/categories/views/default/categories/settings.php index 6c55d88f9..7f38b6579 100644 --- a/mod/categories/views/default/categories/settings.php +++ b/mod/categories/views/default/categories/settings.php @@ -1,26 +1,24 @@ <?php - echo elgg_view_title(elgg_echo('categories:settings')); +echo elgg_view_title(elgg_echo('categories:settings')); ?> - <div class="contentWrapper"> - <p> - <?php echo elgg_echo('categories:explanation'); ?> - </p> - +<div class="contentWrapper"> + <p> + <?php echo elgg_echo('categories:explanation'); ?> + </p> -<?php - echo elgg_view( - 'input/form', - array( + <?php + + echo elgg_view('input/form', array( 'action' => $vars['url'] . 'action/categories/save', 'method' => 'post', 'body' => elgg_view('categories/settingsform',$vars) - ) + ) ); -?> + ?> </div>
\ No newline at end of file diff --git a/mod/categories/views/default/categories/view.php b/mod/categories/views/default/categories/view.php index ef092ce84..7ee0170d9 100644 --- a/mod/categories/views/default/categories/view.php +++ b/mod/categories/views/default/categories/view.php @@ -1,19 +1,22 @@ <?php - $linkstr = ''; - if (isset($vars['entity']) && $vars['entity'] instanceof ElggEntity) { - - $categories = $vars['entity']->universal_categories; - if (!empty($categories)) { - if (!is_array($categories)) $categories = array($categories); - foreach($categories as $category) { - $link = $vars['url'] . 'search?tagtype=universal_categories&tag=' . urlencode($category); - if (!empty($linkstr)) $linkstr .= ', '; - $linkstr .= '<a href="'.$link.'">' . $category . '</a>'; +$linkstr = ''; +if (isset($vars['entity']) && $vars['entity'] instanceof ElggEntity) { + + $categories = $vars['entity']->universal_categories; + if (!empty($categories)) { + if (!is_array($categories)) { + $categories = array($categories); + } + foreach($categories as $category) { + $link = $vars['url'] . 'pg/categories/list/?category=' . urlencode($category); + if (!empty($linkstr)) { + $linkstr .= ', '; } + $linkstr .= '<a href="'.$link.'">' . $category . '</a>'; } - } - echo $linkstr; -?>
\ No newline at end of file +} + +echo $linkstr; |