function merci_content_types in MERCI (Manage Equipment Reservations, Checkout and Inventory) 6.2
Same name and namespace in other branches
- 7.3 merci_migrate/merci_items.inc \merci_content_types()
- 7.2 includes/api.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.
9 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 - merci_load_item_settings in includes/
api.inc - merci_permissions_add_form in modules/
merci_permissions/ merci_permissions.module
File
- includes/
api.inc, line 685 - 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 array_key_exists($type_name, $info) ? $info[$type_name] : array();
}
}