Index: relativity.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/relativity/relativity.module,v retrieving revision 1.41.2.11 diff -u -p -r1.41.2.11 relativity.module --- relativity.module 12 Jan 2008 02:28:10 -0000 1.41.2.11 +++ relativity.module 1 Apr 2008 04:31:35 -0000 @@ -1438,7 +1438,7 @@ function relativity_token_list($type) { * - theme_relativity_bullets($items) */ -function theme_relativity_show_parents($node, $fieldset=1) { +function theme_relativity_show_parents($node, $box = 1) { $output = ''; // load all nodes associated with this one as the parent nid and show links to all of them. @@ -1460,14 +1460,13 @@ function theme_relativity_show_parents($ } } } - if ($output && $fieldset) { - $output = theme('fieldset', array('#title' => variable_get('relativity_parents_label', t('Parent nodes')), - '#children' => $output)); + if ($output && $box) { + $output = theme('box', variable_get('relativity_parents_label', t('Parent nodes')), $output, 'relativity'); } return $output; } -function theme_relativity_show_children($parent, $fieldset=1) { +function theme_relativity_show_children($parent, $box = 1) { $output = ''; // load all nodes associated with this one as the parent nid and show links to all of them. @@ -1484,40 +1483,37 @@ function theme_relativity_show_children( if (strpos($child_display_option, 'view:') !== FALSE) { $viewname = str_replace('view:', '', $child_display_option); $children_box = relativity_child_as_view($parent, $childtype, $viewname); - } else { - $children_box = "\n"; + } + else { foreach($child_nodes as $child_node) { if ($child_node->type != $childtype) continue; switch ($child_display_option) { case 'title': - $children_box .= node_get_types('name', $childtype) . ': '; - $children_box .= l(t($child_node->title), 'node/'.$child_node->nid, array('class' => 'relativity_view_' . $childtype)) . "
\n"; + $items[] = node_get_types('name', $childtype) . ': ' . l(t($child_node->title), 'node/' . $child_node->nid, array('class' => 'relativity_view_' . $childtype)); break; case 'teaser': - $children_box .= theme('fieldset', array('#title' => node_get_types('name', $childtype), - '#children' => node_view($child_node, TRUE))); + $items[] = theme('box', node_get_types('name', $childtype), node_view($child_node, TRUE), 'relativity'); break; case 'body': - $children_box .= theme('fieldset', array('#title' => node_get_types('name', $childtype), - '#children' => node_view($child_node, FALSE))); + $items[] = theme('box', node_get_types('name', $childtype), node_view($child_node, FALSE), 'relativity'); break; } } + $children_box = theme('item_list', $items); } //drupal_set_message($childtype . $children_box); - $output .= ($children_box ? "\n" . '
' . $children_box . "
\n" : ''); + $output .= ($children_box ? '
' . $children_box . '
' : ''); } - if ($output && $fieldset) { - $output = "\n" . theme('fieldset', array('#title' => variable_get('relativity_children_label', t('Children nodes')), - '#children' => $output)); + if ($output && $box) { + $output = theme('box', variable_get('relativity_children_label', t('Children nodes')), $output, 'relativity'); } return $output; } -function theme_relativity_show_ancestors($node, $ancestors, $fieldset=1) { +function theme_relativity_show_ancestors($node, $ancestors, $box = 1) { $output = ''; $indent = 0; @@ -1533,9 +1529,8 @@ function theme_relativity_show_ancestors } } - if ($output && $fieldset) { - $output = theme('fieldset', array('#title' => variable_get('relativity_ancestors_label', t('Ancestor nodes')), - '#children' => $output)); + if ($output && $box) { + $output = theme('box', variable_get('relativity_ancestors_label', t('Ancestor nodes')), $output, 'relativity'); } return $output; } @@ -1546,13 +1541,12 @@ function theme_relativity_show_ancestors /** * Shows the "Link operations" box for attaching and removing children nodes */ -function theme_relativity_show_link_operations($parent, $fieldset=1) { +function theme_relativity_show_link_operations($parent, $box = 1) { $parent_nid = $parent->nid; $output = relativity_get_operation_links($parent); // show child removal links $result = db_query('SELECT nid FROM {relativity} WHERE parent_nid = %d', $parent_nid); - $output = ($output ? $output . '
' : ''); while($child = db_fetch_object($result)) { $child_node = node_load($child->nid); // make sure that no dependencies exist that would require this node to be attached @@ -1575,10 +1569,8 @@ function theme_relativity_show_link_oper } } - if ($output && $fieldset) { - $output = theme('fieldset', array('#title' => variable_get('relativity_actions_label', t('Link operations')), - //'#collapsible' => TRUE, - '#children' => $output)); + if ($output && $box) { + $output = theme('box', variable_get('relativity_actions_label', t('Link operations')), $output, 'relativity'); } return $output; } @@ -1663,5 +1655,5 @@ function theme_relativity_link($title, $ } function theme_relativity_bullets($items) { - return ""; + return theme('item_list', $items); }