api-task-handler.html 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. task handler definition:
  2. title -- visible title of the task handler.
  3. description -- description of the task handler.
  4. task type -- The type of the task this handler can service.
  5. render -- callback of the function to render the handler. The arguments to this callback are specific to the task type.
  6. admin title -- callback to render the admin title as this handler is listed.
  7. params: $handler, $task, $subtask_id
  8. admin summary -- callback to render what's in the collapsible info as the handler is listed. Optional.
  9. params: $handler, $task, $subtask_id
  10. default conf -- either an array() of default conf data or a callback that returns an array.
  11. params: $handler, $task, $subtask_id
  12. save -- callback to call just prior to the task handler being saved so it can adjust its data.
  13. params: &$handler, $update (as drupal_write_record would receive)
  14. export -- callback to call just prior to the task being exported. It should return text to append to the export if necessary.
  15. params: &$handler, $indent
  16. forms => array(
  17. 'id' => array(
  18. 'form' => form callback (receives $form, $form_state)
  19. 'submit' => submit callback
  20. 'validate' => validate callback
  21. 'include' => an optional file to include to get functionality for this form. Must include full path.
  22. 'no return' => hide the 'return' button, meaning that the form requires extra steps if submitted
  23. 'alternate next' => an alternate next form. Used for hidden edit forms that don't have tabs.
  24. 'no blocks' => if TRUE, use Drupal's mechanism to not render blocks for this form.
  25. )
  26. )
  27. ),
  28. 'add forms' => array(
  29. 'form1', => t('form title'),
  30. 'form2', => t('form title'),
  31. // ...etc.../
  32. ),
  33. 'edit forms' => array(
  34. 'id' => t('tab name'),
  35. 'id2' => t('tab name'),
  36. ),
  37. If a form name is blank it is a 'hidden' form -- it has no tab but can still be reached.
  38. Notes: Because #required validation cannot be skipped when clicking cancel, please don't use it.