You are here

workflow_admin_ui.install in Workflow 7.2

Same filename and directory in other branches
  1. 7 workflow_admin_ui/workflow_admin_ui.install

Install, update and uninstall functions for the workflow_admin_ui module.

File

workflow_admin_ui/workflow_admin_ui.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the workflow_admin_ui module.
 */

/**
 * Implements hook_enable().
 */
function workflow_admin_ui_enable() {
  drupal_set_message(_workflow_admin_ui_participate());
}

/**
 * Helper function. Used both by update and enable.
 */
function _workflow_admin_ui_participate() {
  return t("Please review which roles may 'participate in workflows' <a href='!url'>on the Permissions page</a>.", array(
    '!url' => url('admin/people/permissions', array(
      'fragment' => 'module-workflow',
    )),
  ));
}

/**
 * Gives all user roles the ability to participate in workflows.
 *
 * This is only done for updating. New installs must set the roles themselves.
 */
function workflow_admin_ui_update_7001(&$sandbox) {
  $perms = array(
    'participate in workflow' => 1,
  );
  foreach (user_roles() as $rid => $name) {
    user_role_change_permissions($rid, $perms);
  }
  return _workflow_admin_ui_participate();
}

Functions

Namesort descending Description
workflow_admin_ui_enable Implements hook_enable().
workflow_admin_ui_update_7001 Gives all user roles the ability to participate in workflows.
_workflow_admin_ui_participate Helper function. Used both by update and enable.