You are here

function imagepicker_user_view in Image Picker 5.2

Same name and namespace in other branches
  1. 5 imagepicker.module \imagepicker_user_view()
  2. 6.2 imagepicker.user.inc \imagepicker_user_view()
1 call to imagepicker_user_view()
imagepicker_user_page in ./imagepicker.module
Account functions

File

./imagepicker.module, line 2004
Enables permitted roles to upload images for insertion into configured nodes.

Code

function imagepicker_user_view($img_id) {
  $img = _imagepicker_get_img($img_id);
  if ($img) {
    $imgpath = imagepicker_get_image_path($img, 'full');
    $info = image_get_info(imagepicker_get_path(FALSE, TRUE) . $img['img_name']);
    $content = _imagepicker_view_content($img, $imgpath, $info) . drupal_get_form('imagepicker_user_image_form', $img_id) . '<br />' . (_imagepicker_has_groups() ? drupal_get_form('imagepicker_group_images_form', $img['img_id']) : '');
  }
  else {
    drupal_set_message(t('Image not found.'), 'error');
    $content = '';
  }
  return $content;
}