$panel) { if ($panel->name != 'te_base') { $has_base_panel_only = FALSE; } $panel_settings = unserialize($panel->settings); $table_layout_group = key_exists('table_layout', $panel_settings) ? $panel_settings['table_layout'] : array(); $panel_fields = $fields[$panel_id]; // Rearrange fields into groups for each panel $table_layout = array(); $no_group = array(); // Keyed by field's '#weight' and '#field_name so we can ksort() by weight foreach ($panel_fields AS $field) { if (in_array($field['#field_name'], $table_layout_group)) { $table_layout [$field['#weight'] . $field['#field_name']] = $field; } else { $no_group [$field['#weight'] . $field['#field_name']] = $field; } } // Render horizontal table $table = ''; if (count($table_layout) != 0) { ksort($table_layout, SORT_NUMERIC); $rows = array(); foreach ($table_layout as $field) { $rows[] = array( array( 'data' => $field['#title'], 'header' => TRUE, 'width' => '20%', 'nowrap' => 'nowrap' ), $field[0]['#markup'] ); } $table = theme_table(array( 'header' => array(), 'rows' => $rows, 'attributes' => array( 'id' => '', // TODO: need to add an ID 'class' => 'tripal-data-horz-table' ), 'sticky' => FALSE, 'caption' => '', 'colgroups' => array(), 'empty' => '', )); } // Render field not in a group $ungrouped = ''; if (count($no_group) != 0) { ksort($no_group, SORT_NUMERIC); foreach ($no_group as $field) { $ungrouped .= render($field); } } $output = $table . $ungrouped ; // If this is a base content, do not organize the content in a fieldset if ($panel->name == 'te_base') { $content .= '
' . $output . '
'; } else { $collapsible_item = array('element' => array()); $collapsible_item['element']['#description'] = $output; $collapsible_item['element']['#title'] = $panel->label; $collapsible_item['element']['#children'] = ''; $collapsible_item['element']['#attributes']['id'] = 'tripal_panel-fieldset-' . $panel->name; $collapsible_item['element']['#attributes']['class'][] = 'tripal_panel-fieldset'; $collapsible_item['element']['#attributes']['class'][] = 'collapsible'; $collapsible_item['element']['#attributes']['class'][] = 'collapsed'; $toc_item_id = $panel_id; $toc .= "
name . "\" class=\"tripal_toc_list_item_link\" href=\"?pane=" . $panel->name . "\">" . $panel->label . "
"; $content .= theme('fieldset', $collapsible_item); } } $bundle_type = ''; // TODO: need to add the bundle type if ($has_base_panel_only) { ?>