function imagecrop_find_imagefields in Image javascript crop 5
Helper function to search for a cck field image. Temporary images not supported at this point.
Parameters
$form complete form object:
$fields all available fields from settings:
Return value
ckk imagefields array or false
1 call to imagecrop_find_imagefields()
- imagecrop_form_alter in ./
imagecrop.module - Implementation of hook_form_alter(). Hook into several existing image modules/fields.
File
- ./
imagecrop.module, line 270 - Provides a javascript toolbox through an imagecache action.
Code
function imagecrop_find_imagefields($form, $fields) {
$temp_path = file_directory_temp();
$count = count($fields);
$return = FALSE;
for ($i = 0; $i < $count; $i++) {
$temppath = strpos($form[$fields[$i]][0]['filepath']['#value'], $temp_path);
$deleteflag = $form[$fields[$i]][0]['flags']['delete']['#value'];
if (isset($form[$fields[$i]]) && $temppath === FALSE && $deleteflag != 1) {
$return[] = $fields[$i];
}
}
return $return;
}