소스 검색

provide very simple label callback

bradfordcondon 7 년 전
부모
커밋
8e26fcd62b
1개의 변경된 파일17개의 추가작업 그리고 0개의 파일을 삭제
  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;
+}
+
+