function _epsacrop_load_styles_by_instance in EPSA Crop - Image Cropping 7.2
Same name and namespace in other branches
- 8.2 epsacrop.module \_epsacrop_load_styles_by_instance()
Get all style that are attach to one instance of field.
@access private
Parameters
string $entity_type:
string $field_name:
string $bundle_name:
Return value
array
2 calls to _epsacrop_load_styles_by_instance()
- epsacrop_dialog in ./
epsacrop.module - epsacrop_dialog function.
- epsacrop_element_process in ./
epsacrop.module - Helper function that add a link in image widget field to open a dialog for the crops.
File
- ./
epsacrop.module, line 825 - The main file of module
Code
function _epsacrop_load_styles_by_instance($entity_type, $field_name, $bundle) {
$instance = field_info_instance($entity_type, $field_name, $bundle);
$styles = array();
if (isset($instance['settings']['epsacrop']) && is_array($instance['settings']['epsacrop']['styles'])) {
$instance['settings']['epsacrop']['styles'] = array_filter($instance['settings']['epsacrop']['styles']);
if (isset($instance['settings']['epsacrop']['styles']) && !empty($instance['settings']['epsacrop']['styles'])) {
$styles = $instance['settings']['epsacrop'];
}
}
// Allow other modules to alter list of styles
drupal_alter('epsacrop_load_styles', $styles, $entity_type, $field_name, $bundle);
return $styles;
}