workflow_admin_ui.install 951 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * @file
  4. * Install, update and uninstall functions for the workflow_admin_ui module.
  5. */
  6. /**
  7. * Implements hook_enable().
  8. */
  9. function workflow_admin_ui_enable() {
  10. drupal_set_message(_workflow_admin_ui_participate());
  11. }
  12. /**
  13. * Helper function. Used both by update and enable.
  14. */
  15. function _workflow_admin_ui_participate() {
  16. return t("Please review which roles may 'participate in workflows' <a href='!url'>on the Permissions page</a>.",
  17. array('!url' => url('admin/people/permissions', array('fragment' => 'module-workflow'))));
  18. }
  19. /**
  20. * Gives all user roles the ability to participate in workflows.
  21. *
  22. * This is only done for updating. New installs must set the roles themselves.
  23. */
  24. function workflow_admin_ui_update_7001(&$sandbox) {
  25. $perms = array('participate in workflow' => 1);
  26. foreach (user_roles() as $rid => $name) {
  27. user_role_change_permissions($rid, $perms);
  28. }
  29. return _workflow_admin_ui_participate();
  30. }