function salesforce_api_menu in Salesforce Suite 7.2
Same name and namespace in other branches
- 5.2 salesforce_api/salesforce_api.module \salesforce_api_menu()
- 6.2 salesforce_api/salesforce_api.module \salesforce_api_menu()
- 7 salesforce_api/salesforce_api.module \salesforce_api_menu()
Implements hook_menu().
File
- salesforce_api/
salesforce_api.module, line 148 - Defines an API that enables modules to interact with the Salesforce server.
Code
function salesforce_api_menu() {
$map_id_arg = count(explode('/', SALESFORCE_PATH_FIELDMAPS));
$items[SALESFORCE_PATH_ADMIN] = array(
'title' => 'Salesforce',
'description' => 'Administer settings related to your Salesforce integration.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'salesforce_api_settings_form',
),
'access arguments' => array(
'administer salesforce',
),
'type' => MENU_NORMAL_ITEM,
'file' => 'salesforce_api.admin.inc',
);
$items[SALESFORCE_PATH_ADMIN . '/settings'] = array(
'title' => 'Settings',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
);
$items[SALESFORCE_PATH_DEMO] = array(
'title' => 'Test/Demo',
'page callback' => 'salesforce_api_demo',
'access arguments' => array(
'administer salesforce',
),
'type' => MENU_LOCAL_TASK,
'file' => 'salesforce_api.admin.inc',
);
$items[SALESFORCE_PATH_FIELDMAPS] = array(
'title' => 'Fieldmaps',
'description' => 'Administer fieldmap relationships between Drupal objects and Salesforce objects.',
'page callback' => 'salesforce_api_fieldmap_admin',
'access arguments' => array(
'administer salesforce',
),
'type' => MENU_LOCAL_TASK,
'file' => 'salesforce_api.admin.inc',
);
$items[SALESFORCE_PATH_FIELDMAPS . '/list'] = array(
'title' => 'List',
'type' => MENU_DEFAULT_LOCAL_TASK,
'access arguments' => array(
'administer salesforce',
),
'weight' => 0,
);
$items[SALESFORCE_PATH_FIELDMAPS . '/add'] = array(
'title' => 'Add',
'description' => 'Create a new fieldmap.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'salesforce_api_fieldmap_add_form',
),
'access arguments' => array(
'administer salesforce',
),
'type' => MENU_LOCAL_TASK,
'weight' => 5,
'file' => 'salesforce_api.admin.inc',
);
$items[SALESFORCE_PATH_FIELDMAPS . '/%salesforce_api_fieldmap'] = array(
'title' => 'Edit',
'description' => 'Edit an existing fieldmap.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'salesforce_api_fieldmap_edit_form',
$map_id_arg,
),
'access callback' => '_salesforce_fieldmap_access',
'access arguments' => array(
'administer salesforce',
'edit',
$map_id_arg,
),
'file' => 'salesforce_api.admin.inc',
'weight' => 10,
);
$items[SALESFORCE_PATH_FIELDMAPS . '/%salesforce_api_fieldmap/edit'] = array(
'title' => 'Edit',
'description' => 'Edit an existing fieldmap.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'salesforce_api_fieldmap_edit_form',
$map_id_arg,
),
'access callback' => '_salesforce_fieldmap_access',
'access arguments' => array(
'administer salesforce',
'edit',
$map_id_arg,
),
'type' => MENU_LOCAL_TASK,
'file' => 'salesforce_api.admin.inc',
'weight' => 10,
);
$items[SALESFORCE_PATH_FIELDMAPS . '/%salesforce_api_fieldmap/remove/%'] = array(
'title' => 'Edit',
'description' => 'Edit an existing fieldmap.',
'page callback' => 'salesforce_api_fieldmap_remove_field',
'page arguments' => array(
$map_id_arg,
$map_id_arg + 2,
),
'access callback' => '_salesforce_fieldmap_access',
'access arguments' => array(
'administer salesforce',
'edit',
$map_id_arg,
),
'type' => MENU_CALLBACK,
'file' => 'salesforce_api.admin.inc',
);
$items[SALESFORCE_PATH_FIELDMAPS . '/%salesforce_api_fieldmap/clone'] = array(
'title' => 'Clone',
'description' => 'Clone an existing fieldmap.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'salesforce_api_fieldmap_clone_form',
$map_id_arg,
),
'access callback' => '_salesforce_fieldmap_access',
'access arguments' => array(
'administer salesforce',
'clone',
$map_id_arg,
),
'type' => MENU_LOCAL_TASK,
'file' => 'salesforce_api.admin.inc',
'weight' => 15,
);
$items[SALESFORCE_PATH_FIELDMAPS . '/%salesforce_api_fieldmap/delete'] = array(
'title' => 'Delete',
'description' => 'Delete an existing fieldmap.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'salesforce_api_fieldmap_delete_form',
$map_id_arg,
),
'access callback' => '_salesforce_fieldmap_delete_revert_access',
'access arguments' => array(
'administer salesforce',
'delete',
$map_id_arg,
),
'type' => MENU_LOCAL_TASK,
'file' => 'salesforce_api.admin.inc',
'weight' => 20,
);
$items[SALESFORCE_PATH_FIELDMAPS . '/%salesforce_api_fieldmap/revert'] = $items[SALESFORCE_PATH_FIELDMAPS . '/%salesforce_api_fieldmap/delete'];
$items[SALESFORCE_PATH_FIELDMAPS . '/%salesforce_api_fieldmap/revert']['title'] = 'Revert';
$items[SALESFORCE_PATH_FIELDMAPS . '/%salesforce_api_fieldmap/revert']['access callback'] = '_salesforce_fieldmap_delete_revert_access';
$items[SALESFORCE_PATH_FIELDMAPS . '/%salesforce_api_fieldmap/revert']['access arguments'] = array(
'administer salesforce',
'revert',
$map_id_arg,
);
$items[SALESFORCE_PATH_OBJECT] = array(
'title' => 'Object setup',
'description' => 'Define which Salesforce objects you would like to be available in your Drupal site.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'salesforce_api_admin_object',
),
'access arguments' => array(
'administer salesforce',
),
'type' => MENU_LOCAL_TASK,
'file' => 'salesforce_api.admin.inc',
);
/* $items[SALESFORCE_PATH_OBJECT . '/%'] = array(
'title' => 'Object setup',
'page callback' => 'drupal_get_form',
'page arguments' => array('salesforce_api_admin_object_settings', count(explode('/', SALESFORCE_PATH_OBJECT))),
'access arguments' => array('administer salesforce'),
'type' => MENU_CALLBACK,
'file' => 'salesforce_api.admin.inc',
); */
$items[SALESFORCE_PATH_UPDATE_WSDL] = array(
'title' => 'WSDL',
'description' => 'Upload a new WSDL XML file and set its location',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'salesforce_api_update_wsdl_form',
),
'access arguments' => array(
'administer salesforce',
),
'type' => MENU_LOCAL_TASK,
'file' => 'salesforce_api.admin.inc',
);
if (module_exists('ctools')) {
$items[SALESFORCE_PATH_FIELDMAPS . '/%salesforce_api_fieldmap/export'] = array(
'title' => 'Export',
'description' => 'Export a fieldmap.',
'page callback' => 'salesforce_api_export_salesforce_fieldmap',
'page arguments' => array(
$map_id_arg,
),
'access callback' => '_salesforce_fieldmap_access',
'access arguments' => array(
'administer salesforce',
'export',
$map_id_arg,
),
'type' => MENU_LOCAL_TASK,
// 'file' => 'salesforce_api.admin.inc',
'weight' => 25,
);
$items[SALESFORCE_PATH_FIELDMAPS . '/import'] = array(
'title' => 'Import',
'description' => 'Import a fieldmap.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'salesforce_api_import_salesforce_fieldmap',
),
'access arguments' => array(
'administer salesforce',
),
'type' => MENU_LOCAL_TASK,
'file' => 'salesforce_api.admin.inc',
'weight' => 30,
);
}
return $items;
}