You are here

function fillpdf_menu in FillPDF 7

Same name and namespace in other branches
  1. 5 fillpdf.module \fillpdf_menu()
  2. 6 fillpdf.module \fillpdf_menu()
  3. 7.2 fillpdf.module \fillpdf_menu()

Implements hook_menu().

File

./fillpdf.module, line 36

Code

function fillpdf_menu() {
  $access = array(
    'administer pdfs',
  );
  $items = array();

  // Fill URLs, such as
  // "fillpdf?fid=10&nids[]=1&webforms[0][nid]=2&webforms[0][sid]=3".
  $items['fillpdf'] = array(
    'page callback' => 'fillpdf_parse_uri',
    // Can't use access callback. We need the arguments, but they're passed as
    // $GET. Will access-check in fillpdf_merge_pdf.
    'access arguments' => array(
      'access content',
    ),
    'type' => MENU_CALLBACK,
  );

  // Config.
  $items['admin/config/media/fillpdf'] = array(
    'title' => 'FillPDF settings',
    'description' => 'Configure tool to use with FillPDF',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'fillpdf_settings',
    ),
    'access arguments' => $access,
    'type' => MENU_NORMAL_ITEM,
  );

  // Form.
  $items['admin/structure/fillpdf'] = array(
    'title' => 'FillPDF',
    'description' => 'Manage your PDFs',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'fillpdf_forms_admin',
    ),
    'access arguments' => $access,
  );
  $items['admin/structure/fillpdf/%'] = array(
    'title' => 'Edit PDF form',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'fillpdf_form_edit',
      3,
    ),
    'access arguments' => $access,
  );
  $items['admin/structure/fillpdf/%/delete'] = array(
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'fillpdf_form_delete_confirm',
      3,
    ),
    'access arguments' => $access,
    'type' => MENU_CALLBACK,
  );
  $items['admin/structure/fillpdf/%/export'] = array(
    'title' => 'Export FillPDF field mappings',
    'page callback' => 'fillpdf_form_export',
    'page arguments' => array(
      3,
    ),
    'access arguments' => $access,
  );
  $items['admin/structure/fillpdf/%/import'] = array(
    'title' => 'Import FillPDF field mappings',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'fillpdf_form_import_form',
      3,
    ),
    'access arguments' => $access,
  );

  // Fields.
  $items['admin/structure/fillpdf/%/add'] = array(
    'title' => 'Add field',
    'page callback' => 'fillpdf_field',
    'page arguments' => array(
      4,
      3,
    ),
    'access arguments' => $access,
    'type' => MENU_LOCAL_TASK,
  );
  $items['admin/structure/fillpdf/%/edit/%'] = array(
    'page callback' => 'fillpdf_field',
    'page arguments' => array(
      4,
      3,
      5,
    ),
    'access arguments' => $access,
  );
  return $items;
}