diff options
Diffstat (limited to 'mod/groups/views/default')
-rw-r--r-- | mod/groups/views/default/groups/profile/fields.php | 38 | ||||
-rw-r--r-- | mod/groups/views/default/groups/profile/summary.php (renamed from mod/groups/views/default/groups/profile/profile_block.php) | 41 |
2 files changed, 45 insertions, 34 deletions
diff --git a/mod/groups/views/default/groups/profile/fields.php b/mod/groups/views/default/groups/profile/fields.php new file mode 100644 index 000000000..5cd06025f --- /dev/null +++ b/mod/groups/views/default/groups/profile/fields.php @@ -0,0 +1,38 @@ +<?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 + if ($key == 'name') { + continue; + } + + $value = $group->$key; + if (empty($value)) { + continue; + } + + $options = array('value' => $group->$key); + if ($valtype == 'tags') { + $options['tag_names'] = $key; + } + + echo "<p class=\"{$even_odd}\">"; + echo "<b>"; + echo elgg_echo("groups:$key"); + echo ": </b>"; + echo elgg_view("output/$valtype", $options); + echo "</p>"; + + $even_odd = ($even_odd == 'even') ? 'odd' : 'even'; + } +} diff --git a/mod/groups/views/default/groups/profile/profile_block.php b/mod/groups/views/default/groups/profile/summary.php index 2f384b4bf..b7ae51070 100644 --- a/mod/groups/views/default/groups/profile/profile_block.php +++ b/mod/groups/views/default/groups/profile/summary.php @@ -1,6 +1,6 @@ <?php /** - * Group profile + * Group profile summary * * Icon and profile fields * @@ -15,8 +15,6 @@ if (!isset($vars['entity']) || !$vars['entity']) { $group = $vars['entity']; $owner = $group->getOwnerEntity(); -$profile_fields = elgg_get_config('group'); - ?> <div class="groups-profile clearfix elgg-image-block"> <div class="elgg-image"> @@ -42,36 +40,11 @@ $profile_fields = elgg_get_config('group'); </div> <div class="groups-profile-fields elgg-body"> -<?php -if (is_array($profile_fields) && count($profile_fields) > 0) { - - $even_odd = 'odd'; - foreach ($profile_fields as $key => $valtype) { - // do not show the name - if ($key == 'name') { - continue; - } - - $value = $group->$key; - if (empty($value)) { - continue; - } - - $options = array('value' => $group->$key); - if ($valtype == 'tags') { - $options['tag_names'] = $key; - } - - echo "<p class=\"{$even_odd}\">"; - echo "<b>"; - echo elgg_echo("groups:$key"); - echo ": </b>"; - echo elgg_view("output/$valtype", $options); - echo "</p>"; - - $even_odd = ($even_odd == 'even') ? 'odd' : 'even'; - } -} -?> + <?php + echo elgg_view('groups/profile/fields', $vars); + ?> </div> </div> +<?php +?> + |