tripal_ds.pane.api.inc 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. *
  29. */
  30. function tripal_ds_field_create_field($field_label, $field, $bundle_name) {
  31. //Build the rest of the passes parameters.
  32. $group_field_name = 'gp_'.$field['field_name'];
  33. //Create the field groups.
  34. _additional_fields_field_group_info($bundle_name, $field_label, $group_field_name, $field);
  35. //Place the field groups in the layout.
  36. tripal_ds_update_ds_layout($bundle_name, $field, $group_field_name);
  37. }