function imagecrop_style_selection_form in Image javascript crop 7
Show a selection form to switch styles preview.
2 string references to 'imagecrop_style_selection_form'
- imagecrop_cropping_page in includes/
imagecrop.admin.inc - Show the cropping page for the selected image style.
- imagecrop_image_styles_overview in includes/
imagecrop.admin.inc - Show an overview from the enabled image styles for this file. Show an example from the first (or selected) image.
File
- includes/
imagecrop.admin.inc, line 250 - Administration tools for the imagecrop module.
Code
function imagecrop_style_selection_form($form, $form_state, $styles, $imagecrop) {
$image_style = $imagecrop
->getImageStyle();
if ($imagecrop->skipPreview) {
$path_action = 'crop';
$select_title = t('Select style to crop');
}
else {
$path_action = 'overview';
$select_title = $imagecrop
->getInCroppingMode() ? t('Select other style to preview') : t('Select style to preview');
}
$form = array();
$form['styles'] = array(
'#type' => 'select',
'#title' => $select_title,
'#options' => $styles,
'#default_value' => $image_style['name'],
);
$path = $imagecrop
->getFile()->fid . '/style_name/' . $imagecrop
->getEntityType() . '/' . $imagecrop
->getBundle() . '/' . $imagecrop
->getFieldName();
$form['imagecrop-url'] = array(
'#type' => 'hidden',
'#value' => url('imagecrop/' . $path_action . '/' . $path, array(
'absolute' => TRUE,
)),
);
return $form;
}