|
@@ -309,16 +309,20 @@ function tripal_entity_view($entity, $type, $view_mode, $langcode) {
|
|
|
$field = field_info_field($child_name);
|
|
|
if (array_key_exists('settings', $field) and
|
|
|
array_key_exists('semantic_web', $field['settings'])) {
|
|
|
- list($vocabulary, $accession) = explode(':', $field['settings']['semantic_web']);
|
|
|
- $term = tripal_get_term_details($vocabulary, $accession);
|
|
|
- if ($term) {
|
|
|
- $tooltip_img = url(drupal_get_path('module', 'tripal') . '/theme/images/info.gif');
|
|
|
- $tooltip_text = $term['definition'] ? $term['definition'] : $term['name'];
|
|
|
- $entity->content[$child_name]['#prefix'] .= '' .
|
|
|
- '<div class="tripal-tooltip">' .
|
|
|
- '<img src="' . $tooltip_img . '">' .
|
|
|
- '<div class="tripal-tooltiptext">' . $tooltip_text . '</div>' .
|
|
|
- '</div>';
|
|
|
+ $matches = array();
|
|
|
+ if (preg_match('/^(.+):(.+)$/', $field['settings']['semantic_web'], $matches)) {
|
|
|
+ $vocabulary = $matches[1];
|
|
|
+ $accession = $matches[2];
|
|
|
+ $term = tripal_get_term_details($vocabulary, $accession);
|
|
|
+ if ($term) {
|
|
|
+ $tooltip_img = url(drupal_get_path('module', 'tripal') . '/theme/images/info.gif');
|
|
|
+ $tooltip_text = $term['definition'] ? $term['definition'] : $term['name'];
|
|
|
+ $entity->content[$child_name]['#prefix'] .= '' .
|
|
|
+ '<div class="tripal-tooltip">' .
|
|
|
+ '<img src="' . $tooltip_img . '">' .
|
|
|
+ '<div class="tripal-tooltiptext">' . $tooltip_text . '</div>' .
|
|
|
+ '</div>';
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|