Browse Source

provide very simple label callback

bradfordcondon 7 năm trước cách đây
mục cha
commit
8e26fcd62b
1 tập tin đã thay đổi với 17 bổ sung0 xóa
  1. 17 0
      tripal/api/tripal.entities.api.inc

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

@@ -1115,4 +1115,21 @@ 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) {
+  dpm($entity);
+  if (property_exists($entity, 'title')) {
+    return $entity->title;
+  }
+  return NULL;
+}
+
+