You are here

function entityform_menu in Entityform 7

Same name and namespace in other branches
  1. 8.3 entityform.module \entityform_menu()
  2. 8.2 entityform.module \entityform_menu()
  3. 7.2 entityform.module \entityform_menu()

Implements hook_menu().

File

./entityform.module, line 14
Module for the Entityform Entity - a starting point to create your own Entity and associated administration interface

Code

function entityform_menu() {
  $items = array();
  $entity_info = entity_get_info('entityform_type');
  $submissions_path = $entity_info['admin ui']['path'] . "/manage/%entityform_type/submissions";
  $path_count = count(explode('/', $submissions_path));
  $items['admin/config/content/entityform'] = array(
    'title' => 'Entityform Settings',
    'description' => '',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'entityform_settings',
    ),
    'access arguments' => array(
      'administer site configuration',
    ),
    'file' => 'entityform_type.admin.inc',
  );
  $items[$submissions_path] = array(
    'title callback' => 'entityform_type_page_title',
    'title arguments' => array(
      1,
      'submissions report',
    ),
    'page callback' => 'entityform_submission_page',
    'page arguments' => array(
      $path_count - 2,
      $path_count,
      'admins',
    ),
    'access arguments' => array(
      'view any entityform',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 100,
  );
  $items['admin/reports/entityforms/submissions/%entityform_type'] = array(
    'title callback' => 'entityform_type_page_title',
    'title arguments' => array(
      1,
      'submissions report',
    ),
    'page callback' => 'entityform_submission_page',
    'page arguments' => array(
      4,
      5,
      'admins',
    ),
    'access arguments' => array(
      'view any entityform',
    ),
    'type' => MENU_LOCAL_TASK,
  );
  return $items;
}