1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <?php
- function tripal_ws_bundle_fields_info($entity_type, $bundle) {
- $fields = array();
-
- return $fields;
- }
- function tripal_ws_bundle_instances_info($entity_type, $bundle) {
- $instances = array();
-
- return $instances;
- }
- function tripal_ws_bundle_create_user_field($new_field, $bundle) {
-
- $term = tripal_load_term_entity(array('term_id' => $bundle->term_id));
- $vocab = $term->vocab;
- $params = array(
- 'vocabulary' => $vocab->vocabulary,
- 'accession' => $term->accession,
- );
-
-
-
-
- if ($new_field['type'] == 'remote__data') {
- $field_name = $new_field['field_name'];
- $field_type = 'remote__data';
-
- field_create_field(array(
- 'field_name' => $field_name,
- 'type' => $field_type,
- 'cardinality' => FIELD_CARDINALITY_UNLIMITED,
- 'locked' => FALSE,
- 'storage' => array(
- 'type' => 'field_tripal_ws_storage',
- ),
- ));
-
- field_create_instance(array(
- 'field_name' => $field_name,
- 'entity_type' => 'TripalEntity',
- 'bundle' => $bundle->name,
- 'label' => $new_field['label'],
- 'description' => '',
- 'required' => FALSE,
- 'settings' => array(
- 'auto_attach' => FALSE,
- 'term_vocabulary' => '',
- 'term_accession' => '',
- 'term_name' => ''
- ),
- 'widget' => array(
- 'type' => 'remote__data_widget',
- 'settings' => array(
- 'display_label' => 1,
- ),
- ),
- 'display' => array(
- 'default' => array(
- 'label' => 'inline',
- 'type' => 'remote__data_formatter',
- 'settings' => array(),
- ),
- ),
- ));
- }
- }
|