You are here

function merci_restrictions_add_page in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.3

  • List of task Types.

File

merci_restrictions/merci_restrictions.module, line 177

Code

function merci_restrictions_add_page($entity_type) {
  $merci_restrictions_types = merci_restrictions_types();

  // Bypass the node/add listing if only one content type is available.
  if (count($merci_restrictions_types) == 1) {

    // Get entity info for our bundles.
    $info = entity_get_info($entity_type);
    $type = reset($merci_restrictions_types);
    drupal_goto($info['admin ui']['path'] . '/add/' . $type->type);
  }
  return entity_ui_bundle_add_page($entity_type);
}