aboutsummaryrefslogtreecommitdiff
path: root/mod/categories/views/default/input
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-11 22:51:08 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-11 22:51:08 +0000
commit891739afadddad56b517b7d565458296eeb58c0b (patch)
tree1891b4f21abd3df6aa1ec4b8847758644e1622fb /mod/categories/views/default/input
parent1f1a9d691360eac9bb3eeaf98ebaaec6b6305b2b (diff)
downloadelgg-891739afadddad56b517b7d565458296eeb58c0b.tar.gz
elgg-891739afadddad56b517b7d565458296eeb58c0b.tar.bz2
some clean up of the categories plugin - html/css polish needed
git-svn-id: http://code.elgg.org/elgg/trunk@8122 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/categories/views/default/input')
-rw-r--r--mod/categories/views/default/input/categories.php45
1 files changed, 45 insertions, 0 deletions
diff --git a/mod/categories/views/default/input/categories.php b/mod/categories/views/default/input/categories.php
new file mode 100644
index 000000000..6f57a0c29
--- /dev/null
+++ b/mod/categories/views/default/input/categories.php
@@ -0,0 +1,45 @@
+<?php
+/**
+ * Categories input view
+ *
+ * @package ElggCategories
+ *
+ * @uses $vars['entity'] The entity being edited or created
+ */
+
+if (isset($vars['entity']) && $vars['entity'] instanceof ElggEntity) {
+ $selected_categories = $vars['entity']->universal_categories;
+}
+$categories = elgg_get_site_entity()->categories;
+if (empty($categories)) {
+ $categories = array();
+}
+if (empty($selected_categories)) {
+ $selected_categories = array();
+}
+
+if (!empty($categories)) {
+ if (!is_array($categories)) {
+ $categories = array($categories);
+ }
+
+ ?>
+
+<p class="categories">
+ <label><?php echo elgg_echo('categories'); ?></label><br />
+ <?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>
+
+ <?php
+
+} else {
+ echo '<input type="hidden" name="universal_category_marker" value="on" />';
+}