tmgmt_field.api.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?php
  2. /*
  3. * @file
  4. * API documentation for this module.
  5. */
  6. /**
  7. * Alter source field data before being saved in a translation job.
  8. *
  9. * @param array $data
  10. * Source field data.
  11. * @param string $entity_type
  12. * The entity type.
  13. * @param object $entity
  14. * An entity object.
  15. * @param string $langcode
  16. * The language of retrieved field values.
  17. */
  18. function hook_tmgmt_field_source_data_alter(&$data, $entity_type, $entity, $langcode) {
  19. }
  20. /**
  21. * Extract translatable text elements from a field.
  22. *
  23. * @param $entity_type
  24. * The type of $entity.
  25. * @param $entity
  26. * The entity being extracted.
  27. * @param $field
  28. * The field structure.
  29. * @param $instance
  30. * The field instance.
  31. * @param $langcode
  32. * The language associated with $items.
  33. * @param $items
  34. * Array of values for this field.
  35. *
  36. * @return
  37. * An array of translatable text elements, keyed by the schema name of the
  38. * field.
  39. *
  40. * @see text_tmgmt_source_translation_structure()
  41. *
  42. * @ingroup tmgmt_source
  43. */
  44. function hook_tmgmt_source_translation_structure($entity_type, $entity, $field, $instance, $langcode, $items) {
  45. }
  46. /**
  47. * Puts data on the entity of the field type owned by the module.
  48. *
  49. * @param $entity_type
  50. * The type of $entity.
  51. * @param $entity
  52. * The entity being extracted.
  53. * @param $field
  54. * The field structure.
  55. * @param $instance
  56. * The field instance.
  57. * @param $langcode
  58. * The language associated with $items.
  59. * @param $data
  60. * Translated data array.
  61. * @param $use_field_translation
  62. * TRUE if field translation is being used.
  63. *
  64. * @see tmgmt_field_populate_entity()
  65. */
  66. function hook_tmgmt_field_type_populate_entity($entity_type, $entity, $field, $instance, $langcode, $data, $use_field_translation) {
  67. }
  68. /**
  69. * Alter an entity object before populating its field with translations.
  70. *
  71. * @param array $data
  72. * Source field data.
  73. * @param object $entity
  74. * An entity object.
  75. * @param string $entity_type
  76. * The entity type.
  77. * @param string $langcode
  78. * The language of retrieved field values.
  79. */
  80. function hook_tmgmt_field_pre_populate_entity_alter(&$data, $entity, $entity_type, $langcode) {
  81. }
  82. /**
  83. * Alter an entity object after populating its field with translations.
  84. *
  85. * @param object $entity
  86. * An entity object.
  87. * @param string $entity_type
  88. * The entity type.
  89. * @param array $data
  90. * Source field data.
  91. * @param string $langcode
  92. * The language of retrieved field values.
  93. */
  94. function hook_tmgmt_field_post_populate_entity_alter(&$entity, $entity_type, $data, $langcode) {
  95. }