aboutsummaryrefslogtreecommitdiff
path: root/mod/subgroups/views/default/groups
diff options
context:
space:
mode:
Diffstat (limited to 'mod/subgroups/views/default/groups')
-rw-r--r--mod/subgroups/views/default/groups/css/elements/components.php6
-rw-r--r--mod/subgroups/views/default/groups/group_sort_menu.php46
-rw-r--r--mod/subgroups/views/default/groups/profile/fields.php41
-rw-r--r--mod/subgroups/views/default/groups/sidebar/subgroups.php44
4 files changed, 137 insertions, 0 deletions
diff --git a/mod/subgroups/views/default/groups/css/elements/components.php b/mod/subgroups/views/default/groups/css/elements/components.php
new file mode 100644
index 000000000..0198fa309
--- /dev/null
+++ b/mod/subgroups/views/default/groups/css/elements/components.php
@@ -0,0 +1,6 @@
+/* ***************************************
+ Gallery
+*************************************** */
+.elgg-gallery-groups > li {
+ margin: 0 2px;
+}
diff --git a/mod/subgroups/views/default/groups/group_sort_menu.php b/mod/subgroups/views/default/groups/group_sort_menu.php
new file mode 100644
index 000000000..7e4d1bca6
--- /dev/null
+++ b/mod/subgroups/views/default/groups/group_sort_menu.php
@@ -0,0 +1,46 @@
+<?php
+/**
+ * All groups listing page navigation
+ *
+ * @uses $vars['selected'] Name of the tab that has been selected
+ */
+
+$tabs = array(
+ 'newest' => array(
+ 'text' => elgg_echo('groups:newest'),
+ 'href' => 'groups/all?filter=newest',
+ 'priority' => 200,
+ ),
+
+ 'popular' => array(
+ 'text' => elgg_echo('groups:popular'),
+ 'href' => 'groups/all?filter=popular',
+ 'priority' => 400,
+ ),
+
+ 'discussion' => array(
+ 'text' => elgg_echo('groups:latestdiscussion'),
+ 'href' => 'groups/all?filter=discussion',
+ 'priority' => 500,
+ ),
+);
+
+if ($user = elgg_get_logged_in_user_entity()) {
+ $tabs['member'] = array(
+ 'text' => elgg_echo('groups:yours'),
+ 'href' => "groups/member/$user->username",
+ 'priority' => 300,
+ );
+}
+
+foreach ($tabs as $name => $tab) {
+ $tab['name'] = $name;
+
+ if ($vars['selected'] == $name) {
+ $tab['selected'] = true;
+ }
+
+ elgg_register_menu_item('filter', $tab);
+}
+
+echo elgg_view_menu('filter', array('sort_by' => 'priority', 'class' => 'elgg-menu-hz'));
diff --git a/mod/subgroups/views/default/groups/profile/fields.php b/mod/subgroups/views/default/groups/profile/fields.php
new file mode 100644
index 000000000..41b0de9a0
--- /dev/null
+++ b/mod/subgroups/views/default/groups/profile/fields.php
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Group profile fields
+ */
+
+$group = $vars['entity'];
+
+$profile_fields = elgg_get_config('group');
+
+if (is_array($profile_fields) && count($profile_fields) > 0) {
+
+ $even_odd = 'odd';
+ foreach ($profile_fields as $key => $valtype) {
+ // do not show the name or hidden values
+ if ($key == 'name' || $valtype == 'hidden') {
+ continue;
+ }
+
+ $value = $group->$key;
+ if (empty($value)) {
+ continue;
+ }
+
+ $options = array('value' => $group->$key);
+ if ($valtype == 'tags') {
+ $options['tag_names'] = $key;
+ }
+
+ if ($output = elgg_view("output/$valtype", $options)) {
+
+ echo "<div class=\"{$even_odd}\">";
+ echo "<b>";
+ echo elgg_echo("groups:$key");
+ echo ": </b>";
+ echo $output;
+ echo "</div>";
+
+ $even_odd = ($even_odd == 'even') ? 'odd' : 'even';
+ }
+ }
+}
diff --git a/mod/subgroups/views/default/groups/sidebar/subgroups.php b/mod/subgroups/views/default/groups/sidebar/subgroups.php
new file mode 100644
index 000000000..35ffbaef9
--- /dev/null
+++ b/mod/subgroups/views/default/groups/sidebar/subgroups.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Subgroups sidebar
+ *
+ * @package ElggSubgroups
+ *
+ * @uses $vars['entity'] Group entity
+ * @uses $vars['limit'] The number of subgroups to display
+ */
+
+$owner = elgg_get_page_owner_entity();
+
+if(!elgg_instanceof($owner, 'group')) {
+ return false;
+}
+
+$limit = elgg_extract('limit', $vars, 10);
+
+$all_link = elgg_view('output/url', array(
+ 'href' => 'subgroups/owner/' . $owner->guid,
+ 'text' => elgg_echo('subgroups:more'),
+ 'is_trusted' => true,
+));
+
+$params = array(
+ 'type' => 'group',
+ 'container_guid' => $owner->guid,
+ 'limit' => $limit,
+ 'types' => 'group',
+ 'list_type' => 'gallery',
+ 'gallery_class' => 'elgg-gallery-groups',
+ 'full_view' => false
+);
+
+$params['count'] = true;
+if(elgg_get_entities($params) == 0) {
+ return true;
+}
+$params['count'] = false;
+
+$body = elgg_list_entities($params);
+$body .= "<div class='center mts'>$all_link</div>";
+
+echo elgg_view_module('aside', elgg_echo('subgroups'), $body);