entity_translation_test.install 810 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * @file
  4. * Installation functionality for Entity Translation testing module.
  5. */
  6. /**
  7. * Implements hook_install().
  8. */
  9. function entity_translation_test_install() {
  10. // Create a simple text field, attached to taxonomy_terms.
  11. field_info_cache_clear();
  12. $field = array(
  13. 'field_name' => 'field_simple_text',
  14. 'type' => 'text',
  15. 'cardinality' => 1,
  16. );
  17. field_create_field($field);
  18. $instance = array(
  19. 'field_name' => $field['field_name'],
  20. 'label' => ucfirst(str_replace('_', ' ', $field['field_name'])),
  21. 'entity_type' => 'taxonomy_term',
  22. 'bundle' => 'tags',
  23. 'widget' => array(
  24. 'type' => 'text_textfield',
  25. ),
  26. 'display' => array(
  27. 'default' => array(
  28. 'type' => 'text_default',
  29. ),
  30. ),
  31. );
  32. field_create_instance($instance);
  33. }