function _epsacrop_load_styles_by_instance in EPSA Crop - Image Cropping 8.2
Same name and namespace in other branches
- 7.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_process_form_element in ./
epsacrop.module - Helper function that add a link in image widget field to open a dialog for the crops.
File
- ./
epsacrop.module, line 548 - 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'];
}
}
return $styles;
}