group.inc in Display Suite 6.3
File
plugins/ds_field/group.inc
View source
<?php
$plugin = array(
'type' => DS_FIELD_TYPE_GROUP,
'name' => t('Fieldgroup'),
'description' => t('Renders groups of content.'),
'class' => 'dsFieldGroup',
);
class dsFieldGroup extends dsField {
function render(&$object, $group_key, $vars = array()) {
$object->ds_fields[$group_key]['content'] = '';
if (array_key_exists($group_key, $object->ds_fields)) {
asort($object->ds_groups[$group_key]);
foreach ($object->ds_groups[$group_key] as $field_key => $field_weight) {
$object->ds_fields[$group_key]['fields'][$field_key]['content'] = ds_get_content($object->ds_fields[$group_key]['fields'][$field_key], $vars, $field_key);
$object->ds_fields[$group_key]['fields'][$field_key]['rendered'] = ds_render_item($object->ds_fields[$group_key]['fields'][$field_key]);
$object->ds_fields[$group_key]['content'] .= $object->ds_fields[$group_key]['fields'][$field_key]['rendered'];
}
$object->ds_fields[$group_key]['count'] = count($object->ds_fields[$group_key]['fields']);
if (!empty($object->ds_fields[$group_key]['content'])) {
$object->ds_fields[$group_key]['rendered'] = ds_render_item($object->ds_fields[$group_key]);
}
}
return $object->ds_fields[$group_key]['rendered'];
}
}