function imagepicker_edit_form_cancel in Image Picker 6.2
Same name and namespace in other branches
- 7 imagepicker.edit.inc \imagepicker_edit_form_cancel()
Submit form functions
1 string reference to 'imagepicker_edit_form_cancel'
File
- ./
imagepicker.edit.inc, line 68 - Contains the functions pertaining to editing image information
Code
function imagepicker_edit_form_cancel($form, &$form_state) {
$img_id = $form_state['values']['img_id'];
if ($form_state['values']['account'] && $form_state['values']['src'] == 'admin') {
$user = user_load(array(
'uid' => $form_state['values']['account'],
));
}
else {
global $user;
}
if ($form_state['values']['src'] == 'admin') {
$outpath = IMAGEPICKER_ADMIN_PATH . '/images/user/' . $user->uid . '/browse/' . $img_id;
}
elseif ($form_state['values']['src'] == 'account') {
$outpath = 'user/' . $user->uid . '/imagepicker/images/browse/' . $img_id;
}
else {
$outpath = 'imagepicker/browse/' . $img_id;
}
drupal_set_message(t('Cancelled.'));
drupal_goto($outpath);
}