tripal_ds.field_group.inc 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <?php
  2. /**
  3. * Implements hook_field_group_info().
  4. */
  5. function tripal_ds_overview_field_group_info($bundle_name, $fields){
  6. //fieldset field to nest the table within
  7. $field_group_fieldset = new stdClass();
  8. $field_group_fieldset->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially*/
  9. $field_group_fieldset->api_version = 1;
  10. $field_group_fieldset->identifier = 'group_overview|TripalEntity|'.$bundle_name.'|default';
  11. $field_group_fieldset->group_name = 'group_overview';
  12. $field_group_fieldset->entity_type = 'TripalEntity';
  13. $field_group_fieldset->bundle = $bundle_name;
  14. $field_group_fieldset->mode = 'default';
  15. $field_group_fieldset->parent_name = '';
  16. $field_group_fieldset->data = array(
  17. 'label' => 'Overview',
  18. 'weight' => '2',
  19. 'children' => array(
  20. 0 => 'group_overview_table',
  21. ),
  22. 'format_type' => 'fieldset',
  23. 'format_settings' => array(
  24. 'label' => 'Overview',
  25. 'instance_settings' => array(
  26. 'id' => '',
  27. 'classes' => 'group-overview field-group-fieldset',
  28. 'description' => '',
  29. 'effect' => 'bounceslide',
  30. ),
  31. 'formatter' => 'open',
  32. ),
  33. );
  34. drupal_write_record('field_group', $field_group_fieldset);
  35. //table of fields
  36. $field_group = new stdClass();
  37. $field_group->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially*/
  38. $field_group->api_version = 1;
  39. $field_group->identifier = 'group_overview_table|TripalEntity|'.$bundle_name.'|default';
  40. $field_group->group_name = 'group_overview_table';
  41. $field_group->entity_type = 'TripalEntity';
  42. $field_group->bundle = $bundle_name;
  43. $field_group->mode = 'default';
  44. $field_group->parent_name = 'group_overview';
  45. $field_group->data = array(
  46. 'label' => '',
  47. 'weight' => '30',
  48. 'children' => $fields,
  49. 'format_type' => 'table',
  50. 'format_settings' => array(
  51. 'label' => '',
  52. 'instance_settings' => array(
  53. 'label_visibility' => '3',
  54. 'desc' => '',
  55. 'first_column' => '',
  56. 'second_column' => '',
  57. 'empty_label_behavior' => '1',
  58. 'table_row_striping' => 0,
  59. 'always_show_field_label' => 0,
  60. 'classes' => 'group-overview-table field-group-table table table-striped',
  61. ),
  62. ),
  63. );
  64. watchdog('debug', '<pre>tripal_ds_overview_field_group_info $field_group: '. print_r($field_group, TRUE) .'</pre>');
  65. drupal_write_record('field_group', $field_group);
  66. }
  67. /**
  68. * Implements hook_field_group_info().
  69. */
  70. function tripal_ds_prop_field_group_info($bundle_name, $fields){
  71. //fieldset field to nest the table within
  72. $field_group_fieldset = new stdClass();
  73. $field_group_fieldset->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially*/
  74. $field_group_fieldset->api_version = 1;
  75. $field_group_fieldset->identifier = 'group_prop|TripalEntity|'.$bundle_name.'|default';
  76. $field_group_fieldset->group_name = 'group_prop';
  77. $field_group_fieldset->entity_type = 'TripalEntity';
  78. $field_group_fieldset->bundle = $bundle_name;
  79. $field_group_fieldset->mode = 'default';
  80. $field_group_fieldset->parent_name = '';
  81. $field_group_fieldset->data = array(
  82. 'label' => 'Prop',
  83. 'weight' => '3',
  84. 'children' => array(
  85. 0 => 'group_prop_table',
  86. ),
  87. 'format_type' => 'fieldset',
  88. 'format_settings' => array(
  89. 'label' => 'Prop',
  90. 'instance_settings' => array(
  91. 'id' => '',
  92. 'classes' => 'group-prop field-group-fieldset',
  93. 'description' => '',
  94. 'effect' => 'bounceslide',
  95. ),
  96. 'formatter' => 'open',
  97. ),
  98. );
  99. drupal_write_record('field_group', $field_group_fieldset);
  100. //table of fields
  101. $field_group = new stdClass();
  102. $field_group->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially*/
  103. $field_group->api_version = 1;
  104. $field_group->identifier = 'group_prop_table|TripalEntity|'.$bundle_name.'|default';
  105. $field_group->group_name = 'group_prop_table';
  106. $field_group->entity_type = 'TripalEntity';
  107. $field_group->bundle = $bundle_name;
  108. $field_group->mode = 'default';
  109. $field_group->parent_name = 'group_prop';
  110. $field_group->data = array(
  111. 'label' => '',
  112. 'weight' => '30',
  113. 'children' => $fields,
  114. 'format_type' => 'table',
  115. 'format_settings' => array(
  116. 'label' => '',
  117. 'instance_settings' => array(
  118. 'label_visibility' => '3',
  119. 'desc' => '',
  120. 'first_column' => '',
  121. 'second_column' => '',
  122. 'empty_label_behavior' => '1',
  123. 'table_row_striping' => 0,
  124. 'always_show_field_label' => 0,
  125. 'classes' => 'group-prop-table field-group-table table table-striped',
  126. ),
  127. ),
  128. );
  129. watchdog('debug', '<pre>tripal_ds_prop_field_group_info $field_group: '. print_r($field_group, TRUE) .'</pre>');
  130. drupal_write_record('field_group', $field_group);
  131. }
  132. /**
  133. * Implements hook_field_group_info().
  134. */
  135. function tripal_ds_data_sequence_field_group_info($bundle_name, $fields){
  136. //fieldset field to nest the table within
  137. $field_group_fieldset = new stdClass();
  138. $field_group_fieldset->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially*/
  139. $field_group_fieldset->api_version = 1;
  140. $field_group_fieldset->identifier = 'group_sequence|TripalEntity|'.$bundle_name.'|default';
  141. $field_group_fieldset->group_name = 'group_sequence';
  142. $field_group_fieldset->entity_type = 'TripalEntity';
  143. $field_group_fieldset->bundle = $bundle_name;
  144. $field_group_fieldset->mode = 'default';
  145. $field_group_fieldset->parent_name = '';
  146. $field_group_fieldset->data = array(
  147. 'label' => 'Data Sequences',
  148. 'weight' => '2',
  149. 'children' => array(
  150. 0 => 'group_sequence_table',
  151. ),
  152. 'format_type' => 'fieldset',
  153. 'format_settings' => array(
  154. 'label' => 'Data Sequences',
  155. 'instance_settings' => array(
  156. 'id' => '',
  157. 'classes' => 'group-sequence field-group-fieldset',
  158. 'description' => '',
  159. 'effect' => 'bounceslide',
  160. ),
  161. 'formatter' => 'open',
  162. ),
  163. );
  164. drupal_write_record('field_group', $field_group_fieldset);
  165. //table of fields
  166. $field_group = new stdClass();
  167. $field_group->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially*/
  168. $field_group->api_version = 1;
  169. $field_group->identifier = 'group_sequence_table|TripalEntity|'.$bundle_name.'|default';
  170. $field_group->group_name = 'group_sequence_table';
  171. $field_group->entity_type = 'TripalEntity';
  172. $field_group->bundle = $bundle_name;
  173. $field_group->mode = 'default';
  174. $field_group->parent_name = 'group_sequence';
  175. $field_group->data = array(
  176. 'label' => '',
  177. 'weight' => '30',
  178. 'children' => $fields,
  179. 'format_type' => 'table',
  180. 'format_settings' => array(
  181. 'label' => '',
  182. 'instance_settings' => array(
  183. 'label_visibility' => '3',
  184. 'desc' => '',
  185. 'first_column' => '',
  186. 'second_column' => '',
  187. 'empty_label_behavior' => '1',
  188. 'table_row_striping' => 0,
  189. 'always_show_field_label' => 0,
  190. 'classes' => 'group-sequence-table field-group-table table table-striped',
  191. ),
  192. ),
  193. );
  194. watchdog('debug', '<pre>tripal_ds_sequence_field_group_info $field_group: '. print_r($field_group, TRUE) .'</pre>');
  195. drupal_write_record('field_group', $field_group);
  196. }