aboutsummaryrefslogtreecommitdiff
path: root/mod/categories/views
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-16 01:56:18 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-16 01:56:18 +0000
commitfc5ef85ec2fa45afb44795109899d93329f7b2c4 (patch)
tree8d8f958ca42012c2ea753136859f54eda7796ab7 /mod/categories/views
parentf29b327342068543b8a2a3f0f487953468f3c9a5 (diff)
downloadelgg-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')
-rw-r--r--mod/categories/views/default/categories.php90
-rw-r--r--mod/categories/views/default/categories/list.php54
-rw-r--r--mod/categories/views/default/categories/settings.php22
-rw-r--r--mod/categories/views/default/categories/view.php29
4 files changed, 105 insertions, 90 deletions
diff --git a/mod/categories/views/default/categories.php b/mod/categories/views/default/categories.php
index f5a41cfa1..98e87a05f 100644
--- a/mod/categories/views/default/categories.php
+++ b/mod/categories/views/default/categories.php
@@ -1,48 +1,52 @@
<?php
- /**
- * Elgg categories plugin
- *
- * @package ElggCategories
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd <info@elgg.com>
- * @copyright Curverider Ltd 2008-2010
- * @link http://elgg.com/
- */
-
- if (isset($vars['entity']) && $vars['entity'] instanceof ElggEntity) {
- $selected_categories = $vars['entity']->universal_categories;
- }
- $categories = $vars['config']->site->categories;
- if (empty($categories)) $categories = array();
- if (empty($selected_categories)) $selected_categories = array();
-
- if (!empty($categories)) {
- if (!is_array($categories)) $categories = array($categories);
-
-?>
-
- <div id="content_area_user_title"><h2 class="categoriestitle"><?php echo elgg_echo('categories'); ?></h2></div>
- <div class="categories">
- <p>
-
-<?php
+/**
+ * Elgg categories plugin
+ *
+ * @package ElggCategories
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+if (isset($vars['entity']) && $vars['entity'] instanceof ElggEntity) {
+ $selected_categories = $vars['entity']->universal_categories;
+}
+$categories = $vars['config']->site->categories;
+if (empty($categories)) {
+ $categories = array();
+}
+if (empty($selected_categories)) {
+ $selected_categories = array();
+}
+
+if (!empty($categories)) {
+ if (!is_array($categories)) {
+ $categories = array($categories);
+ }
- echo elgg_view('input/checkboxes',array(
- 'options' => $categories,
- 'value' => $selected_categories,
- 'internalname' => 'universal_categories_list'
- ));
-
-?>
- <input type="hidden" name="universal_category_marker" value="on" />
- </p>
- </div>
-
-<?php
+ ?>
- } else {
- echo '<input type="hidden" name="universal_category_marker" value="on" />';
- }
+<div id="content_area_user_title"><h2 class="categoriestitle"><?php echo elgg_echo('categories'); ?></h2></div>
+<div class="categories">
+ <p>
+
+ <?php
+
+ echo elgg_view('input/checkboxes',array(
+ 'options' => $categories,
+ 'value' => $selected_categories,
+ 'internalname' => 'universal_categories_list'
+ ));
+
+ ?>
+ <input type="hidden" name="universal_category_marker" value="on" />
+ </p>
+</div>
+
+ <?php
-?> \ No newline at end of file
+} else {
+ echo '<input type="hidden" name="universal_category_marker" value="on" />';
+}
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;