function simple_image_rotate_widget_process in Simple Image Rotate 7.2
Same name and namespace in other branches
- 8 simple_image_rotate.module \simple_image_rotate_widget_process()
- 2.1.x simple_image_rotate.module \simple_image_rotate_widget_process()
- 1.0.x simple_image_rotate.module \simple_image_rotate_widget_process()
- 2.0.x simple_image_rotate.module \simple_image_rotate_widget_process()
Element #process callback function; process widget type image_image.
1 string reference to 'simple_image_rotate_widget_process'
File
- ./
simple_image_rotate.module, line 81 - Allows users to rotate images on node forms.
Code
function simple_image_rotate_widget_process($element, &$form_state, $form) {
if (isset($element['#file']->fid) && $element['#file']->fid > 0) {
$rotate_link = l(t('↻'), '', array(
'html' => TRUE,
'attributes' => array(
'title' => t('Rotate image clockwise'),
'class' => array(
'rotate-icon',
),
'data-rotate' => 0,
'data-weight' => $element['#parents'][2],
'data-fid' => $element['#file']->fid,
),
));
$element['preview']['#markup'] .= $rotate_link;
}
return $element;
}