tmgmt.plugin.interface.reject.inc 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * @file
  4. * Contains the reject translator plugin interface.
  5. */
  6. /**
  7. * Handle reject on data item level.
  8. *
  9. * Implement this interface in a translator plugin to signal that this plugin is
  10. * capable of handling a reject of single data items.
  11. *
  12. * @ingroup tmgmt_translator
  13. */
  14. interface TMGMTTranslatorRejectDataItem {
  15. /**
  16. * Reject one single data item.
  17. *
  18. * @todo Using job item breaks the current convention which uses jobs.
  19. *
  20. * @param $job_item
  21. * The job item to which the rejected data item belongs.
  22. * @param $key
  23. * The key of the rejected data item.
  24. * The key is an array containing the keys of a nested array hierarchy path.
  25. *
  26. * @return
  27. * TRUE if the reject was succesfull, else FALSE.
  28. * In case of an error, it is the responsibility of the translator to
  29. * provide informations about the faliure.
  30. */
  31. public function rejectDataItem(TMGMTJobItem $job_item, array $key, array $values = NULL);
  32. /**
  33. * Reject form.
  34. *
  35. * This method gets call by tmgmt_ui_translation_review_form_reject_confirm
  36. * and allows the translator to add aditional form elements in order to
  37. * collect data needed for the reject prozess.
  38. *
  39. * @param $form
  40. * The form array containing a confirm form.
  41. * $form['item'] holds the job item to which the to be rejected data item
  42. * belongs to.
  43. * $form['item'] holds key of the to be rejected data item as an array of
  44. * keys of a nested array hierarchy.
  45. * @param $form_state
  46. * The form state.
  47. *
  48. * @return
  49. * The resulting form array.
  50. */
  51. public function rejectForm($form, &$form_state);
  52. }