tripal_ds.pane.api.inc 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * @file
  4. * Tripal offers a display suite integration for additional fields.
  5. */
  6. /**
  7. * @defgroup tripal_ds_pane_api Tripal DS API
  8. * @ingroup tripal_ds_api
  9. * @{
  10. * Tripal DS allows for the extension of the display suite module interface used
  11. * to display the tripal entity fields. The API allows for other modules to
  12. * integrate Tripal Pane creation, placement, and formatting.
  13. * @}
  14. */
  15. /**
  16. * Adds a new Tripal Pane to a bundle.
  17. *
  18. * @param $field
  19. * The machine name for the field.
  20. * @param $bundle_name
  21. * The name of the bundle the pane is being added to.
  22. * @param $field_label
  23. * The human readable name for the field.
  24. *
  25. * Example usage:
  26. *
  27. * @code
  28. * field_create_field($field);
  29. * field_create_instance($instance);
  30. * tripal_ds_field_create_field($field_label, $field, $bundle);
  31. */
  32. function tripal_ds_field_create_field($field_label, $field, $bundle_name) {
  33. //Build the rest of the passes parameters.
  34. $group_field_name = 'gp_'.$field['field_name'];
  35. //Create the field groups.
  36. _additional_fields_field_group_info($bundle_name, $field_label, $group_field_name, $field);
  37. //Place the field groups in the layout.
  38. tripal_ds_update_ds_layout($bundle_name, $field, $group_field_name);
  39. }