all_relationships; * * This variable is an array with two sub arrays with the keys 'object' and 'subject'. The array with * key 'object' contains relationships where the feature is the object, and the array with * the key 'subject' contains relationships where the feature is the subject */ $feature = $variables['node']->feature; $all_relationships = $feature->all_relationships; $object_rels = $all_relationships['object']; $subject_rels = $all_relationships['subject']; if (count($object_rels) > 0 or count($subject_rels) > 0) { ?>
$rels) { foreach ($rels as $obj_type => $objects) { // Make the verb in the sentence make sense in English. switch ($rel_type) { case 'integral part of': case 'instance of': $verb = 'is an'; break; case 'proper part of': case 'transformation of': case 'genome of': case 'part of': case 'position of': case 'sequence of': case 'variant of': $verb = 'is a'; break; case 'derives from': case 'connects on': case 'contains': case 'finishes': case 'guides': case 'has origin': case 'has part': case 'has quality': case 'is consecutive sequence of': case 'maximally overlaps': case 'overlaps': case 'starts': $verb = ''; break; default: $verb = 'is'; } ?>

This type_id->name; ?> the following feature(s): record->object_id->name; if (property_exists($object->record, 'nid')) { $feature_name = l($feature_name, "node/" . $object->record->nid, ['attributes' => ['target' => "_blank"]]); } // link the organism to it's node $organism = $object->record->object_id->organism_id; $organism_name = $organism->genus . " " . $organism->species; if (property_exists($organism, 'nid')) { $organism_name = l("" . $organism->genus . " " . $organism->species . "", "node/" . $organism->nid, ['html' => TRUE]); } $rows[] = [ ['data' => $feature_name, 'width' => '30%'], [ 'data' => $object->record->object_id->uniquename, 'width' => '30%', ], ['data' => $organism_name, 'width' => '30%'], [ 'data' => $object->record->object_id->type_id->name, 'width' => '10%', ], ]; } // the $table array contains the headers and rows array as well as other // options for controlling the display of the table. Additional // documentation can be found here: // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7 $table = [ 'header' => $headers, 'rows' => $rows, 'attributes' => [ 'id' => 'tripal_feature-table-relationship-object', 'class' => 'tripal-data-table', ], 'sticky' => FALSE, 'caption' => '', 'colgroups' => [], 'empty' => '', ]; // once we have our table array structure defined, we call Drupal's theme_table() // function to generate the table. print theme_table($table); ?>


$rels) { foreach ($rels as $subject_type => $subjects) { // Make the verb in the sentence make sense in English. switch ($rel_type) { case 'integral part of': case 'instance of': $verb = 'are an'; break; case 'proper part of': case 'transformation of': case 'genome of': case 'part of': case 'position of': case 'sequence of': case 'variant of': $verb = 'are a'; break; case 'derives from': case 'connects on': case 'contains': case 'finishes': case 'guides': case 'has origin': case 'has part': case 'has quality': case 'is consecutive sequence of': case 'maximally overlaps': case 'overlaps': case 'starts': $verb = ''; break; default: $verb = 'are'; } ?>

The following record->subject_id->type_id->name ?> feature(s) this type_id->name; ?>: record->subject_id->name; if (property_exists($subject->record, 'nid')) { $feature_name = l($feature_name, "node/" . $subject->record->nid, ['attributes' => ['target' => "_blank"]]); } // link the organism to it's node $organism = $subject->record->subject_id->organism_id; $organism_name = $organism->genus . " " . $organism->species; if (property_exists($organism, 'nid')) { $organism_name = l("" . $organism->genus . " " . $organism->species . "", "node/" . $organism->nid, ['html' => TRUE]); } $rows[] = [ ['data' => $feature_name, 'width' => '30%'], [ 'data' => $subject->record->subject_id->uniquename, 'width' => '30%', ], ['data' => $organism_name, 'width' => '30%'], [ 'data' => $subject->record->subject_id->type_id->name, 'width' => '10%', ], ]; } // the $table array contains the headers and rows array as well as other // options for controlling the display of the table. Additional // documentation can be found here: // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7 $table = [ 'header' => $headers, 'rows' => $rows, 'attributes' => [ 'id' => 'tripal_feature-table-relationship-subject', 'class' => 'tripal-data-table', ], 'sticky' => FALSE, 'caption' => '', 'colgroups' => [], 'empty' => '', ]; // once we have our table array structure defined, we call Drupal's theme_table() // function to generate the table. print theme_table($table); ?>