You are here

function pmpapi_pull_menu in Public Media Platform API Integration 7

Implements hook_menu().

File

pmpapi_pull/pmpapi_pull.module, line 28
Allows admins to pull content from the PMP API, and turn PMP docs into (locally-stored, independent) drupal entities.

Code

function pmpapi_pull_menu() {
  $items = array();
  $items['admin/content/pmp/pull'] = array(
    'title' => 'Pull PMP Doc',
    'description' => 'Pull a single doc from the PMP API.',
    'access arguments' => array(
      'pull PMP content',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'pmpapi_pull_pull_doc_by_guid',
    ),
    'file' => 'pmpapi_pull.pages.inc',
    'type' => MENU_LOCAL_TASK,
  );
  $items['admin/config/services/pmp/pull'] = array(
    'title' => 'Pull settings',
    'description' => 'Select which content types (and mapped fields) to pull from PMP.',
    'access arguments' => array(
      'administer PMP pull',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'pmpapi_pull_admin_config',
    ),
    'file' => 'pmpapi_pull.admin.inc',
    'type' => MENU_LOCAL_TASK,
  );
  $items['admin/content/pmp/search'] = array(
    'title' => 'Search PMP docs',
    'description' => 'Search PMP docs',
    'access arguments' => array(
      'pull PMP content',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'pmpapi_pull_filter_form',
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'pmpapi_pull.pages.inc',
  );
  $items['admin/content/pmp/search/%'] = array(
    'title' => 'Search PMP docs',
    'description' => 'Search PMP docs',
    'access arguments' => array(
      'pull PMP content',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'pmpapi_pull_filter_form',
      4,
    ),
    'file' => 'pmpapi_pull.pages.inc',
  );
  $items['admin/content/pmp/preview/%'] = array(
    'title' => 'Preview PMP Document',
    'access arguments' => array(
      'pull PMP content',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'pmpapi_pull_preview',
      4,
    ),
    'file' => 'pmpapi_pull.pages.inc',
    'type' => MENU_CALLBACK,
  );
  return $items;
}