workflow_cleanup.module 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * @file
  4. * Cleans up Workflow cruft that may build up over time.
  5. */
  6. /**
  7. * Implements hook_menu().
  8. */
  9. function workflow_cleanup_menu() {
  10. $items = array();
  11. $admin_path = WORKFLOW_ADMIN_UI_PATH;
  12. $items["$admin_path/cleanup"] = array(
  13. 'title' => 'Clean up workflow',
  14. 'file' => 'workflow_cleanup.pages.inc',
  15. 'access arguments' => array('administer workflow'),
  16. 'page callback' => 'drupal_get_form',
  17. 'page arguments' => array('workflow_cleanup_form'),
  18. 'type' => MENU_LOCAL_ACTION,
  19. );
  20. return $items;
  21. }
  22. /**
  23. * Implements hook_help().
  24. */
  25. function workflow_cleanup_help($path, $arg) {
  26. switch ($path) {
  27. case WORKFLOW_ADMIN_UI_PATH . '/cleanup':
  28. return t('This page allows you to delete orphaned and inactive states.
  29. States can be deleted freely in a development environment, but be
  30. careful if you have used a State in a production environment. The
  31. transition history of your content will loose the description of a
  32. previously used state. If your Workflow must comply to some auditing
  33. standards, you should NOT use this function.');
  34. }
  35. }
  36. /**
  37. * Implements hook_theme().
  38. */
  39. function workflow_cleanup_theme() {
  40. return array(
  41. 'workflow_cleanup_form' => array('render element' => 'form'),
  42. );
  43. }