aboutsummaryrefslogtreecommitdiff
path: root/mod/subgroups/views/default/groups/profile
diff options
context:
space:
mode:
Diffstat (limited to 'mod/subgroups/views/default/groups/profile')
-rw-r--r--mod/subgroups/views/default/groups/profile/fields.php41
1 files changed, 41 insertions, 0 deletions
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';
+ }
+ }
+}