You are here

function fillpdf_menu in FillPDF 6

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

Implementation of hook_menu().

File

./fillpdf.module, line 39
Allows mappings of PDFs to site content

Code

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

  // 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/settings/fillpdf'] = array(
    'title' => 'Fill PDF Settings',
    'description' => 'Configure Fill PDF Servelet Information',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'fillpdf_settings',
    ),
    'access arguments' => $access,
  );

  // --------- Form ------------------------
  $items['admin/content/fillpdf'] = array(
    'title' => 'Fill PDF',
    'description' => 'Manage your PDFs',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'fillpdf_forms',
    ),
    'access arguments' => $access,
  );
  $items['admin/content/fillpdf/%'] = array(
    'title' => 'Edit PDF Form',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'fillpdf_form_edit',
      3,
    ),
    'access arguments' => $access,
  );
  $items['admin/content/fillpdf/%/delete'] = array(
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'fillpdf_form_delete_confirm',
      3,
    ),
    'access arguments' => $access,
    'type' => MENU_CALLBACK,
  );
  $items['admin/content/fillpdf/%/export'] = array(
    'title' => t('Export Fill PDF Field Mappings'),
    'page callback' => 'fillpdf_form_export',
    'page arguments' => array(
      3,
    ),
    'access arguments' => $access,
  );
  $items['admin/content/fillpdf/%/import'] = array(
    'title' => t('Import Fill PDF Field Mappings'),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'fillpdf_form_import_form',
      3,
    ),
    'access arguments' => $access,
  );

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