You are here

workflow_admin_ui.install in Workflow 7

Same filename and directory in other branches
  1. 7.2 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() {
  $perms = array(
    'participate in workflow' => 1,
  );
  foreach (user_roles() as $rid => $name) {
    user_role_change_permissions($rid, $perms);
  }
  return t('Please review which roles may participate in workflows. <a href="!url">Permissions</a>', array(
    '!url' => url('admin/people/permissions', array(
      'fragment' => 'module-workflow_admin_ui',
    )),
  ));
}

/**
 * Patch for #1540824 requires that the menu be rebuilt.
 */
function workflow_admin_ui_update_7000(&$sandbox) {
  menu_rebuild();
  return t('Workflow_admin_ui requested a menu rebuild.');
}

/**
 * Give all user roles the ability to participate in workflows.
 */
function workflow_admin_ui_update_7001(&$sandbox) {
  return _workflow_admin_ui_participate();
}

Functions

Namesort descending Description
workflow_admin_ui_enable Implements hook_enable().
workflow_admin_ui_update_7000 Patch for #1540824 requires that the menu be rebuilt.
workflow_admin_ui_update_7001 Give all user roles the ability to participate in workflows.
_workflow_admin_ui_participate Helper function. Used both by update and enable.