Index: theme.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.inc,v retrieving revision 1.295 diff -u -F^f -r1.295 theme.inc --- theme.inc 7 May 2006 00:08:36 -0000 1.295 +++ theme.inc 8 May 2006 14:36:10 -0000 @@ -845,6 +845,44 @@ function theme_item_list($items = array( return $output; } + /** + * Return a themed list of items. + * Patch pending at http://drupal.org/node/54898 + * @param $items + * An array of items to be displayed in the list. + * The argument is: array("term" => $term, "definitions" => $definitions) + * If you provide the $definition as arrays, you will get multiple DDs with each DT. + * If you provide the $definitions as a string, only one DD will be added to the DT. + * @param $title + * The title of the list. + * @return + * A string containing the list output. + */ +function theme_definition_list($items = array(), $title = NULL) { + $output = '
'; + if (isset($title)) { + $output .= '

'. $title .'

'; + } + + if (!empty($items)) { + $output .= "
";; + foreach ($items as $item) { + $output .= '
'. check_plain($item['term']) .'
'; + if (is_string($item['definitions'])) { + $output .= '
'. filter_xss($item['definitions']) .'
'; + } + elseif (is_array($item['definitions'])) { + foreach ($item['definitions'] as $definition) { + $output .= '
'.filter_xss($definition) .'
'; + } + } + } + $output .= "
"; + } + $output .= '
'; + return $output; +} + /** * Returns code that emits the 'more help'-link. */