You are here

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

1 string reference to 'merci_reservation_get_action_title'
ReservationUIController::hook_menu in merci_reservation/includes/entity.ui.inc
Provides definitions for implementing hook_menu().

File

merci_reservation/merci_reservation.module, line 31

Code

function merci_reservation_get_action_title($op, $entity_type, $bundle_name = NULL) {
  $info = entity_get_info($entity_type);
  $merci_reservation_types = merci_reservation_types();

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

    // Get entity info for our bundles.
    $info = entity_get_info($entity_type);
    $type = reset($merci_reservation_types);
    $bundle_name = isset($bundle_name) ? $bundle_name : $type->type;
    switch ($op) {
      case 'add':
        if (isset($bundle_name) && $bundle_name != $entity_type) {
          return t('Add @bundle_name', array(
            '@bundle_name' => drupal_strtolower($info['bundles'][$bundle_name]['label']),
          ));
        }
        else {
          return t('Add @entity_type', array(
            '@entity_type' => drupal_strtolower($info['label']),
          ));
        }
      case 'import':
        return t('Import @entity_type', array(
          '@entity_type' => drupal_strtolower($info['label']),
        ));
    }
  }
  return entity_ui_get_action_title($op, $entity_type, $bundle_name);
}