function epsacrop_ajax in EPSA Crop - Image Cropping 8.2
Same name and namespace in other branches
- 7.2 epsacrop.module \epsacrop_ajax()
epsacrop_ajax function.
@access public
Parameters
string $entity_name:
string $field_name:
string $bundle:
string $fid:
Return value
void
1 string reference to 'epsacrop_ajax'
- epsacrop_menu in ./
epsacrop.module - Implements hook_menu.
File
- ./
epsacrop.module, line 168 - The main file of module
Code
function epsacrop_ajax($op, $fid) {
$return = NULL;
switch ($op) {
case 'get':
$return = _epsacrop_get_coords_from_fid($fid);
if ($return == FALSE) {
$return = array();
}
break;
case 'put':
if (isset($_POST) && (isset($_POST['coords']) && !empty($_POST['coords']))) {
$coords = $_POST['coords'];
$fid = $fid;
_epsacrop_save_coords($fid, $coords);
}
break;
case 'del':
break;
}
drupal_json_output($return);
drupal_exit();
}