You are here

function webform_menu in Webform 7.3

Same name and namespace in other branches
  1. 5.2 webform.module \webform_menu()
  2. 5 webform.module \webform_menu()
  3. 6.3 webform.module \webform_menu()
  4. 6.2 webform.module \webform_menu()
  5. 7.4 webform.module \webform_menu()

Implements hook_menu().

File

./webform.module, line 79
This module provides a simple way to create forms and questionnaires.

Code

function webform_menu() {
  $items = array();

  // Submissions listing.
  $items['admin/content/webform'] = array(
    'title' => 'Webforms',
    'page callback' => 'webform_admin_content',
    'access callback' => 'user_access',
    'access arguments' => array(
      'access all webform results',
    ),
    'description' => 'View and edit all the available webforms on your site.',
    'file' => 'includes/webform.admin.inc',
    'type' => MENU_LOCAL_TASK,
  );

  // Admin Settings.
  $items['admin/config/content/webform'] = array(
    'title' => 'Webform settings',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'webform_admin_settings',
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer site configuration',
    ),
    'description' => 'Global configuration of webform functionality.',
    'file' => 'includes/webform.admin.inc',
    'type' => MENU_NORMAL_ITEM,
  );

  // Node page tabs.
  $items['node/%webform_menu/done'] = array(
    'title' => 'Webform confirmation',
    'page callback' => '_webform_confirmation',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'node_access',
    'access arguments' => array(
      'view',
      1,
    ),
    'type' => MENU_CALLBACK,
  );
  $items['node/%webform_menu/webform'] = array(
    'title' => 'Webform',
    'page callback' => 'webform_components_page',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'node_access',
    'access arguments' => array(
      'update',
      1,
    ),
    'file' => 'includes/webform.components.inc',
    'weight' => 1,
    'type' => MENU_LOCAL_TASK,
    'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
  );
  $items['node/%webform_menu/webform/components'] = array(
    'title' => 'Form components',
    'page callback' => 'webform_components_page',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'node_access',
    'access arguments' => array(
      'update',
      1,
    ),
    'file' => 'includes/webform.components.inc',
    'weight' => 0,
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['node/%webform_menu/webform/configure'] = array(
    'title' => 'Form settings',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'webform_configure_form',
      1,
    ),
    'access callback' => 'node_access',
    'access arguments' => array(
      'update',
      1,
    ),
    'file' => 'includes/webform.pages.inc',
    'weight' => 2,
    'type' => MENU_LOCAL_TASK,
  );

  // Node e-mail forms.
  $items['node/%webform_menu/webform/emails'] = array(
    'title' => 'E-mails',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'webform_emails_form',
      1,
    ),
    'access callback' => 'node_access',
    'access arguments' => array(
      'update',
      1,
    ),
    'file' => 'includes/webform.emails.inc',
    'weight' => 1,
    'type' => MENU_LOCAL_TASK,
  );
  $items['node/%webform_menu/webform/emails/%webform_menu_email'] = array(
    'load arguments' => array(
      1,
    ),
    'page arguments' => array(
      'webform_email_edit_form',
      1,
      4,
    ),
    'access callback' => 'node_access',
    'access arguments' => array(
      'update',
      1,
    ),
    'file' => 'includes/webform.emails.inc',
    'type' => MENU_CALLBACK,
  );
  $items['node/%webform_menu/webform/emails/%webform_menu_email/delete'] = array(
    'load arguments' => array(
      1,
    ),
    'page arguments' => array(
      'webform_email_delete_form',
      1,
      4,
    ),
    'access callback' => 'node_access',
    'access arguments' => array(
      'update',
      1,
    ),
    'type' => MENU_CALLBACK,
  );

  // Node component forms.
  $items['node/%webform_menu/webform/components/%webform_menu_component'] = array(
    'load arguments' => array(
      1,
      5,
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'webform_component_edit_form',
      1,
      4,
      FALSE,
    ),
    'access callback' => 'node_access',
    'access arguments' => array(
      'update',
      1,
    ),
    'file' => 'includes/webform.components.inc',
    'type' => MENU_LOCAL_TASK,
  );
  $items['node/%webform_menu/webform/components/%webform_menu_component/clone'] = array(
    'load arguments' => array(
      1,
      5,
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'webform_component_edit_form',
      1,
      4,
      TRUE,
    ),
    'access callback' => 'node_access',
    'access arguments' => array(
      'update',
      1,
    ),
    'file' => 'includes/webform.components.inc',
    'type' => MENU_LOCAL_TASK,
  );
  $items['node/%webform_menu/webform/components/%webform_menu_component/delete'] = array(
    'load arguments' => array(
      1,
      5,
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'webform_component_delete_form',
      1,
      4,
    ),
    'access callback' => 'node_access',
    'access arguments' => array(
      'update',
      1,
    ),
    'file' => 'includes/webform.components.inc',
    'type' => MENU_LOCAL_TASK,
  );

  // AJAX callback for loading select list options.
  $items['webform/ajax/options/%webform_menu'] = array(
    'load arguments' => array(
      3,
    ),
    'page callback' => 'webform_select_options_ajax',
    'access callback' => 'node_access',
    'access arguments' => array(
      'update',
      3,
    ),
    'file' => 'components/select.inc',
    'type' => MENU_CALLBACK,
  );

  // Node webform results.
  $items['node/%webform_menu/webform-results'] = array(
    'title' => 'Results',
    'page callback' => 'webform_results_submissions',
    'page arguments' => array(
      1,
      FALSE,
      '50',
    ),
    'access callback' => 'webform_results_access',
    'access arguments' => array(
      1,
    ),
    'file' => 'includes/webform.report.inc',
    'weight' => 2,
    'type' => MENU_LOCAL_TASK,
    'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
  );
  $items['node/%webform_menu/webform-results/submissions'] = array(
    'title' => 'Submissions',
    'page callback' => 'webform_results_submissions',
    'page arguments' => array(
      1,
      FALSE,
      '50',
    ),
    'access callback' => 'webform_results_access',
    'access arguments' => array(
      1,
    ),
    'file' => 'includes/webform.report.inc',
    'weight' => 4,
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['node/%webform_menu/webform-results/analysis'] = array(
    'title' => 'Analysis',
    'page callback' => 'webform_results_analysis',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'webform_results_access',
    'access arguments' => array(
      1,
    ),
    'file' => 'includes/webform.report.inc',
    'weight' => 5,
    'type' => MENU_LOCAL_TASK,
  );
  $items['node/%webform_menu/webform-results/analysis/%webform_menu_component'] = array(
    'title' => 'Analysis',
    'load arguments' => array(
      1,
      4,
    ),
    'page callback' => 'webform_results_analysis',
    'page arguments' => array(
      1,
      array(),
      4,
    ),
    'access callback' => 'webform_results_access',
    'access arguments' => array(
      1,
    ),
    'file' => 'includes/webform.report.inc',
    'type' => MENU_CALLBACK,
  );
  $items['node/%webform_menu/webform-results/table'] = array(
    'title' => 'Table',
    'page callback' => 'webform_results_table',
    'page arguments' => array(
      1,
      '50',
    ),
    'access callback' => 'webform_results_access',
    'access arguments' => array(
      1,
    ),
    'file' => 'includes/webform.report.inc',
    'weight' => 6,
    'type' => MENU_LOCAL_TASK,
  );
  $items['node/%webform_menu/webform-results/download'] = array(
    'title' => 'Download',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'webform_results_download_form',
      1,
    ),
    'access callback' => 'webform_results_access',
    'access arguments' => array(
      1,
    ),
    'file' => 'includes/webform.report.inc',
    'weight' => 7,
    'type' => MENU_LOCAL_TASK,
  );
  $items['node/%webform_menu/webform-results/clear'] = array(
    'title' => 'Clear',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'webform_results_clear_form',
      1,
    ),
    'access callback' => 'webform_results_clear_access',
    'access arguments' => array(
      1,
    ),
    'file' => 'includes/webform.report.inc',
    'weight' => 8,
    'type' => MENU_LOCAL_TASK,
  );

  // Node submissions.
  $items['node/%webform_menu/submissions'] = array(
    'title' => 'Submissions',
    'page callback' => 'webform_results_submissions',
    'page arguments' => array(
      1,
      TRUE,
      '50',
    ),
    'access callback' => 'webform_submission_access',
    'access arguments' => array(
      1,
      NULL,
      'list',
    ),
    'file' => 'includes/webform.report.inc',
    'type' => MENU_CALLBACK,
  );
  $items['node/%webform_menu/submission/%webform_menu_submission'] = array(
    'title' => 'Webform submission',
    'load arguments' => array(
      1,
    ),
    'page callback' => 'webform_submission_page',
    'page arguments' => array(
      1,
      3,
      'html',
    ),
    'title callback' => 'webform_submission_title',
    'title arguments' => array(
      1,
      3,
    ),
    'access callback' => 'webform_submission_access',
    'access arguments' => array(
      1,
      3,
      'view',
    ),
    'file' => 'includes/webform.submissions.inc',
    'type' => MENU_CALLBACK,
  );
  $items['node/%webform_menu/submission/%webform_menu_submission/view'] = array(
    'title' => 'View',
    'load arguments' => array(
      1,
    ),
    'page callback' => 'webform_submission_page',
    'page arguments' => array(
      1,
      3,
      'html',
    ),
    'access callback' => 'webform_submission_access',
    'access arguments' => array(
      1,
      3,
      'view',
    ),
    'weight' => 0,
    'file' => 'includes/webform.submissions.inc',
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['node/%webform_menu/submission/%webform_menu_submission/edit'] = array(
    'title' => 'Edit',
    'load arguments' => array(
      1,
    ),
    'page callback' => 'webform_submission_page',
    'page arguments' => array(
      1,
      3,
      'form',
    ),
    'access callback' => 'webform_submission_access',
    'access arguments' => array(
      1,
      3,
      'edit',
    ),
    'weight' => 1,
    'file' => 'includes/webform.submissions.inc',
    'type' => MENU_LOCAL_TASK,
  );
  $items['node/%webform_menu/submission/%webform_menu_submission/delete'] = array(
    'title' => 'Delete',
    'load arguments' => array(
      1,
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'webform_submission_delete_form',
      1,
      3,
    ),
    'access callback' => 'webform_submission_access',
    'access arguments' => array(
      1,
      3,
      'delete',
    ),
    'weight' => 2,
    'file' => 'includes/webform.submissions.inc',
    'type' => MENU_LOCAL_TASK,
  );
  $items['node/%webform_menu/submission/%webform_menu_submission/resend'] = array(
    'title' => 'Resend e-mails',
    'load arguments' => array(
      1,
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'webform_submission_resend',
      1,
      3,
    ),
    'access callback' => 'webform_results_access',
    'access arguments' => array(
      1,
    ),
    'file' => 'includes/webform.submissions.inc',
    'type' => MENU_CALLBACK,
  );
  return $items;
}