function imageoffsets in Image javascript crop 5
Callback to return offsets, height & width
Parameters
$xoffset x value of javascript box:
$yoffset y value of javascript box:
$crop_width width of javascript box:
$crop_height height of javascript box:
$presetid id of preset:
$fid id of file:
$module specific module:
Return value
array $form
1 string reference to 'imageoffsets'
- imagecrop_docrop in ./
imagecrop.module - Callback with javascript crop.
File
- ./
imagecrop.module, line 350 - Provides a javascript toolbox through an imagecache action.
Code
function imageoffsets($xoffset, $yoffset, $crop_width, $crop_height, $presetid, $fid, $module, $width, $scale) {
$form['buttons']['submit'] = array(
'#prefix' => '<table style="width: 400px; margin: 0;" id="imagecrop_table_actions"><tr><td>',
'#suffix' => '</td>',
'#type' => 'submit',
'#value' => t('Create crop'),
);
$form['buttons']['scaling'] = array(
'#prefix' => '<td>',
'#suffix' => '</td>',
'#type' => 'select',
'#default_value' => $scale,
'#options' => imagecrop_scale_options($width, $crop_width),
);
$form['button']['scaledown'] = array(
'#prefix' => '<td>',
'#suffix' => '</td></tr></table>',
'#type' => 'submit',
'#value' => t('Scale image'),
);
$form['image-crop-x'] = array(
'#type' => 'hidden',
'#default_value' => $xoffset,
'#attributes' => array(
'class' => 'edit-image-crop-x',
),
);
$form['image-crop-y'] = array(
'#type' => 'hidden',
'#default_value' => $yoffset,
'#attributes' => array(
'class' => 'edit-image-crop-y',
),
);
$form['image-crop-width'] = array(
'#type' => 'hidden',
'#default_value' => $crop_width,
'#attributes' => array(
'class' => 'edit-image-crop-width',
),
);
$form['image-crop-height'] = array(
'#type' => 'hidden',
'#default_value' => $crop_height,
'#attributes' => array(
'class' => 'edit-image-crop-height',
),
);
$form['fid'] = array(
'#type' => 'hidden',
'#value' => $fid,
);
$form['module'] = array(
'#type' => 'hidden',
'#value' => $module,
);
$form['presetid'] = array(
'#type' => 'hidden',
'#value' => $presetid,
);
return $form;
}