function acquia_lift_profiles_thumbnail_get_field in Acquia Lift Connector 7.2
Same name and namespace in other branches
- 7 acquia_lift_profiles/acquia_lift_profiles.module \acquia_lift_profiles_thumbnail_get_field()
Given an entity type and bundle, get its content recommendation image or NULL.
Parameters
$entity_type: The type of entity to check, e.g., node.
$bundle_name: The name of hte bundle to check, e.g., article.
$reset: True to recalculate, false to retrieve from cache when available.
2 calls to acquia_lift_profiles_thumbnail_get_field()
- acquia_lift_profiles_thumbnail_entity_settings_form in acquia_lift_profiles/
acquia_lift_profiles.admin.inc - Administrative form to select the thumbnail image to use per content type/ entity bundle.
- acquia_lift_profiles_thumbnail_image in acquia_lift_profiles/
acquia_lift_profiles.module - Given an entity and entity type, returns a thumbnail image.
File
- acquia_lift_profiles/
acquia_lift_profiles.module, line 676 - acquia_lift_profiles.module Provides Acquia Lift Profiles integration.
Code
function acquia_lift_profiles_thumbnail_get_field($entity_type, $bundle_name, $reset = FALSE) {
$fields =& drupal_static(__FUNCTION__);
$fields = $reset || is_null($fields) ? array() : $fields;
if (!array_key_exists($entity_type . '_' . $bundle_name, $fields)) {
module_load_include('inc', 'acquia_lift_profiles', 'acquia_lift_profiles.admin');
$field = variable_get('acquia_lift_profiles_thumbnail_field_' . $entity_type . '_' . $bundle_name, '');
$fields[$entity_type . '_' . $bundle_name] = array_key_exists($field, acquia_lift_profiles_thumbnail_available_fields($entity_type, $bundle_name)) ? $field : NULL;
}
return $fields[$entity_type . '_' . $bundle_name];
}