Преглед изворни кода

Merge branch '7.x-3.x' of github.com:tripal/tripal into 7.x-3.x

Stephen Ficklin пре 7 година
родитељ
комит
d724c0bfff
1 измењених фајлова са 16 додато и 0 уклоњено
  1. 16 0
      tripal/api/tripal.entities.api.inc

+ 16 - 0
tripal/api/tripal.entities.api.inc

@@ -1113,4 +1113,20 @@ function theme_token_list($tokens) {
   return theme('table', array('header' => $header, 'rows' => $rows));
 }
 
+/**
+ * Define the entity label callback.  This will return the title.
+ *
+ * @param $entity
+ *
+ * @return mixed
+ */
+
+function tripal_entity_label($entity) {
+  if (property_exists($entity, 'title')) {
+    return $entity->title;
+  }
+  return NULL;
+}
+
+