|
@@ -1,16 +1,75 @@
|
|
|
<?php
|
|
|
|
|
|
+drupal_add_js('misc/collapse.js');
|
|
|
$panels = $variables['element']['#panels'];
|
|
|
$fields = $variables['element']['#fields'];
|
|
|
|
|
|
+$horz_table = TRUE;
|
|
|
+
|
|
|
|
|
|
-foreach ($fields AS $panel_id => $field) { ?>
|
|
|
- <div id="" class="tripal-biodata-panel"> <?php
|
|
|
- if ($panels[$panel_id] != 'Base Content') {
|
|
|
- print '<h2>' . $panels[$panel_id] . '</h2>';
|
|
|
+$content = '';
|
|
|
+$toc = '';
|
|
|
+foreach ($panels AS $panel_id => $panel) {
|
|
|
+ $panel_fields = $fields[$panel_id];
|
|
|
+ $collapsible_item = array('element' => array());
|
|
|
+
|
|
|
+
|
|
|
+ if ($horz_table) {
|
|
|
+ $rows = array();
|
|
|
+ foreach ($panel_fields as $field) {
|
|
|
+ $rows[] = array(
|
|
|
+ array(
|
|
|
+ 'data' => $field['#title'],
|
|
|
+ 'header' => TRUE,
|
|
|
+ 'width' => '20%',
|
|
|
+ ),
|
|
|
+ $field[0]['#markup']
|
|
|
+ );
|
|
|
}
|
|
|
- print render($field); ?>
|
|
|
- </div> <?php
|
|
|
+ $collapsible_item['element']['#description'] = theme_table(array(
|
|
|
+ 'header' => array(),
|
|
|
+ 'rows' => $rows,
|
|
|
+ 'attributes' => array(
|
|
|
+ 'id' => '',
|
|
|
+ 'class' => 'tripal-data-table'
|
|
|
+ ),
|
|
|
+ 'sticky' => FALSE,
|
|
|
+ 'caption' => '',
|
|
|
+ 'colgroups' => array(),
|
|
|
+ 'empty' => '',
|
|
|
+ ));
|
|
|
+ }
|
|
|
+
|
|
|
+ else {
|
|
|
+ $collapsible_item['element']['#description'] = render($panel_fields);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if ($panel->name != 'te_base') {
|
|
|
+ $collapsible_item['element']['#title'] = $panel->label;
|
|
|
+ $collapsible_item['element']['#children'] = '';
|
|
|
+ $collapsible_item['element']['#attributes']['class'][] = 'collapsible';
|
|
|
+ $collapsible_item['element']['#attributes']['class'][] = 'collapsed';
|
|
|
+ $toc_item_id = $panel_id;
|
|
|
+ $toc .= "<div class=\"tripal_toc_list_item\"><a id=\"" . $panel->name . "\" class=\"tripal_toc_list_item_link\" href=\"?pane=" . $panel->name . "\">" . $panel->label . "</a></div>";
|
|
|
+ $content .= theme('fieldset', $collapsible_item);
|
|
|
+ }
|
|
|
+
|
|
|
+ else {
|
|
|
+ $content .= render($panel_fields);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-print render($content);
|
|
|
+$bundle_type = '';
|
|
|
+<table id ="tripal-<?php print $bundle_type?>-contents-table" class="tripal-contents-table">
|
|
|
+ <tr class="tripal-contents-table-tr">
|
|
|
+ <td nowrap class="tripal-contents-table-td tripal-contents-table-td-toc" align="left"><?php
|
|
|
+ print $toc; ?>
|
|
|
+ </td>
|
|
|
+ <td class="tripal-contents-table-td-data" align="left" width="100%"> <?php
|
|
|
+
|
|
|
+
|
|
|
+ print $content; ?>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+</table>
|