summaryrefslogtreecommitdiffstats
path: root/modules/content_multigroup
diff options
context:
space:
mode:
Diffstat (limited to 'modules/content_multigroup')
-rw-r--r--modules/content_multigroup/content_multigroup.admin.inc1
-rw-r--r--modules/content_multigroup/content_multigroup.info3
-rw-r--r--modules/content_multigroup/content_multigroup.module4
-rw-r--r--modules/content_multigroup/content_multigroup.node_view.inc24
4 files changed, 31 insertions, 1 deletions
diff --git a/modules/content_multigroup/content_multigroup.admin.inc b/modules/content_multigroup/content_multigroup.admin.inc
index 39eda56..cf160c6 100644
--- a/modules/content_multigroup/content_multigroup.admin.inc
+++ b/modules/content_multigroup/content_multigroup.admin.inc
@@ -300,6 +300,7 @@ function content_multigroup_display_overview_form(&$form, &$form_state) {
'hr' => t('Horizontal line'),
'table-single' => t('Table - Single column'),
'table-multiple' => t('Table - Multiple columns'),
+ 'ul' => t('Unordered List'),
);
foreach (fieldgroup_groups($type_name) as $group_name => $group) {
if ($group['group_type'] != 'multigroup') {
diff --git a/modules/content_multigroup/content_multigroup.info b/modules/content_multigroup/content_multigroup.info
index d0a7d21..1813d12 100644
--- a/modules/content_multigroup/content_multigroup.info
+++ b/modules/content_multigroup/content_multigroup.info
@@ -4,4 +4,5 @@ description = Combine multiple CCK fields into repeating field collections that
dependencies[] = content
dependencies[] = fieldgroup
package = CCK
-core = 6.x \ No newline at end of file
+core = 6.x
+
diff --git a/modules/content_multigroup/content_multigroup.module b/modules/content_multigroup/content_multigroup.module
index 9c30570..d741ad0 100644
--- a/modules/content_multigroup/content_multigroup.module
+++ b/modules/content_multigroup/content_multigroup.module
@@ -80,6 +80,10 @@ function content_multigroup_theme() {
'arguments' => array('element' => NULL),
'file' => 'content_multigroup.node_view.inc',
),
+ 'content_multigroup_display_ul' => array(
+ 'arguments' => array('element' => NULL),
+ 'file' => 'content_multigroup.node_view.inc',
+ ),
);
}
diff --git a/modules/content_multigroup/content_multigroup.node_view.inc b/modules/content_multigroup/content_multigroup.node_view.inc
index 8f07c95..b7d120a 100644
--- a/modules/content_multigroup/content_multigroup.node_view.inc
+++ b/modules/content_multigroup/content_multigroup.node_view.inc
@@ -109,6 +109,11 @@ function _content_multigroup_fieldgroup_view(&$node, &$element, $group, $context
$element['#attributes']['class'] = $group_class .' content-multigroup-display-table-multiple-columns';
$element['#fields'] = $group_fields;
break;
+ case 'ul':
+ $element['#theme'] = 'content_multigroup_display_ul';
+ $element['#attributes']['class'] = $group_class;
+ $element['#fields'] = $group_fields;
+ break;
}
}
@@ -235,3 +240,22 @@ function theme_content_multigroup_display_table_multiple($element) {
}
return count($rows) ? theme('table', $headers, $rows, $element['#attributes']) : '';
}
+
+/**
+ * Theme a subgroup of fields in an unordered list.
+ *
+ * No output is generated if all fields are empty.
+ */
+function theme_content_multigroup_display_ul($element) {
+ $items = array();
+ foreach (element_children($element) as $delta) {
+ foreach ($element['#fields'] as $field_name => $field) {
+ $item = drupal_render($element[$delta][$field_name]);
+ if (!empty($item)) {
+ $items[] = $item;
+ }
+ }
+ }
+ $element['#attributes']['class'] .= ' content-multigroup';
+ return count($items) ? theme('item_list', $items, $element['#title'], 'ul', $element['#attributes']) : '';
+}