function apachesolr_attachments_entity_bundle_label in Apache Solr Attachments 7
NOTE: IF http://drupal.org/node/969180 ever gets committed we could do away with this function
Returns the label of a bundle.
Parameters
$entity_type: The entity type; e.g. 'node' or 'user'.
$entity: The entity for which we want the human-readable label of its bundle.
Return value
A string with the human-readable name of the bundle, or FALSE if not specified.
1 call to apachesolr_attachments_entity_bundle_label()
- apachesolr_attachments_entity_bundle_settings in ./
apachesolr_attachments.admin.inc - Form callback for content type settings.
File
- ./
apachesolr_attachments.admin.inc, line 334 - Provides a file attachment search implementation for use with the Apache Solr module
Code
function apachesolr_attachments_entity_bundle_label($entity_type, $bundle) {
$labels =& drupal_static(__FUNCTION__, array());
if (empty($labels)) {
foreach (entity_get_info() as $entity_t => $entity_info) {
foreach ($entity_info['bundles'] as $b => $bundle_info) {
$labels[$entity_t][$b] = !empty($bundle_info['label']) ? $bundle_info['label'] : $b;
}
}
}
return isset($labels[$entity_type][$bundle]) ? $labels[$entity_type][$bundle] : $bundle;
}