12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- $organism = $variables['node']->organism;
- $options = ['return_array' => 1];
- $organism = chado_expand_var($organism, 'table', 'organismprop', $options);
- $properties = $organism->organismprop;
- if (count($properties) > 0) {
-
-
-
- $headers = ['Property Name', 'Value'];
-
-
-
-
- $rows = [];
- foreach ($properties as $property) {
- $property = chado_expand_var($property, 'field', 'organismprop.value');
- $rows[] = [
- ucfirst(preg_replace('/_/', ' ', $property->type_id->name)),
- urldecode($property->value),
- ];
- }
-
-
-
-
- $table = [
- 'header' => $headers,
- 'rows' => $rows,
- 'attributes' => [
- 'id' => 'tripal_organism-table-properties',
- 'class' => 'tripal-data-table',
- ],
- 'sticky' => FALSE,
- 'caption' => '',
- 'colgroups' => [],
- 'empty' => '',
- ];
-
-
- print theme_table($table);
- }
|