tripal_ds.module 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. require_once "includes/tripal_ds.inc";
  3. require_once "includes/tripal_ds.ds.inc";
  4. require_once "includes/tripal_ds.field_group.inc";
  5. require_once "includes/tripal_ds.field_formatter.inc";
  6. function tripal_ds_init() {
  7. drupal_add_css(drupal_get_path('module', 'tripal_ds') . '/theme/css/tripaldsfeature.css');
  8. drupal_add_css(drupal_get_path('module', 'tripal_ds') . '/theme/css/bootstrap.css');
  9. }
  10. /**
  11. * Implements hook_ds_layout_info() to define layouts from code in a module for
  12. * display suite
  13. */
  14. function tripal_ds_ds_layout_info() {
  15. $path = drupal_get_path('module', 'tripal_ds');
  16. $layouts = array(
  17. 'tripal_ds_feature' => array(
  18. 'label' => t('Tripal Feature Layout'),
  19. 'path' => $path . '/theme/templates',
  20. 'regions' => array(
  21. 'top' => t('Top'),
  22. 'left' => t('Left'),
  23. 'right' => t('Right'),
  24. 'bottom' => t('Bottom'),
  25. ),
  26. 'css' => TRUE,
  27. ),
  28. );
  29. return $layouts;
  30. }
  31. /**
  32. * Implements hook_bundle_postcreate().
  33. *
  34. * This is a Triapl defined hook and is called in the TripalBundle::create()
  35. * function to allow modules to perform tasks when a bundle is created.
  36. */
  37. function tripal_ds_bundle_postcreate($bundle) {
  38. $bundle_name = $bundle->name;
  39. $instances = field_info_instances('TripalEntity', $bundle_name);
  40. _ds_layout_settings_info($bundle_name, $instances);
  41. }