Skip to content

Commit 43fa978

Browse files
committedApr 20, 2012
Adds ting_details theming functions.
1 parent 467dd9a commit 43fa978

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
 

‎template.php

+31
Original file line numberDiff line numberDiff line change
@@ -742,3 +742,34 @@ function dynamo_datef($date, $format, $langcode = 'da') {
742742
return date_format_date($date, 'custom', $format, $langcode);
743743
}
744744

745+
/**
746+
* Theme ting_details.
747+
*
748+
* Theme with divs for legacy reasons.
749+
*/
750+
function dynamo_ting_details($details) {
751+
$groups = array();
752+
foreach ($details as $group) {
753+
$groups[] = array(
754+
'class' => $group['class'],
755+
'data' => theme('ting_details_group', $group['title'], $group['data']),
756+
);
757+
}
758+
return theme('item_list', $groups, NULL, 'div');
759+
}
760+
761+
/**
762+
* Theme ting_details_group.
763+
*
764+
* Theme with divs and spans for legacy reasons.
765+
*/
766+
function dynamo_ting_details_group($title, $data) {
767+
$items = array();
768+
foreach ($data as $item_title => $item) {
769+
$items[] = array(
770+
'class' => $item['class'],
771+
'data' => theme('item_list', $item['data'], $item_title, 'span'),
772+
);
773+
}
774+
return theme('item_list', $items, $title, 'div', array('class' => 'ting-properties'));
775+
}

0 commit comments

Comments
 (0)