You are here

function workflow_access_menu in Workflow 7.2

Same name and namespace in other branches
  1. 7 workflow_access/workflow_access.module \workflow_access_menu()

Implements hook_menu().

File

workflow_access/workflow_access.module, line 11
Provides node access permissions based on workflow states.

Code

function workflow_access_menu() {
  $items = array();
  $admin_path = WORKFLOW_ADMIN_UI_PATH;
  $id_count = count(explode('/', $admin_path));
  $items["{$admin_path}/access"] = array(
    'title' => 'Access settings',
    'file' => 'workflow_access.pages.inc',
    'access arguments' => array(
      'administer workflow',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'workflow_access_priority_form',
    ),
    'type' => MENU_LOCAL_ACTION,
  );
  $items["{$admin_path}/manage/%workflow/access"] = array(
    'title' => 'Access',
    'file' => 'workflow_access.pages.inc',
    'access arguments' => array(
      'administer workflow',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'workflow_access_form',
      $id_count + 1,
    ),
    'type' => MENU_CALLBACK,
  );
  return $items;
}