You are here

function formassembly_menu in FormAssembly 7

Implements hook_menu().

@todo View/Edit tabs not working yet

File

./formassembly.module, line 148
Contains hooks implementations and callbacks to non-admin pages.

Code

function formassembly_menu() {
  $items = array();
  $items['admin/config/services/formassembly'] = array(
    'title' => 'FormAssembly',
    'description' => 'Configure authentication and options for FormAssembly integration.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'formassembly_settings_form',
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer formassembly',
    ),
    'type' => MENU_NORMAL_ITEM,
    'file' => 'formassembly.admin.inc',
  );
  $items['admin/config/services/formassembly/authorize'] = array(
    'title' => 'FormAssembly OAuth Authorization',
    'page callback' => 'formassembly_oauth_authorization_callback',
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer formassembly',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'formassembly.admin.inc',
  );
  $items['formassembly/%formassembly'] = array(
    'title' => 'View',
    'page callback' => 'formassembly_view',
    'page arguments' => array(
      FA_URI_ARGUMENT_POS,
    ),
    'access arguments' => array(
      'view formassembly',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['formassembly/%formassembly/edit'] = array(
    'title' => 'Edit',
    'page callback' => 'formassembly_edit',
    'page arguments' => array(
      'formassembly_form',
      FA_URI_ARGUMENT_POS,
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer formassembly',
    ),
    'type' => MENU_LOCAL_TASK,
    'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
  );
  $items['admin/structure/formassembly'] = array(
    'title' => 'FormAssembly Forms',
    'description' => 'Manage pre-fill parameters used with FormAssembly forms.',
    'page callback' => 'formassembly_build_list',
    'access arguments' => array(
      'administer formassembly',
    ),
    'file' => 'formassembly.admin.inc',
    'type' => MENU_NORMAL_ITEM,
  );
  return $items;
}