aboutsummaryrefslogtreecommitdiff
path: root/mod/categories/views
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-03 17:53:05 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-03 17:53:05 +0000
commit4766f36a4d74924f21ff329c4318ce4e069ffa04 (patch)
tree969b84632f2a8b0db79788a8a6db8e41d63e5cb4 /mod/categories/views
parent57a217fd6b708844407486046a1faa23b46cac08 (diff)
downloadelgg-4766f36a4d74924f21ff329c4318ce4e069ffa04.tar.gz
elgg-4766f36a4d74924f21ff329c4318ce4e069ffa04.tar.bz2
Pulled in the interface changes.
git-svn-id: http://code.elgg.org/elgg/trunk@5257 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/categories/views')
-rw-r--r--mod/categories/views/default/categories.php48
-rw-r--r--mod/categories/views/default/categories/css.php61
-rw-r--r--mod/categories/views/default/categories/list.php41
-rw-r--r--mod/categories/views/default/categories/settings.php26
-rw-r--r--mod/categories/views/default/categories/settingsform.php7
-rw-r--r--mod/categories/views/default/categories/view.php19
6 files changed, 202 insertions, 0 deletions
diff --git a/mod/categories/views/default/categories.php b/mod/categories/views/default/categories.php
new file mode 100644
index 000000000..f5a41cfa1
--- /dev/null
+++ b/mod/categories/views/default/categories.php
@@ -0,0 +1,48 @@
+<?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
+
+ 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" />';
+ }
+
+?> \ No newline at end of file
diff --git a/mod/categories/views/default/categories/css.php b/mod/categories/views/default/categories/css.php
new file mode 100644
index 000000000..d2cf5a8a8
--- /dev/null
+++ b/mod/categories/views/default/categories/css.php
@@ -0,0 +1,61 @@
+<?php
+ /**
+ * Categories CSS extender
+ *
+ * @package Elgg File Repository
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+?>
+
+.categories .input-checkboxes {
+ padding:0;
+ margin:2px 5px 0 0;
+}
+.categories label {
+ font-size: 100%;
+ line-height:1.2em;
+}
+
+#two_column_left_sidebar_maincontent .contentWrapper h2.categoriestitle {
+ padding: 0 0 3px 0;
+ margin:0;
+ font-size:120%;
+ color:#333333;
+}
+#two_column_left_sidebar_maincontent .contentWrapper .categories {
+ border:1px solid #CCCCCC;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ padding:5px;
+ margin:0 0 15px 0;
+}
+#two_column_left_sidebar_maincontent .contentWrapper .categories p {
+ margin:0;
+}
+#two_column_left_sidebar_maincontent .contentWrapper .blog_post .categories {
+ border:none;
+ margin:0;
+ padding:0;
+}
+
+#two_column_left_sidebar .blog_categories {
+ background:white;
+ -webkit-border-radius: 8px;
+ -moz-border-radius: 8px;
+ padding:10px;
+ margin:0 10px 10px 10px;
+}
+#two_column_left_sidebar .blog_categories h2 {
+ background:none;
+ border-top:none;
+ margin:0;
+ padding:0 0 5px 0;
+ font-size:1.25em;
+ line-height:1.2em;
+ color:#0054A7;
+}
+#two_column_left_sidebar .blog_categories ul {
+ color:#0054A7;
+ margin:5px 0 0 0;
+} \ No newline at end of file
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
diff --git a/mod/categories/views/default/categories/settings.php b/mod/categories/views/default/categories/settings.php
new file mode 100644
index 000000000..6c55d88f9
--- /dev/null
+++ b/mod/categories/views/default/categories/settings.php
@@ -0,0 +1,26 @@
+<?php
+
+ echo elgg_view_title(elgg_echo('categories:settings'));
+
+?>
+
+ <div class="contentWrapper">
+ <p>
+ <?php echo elgg_echo('categories:explanation'); ?>
+ </p>
+
+
+<?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/settingsform.php b/mod/categories/views/default/categories/settingsform.php
new file mode 100644
index 000000000..044f01dcd
--- /dev/null
+++ b/mod/categories/views/default/categories/settingsform.php
@@ -0,0 +1,7 @@
+<?php
+
+ echo elgg_view('input/tags',array('value' => $vars['categories'],
+ 'internalname' => 'categories'));
+
+?>
+ <input type="submit" value="<?php echo elgg_echo('save'); ?>" /> \ No newline at end of file
diff --git a/mod/categories/views/default/categories/view.php b/mod/categories/views/default/categories/view.php
new file mode 100644
index 000000000..ef092ce84
--- /dev/null
+++ b/mod/categories/views/default/categories/view.php
@@ -0,0 +1,19 @@
+<?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>';
+ }
+ }
+
+ }
+ echo $linkstr;
+
+?> \ No newline at end of file