wing.module 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * @file
  4. * Workflow - New Generation
  5. *
  6. * - States are entities
  7. * - Worfklows are the bundle entities of states
  8. * - Transitions are specific fields from state to role_id+state
  9. * - Any entity type can be subject to a workflow: association is represented by
  10. * an entityreference field with specific widget/formatter.
  11. */
  12. function wing_field_info() {
  13. $ret = array(
  14. 'wing_transition' => array(
  15. 'label' => t('Wing: Transition'),
  16. 'description' => t('Store access from one workflow state to another.'),
  17. 'settings' => array(),
  18. 'instance_settings' => array(),
  19. 'default_widget' => 'text_textfield',
  20. 'default_formatter' => 'text_default',
  21. // 'default_widget' => 'wing_transition_widget',
  22. // 'default_formatter' => 'wing_transition_default',
  23. // 'no_ui' => FALSE,
  24. ),
  25. );
  26. dsm($ret);
  27. return $ret;
  28. }
  29. function wing_field_widget_info() {
  30. $ret = array(
  31. 'text_textfield' => array(
  32. 'label' => t('Text field'),
  33. 'field types' => array('text'),
  34. 'settings' => array('size' => 60),
  35. 'behaviors' => array(
  36. 'multiple values' => FIELD_BEHAVIOR_DEFAULT,
  37. 'default value' => FIELD_BEHAVIOR_DEFAULT,
  38. ),
  39. ),
  40. );
  41. return $ret;
  42. }
  43. /**
  44. * Implements hook_field_widget_info_alter().
  45. */
  46. function wing_field_widget_info_alter(&$info) {
  47. if (module_exists('text')) {
  48. $info['text_textfield']['field types'][] = 'wing_transition';
  49. }
  50. }