1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- $library = $variables['node']->library;
- $options = ['return_array' => 1];
- $library = chado_expand_var($library, 'table', 'libraryprop', $options);
- $props = $library->libraryprop;
- if (!$props) {
- return;
- }
- $properties = [];
- foreach ($props as $prop) {
- if ($prop->type_id->name == 'Library Description') {
- continue;
- }
- $properties[] = $prop;
- }
- if (count($properties) > 0) {
-
-
-
- $headers = ['Property Name', 'Value'];
-
-
-
-
- $rows = [];
- foreach ($properties as $property) {
- $property = chado_expand_var($property, 'field', 'libraryprop.value');
- $rows[] = [
- ucfirst(preg_replace('/_/', ' ', $property->type_id->name)),
- urldecode($property->value),
- ];
- }
-
-
-
-
- $table = [
- 'header' => $headers,
- 'rows' => $rows,
- 'attributes' => [
- 'id' => 'tripal_library-table-properties',
- 'class' => 'tripal-data-table',
- ],
- 'sticky' => FALSE,
- 'caption' => '',
- 'colgroups' => [],
- 'empty' => '',
- ];
-
-
- print theme_table($table);
- }
|