You are here

function merci_content_types in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.2

Same name and namespace in other branches
  1. 6.2 includes/api.inc \merci_content_types()
  2. 7.3 merci_migrate/merci_items.inc \merci_content_types()

Return a list of all merci content types.

Parameters

$content_type_name: If set, return information on just this type.

Do some type checking and set up empty arrays for missing info to avoid foreach errors elsewhere in the code.

6 calls to merci_content_types()
MerciAdminTestCase::testMerciBucketContent in tests/merci_admin.test
merci_build_reservable_items in includes/api.inc
Builds the list of all currently reservable items, filtered by date.
merci_handler_filter_merci_node_type::get_value_options in handlers/merci_handler_filter_merci_node_type.inc
Child classes should be used to override this function and set the 'value options', unless 'options callback' is defined as a valid function or static public method to generate these values.
merci_load_item_settings in includes/api.inc
merci_views_handler_filter_reserved_item_nid::allowed_values in handlers/merci_views_handler_filter_reserved_item_nid.inc

... See full list

File

includes/api.inc, line 667
MERCI - Managed Equipment Reservation Checkout and Inventory

Code

function merci_content_types($type_name = NULL) {

  // handle type name with either an underscore or a dash
  $type_name = !empty($type_name) ? str_replace('-', '_', $type_name) : NULL;
  $info = _merci_content_type_info();
  if (!isset($type_name)) {
    return $info;
  }
  else {
    return isset($info[$type_name]) ? $info[$type_name] : array();
  }
}