You are here

function theme_imagepicker_insert in Image Picker 7

Same name and namespace in other branches
  1. 6.2 imagepicker.module \theme_imagepicker_insert()
1 theme call to theme_imagepicker_insert()
imagepicker_image_select in ./imagepicker.functions.inc

File

./imagepicker.module, line 1701
@author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function theme_imagepicker_insert($variables) {
  $img = $variables['img'];
  $public = $variables['public'];
  $form1 = $variables['form1'];
  $form2 = $variables['form2'];
  $output = "";
  if ($img) {
    $imgpath = imagepicker_get_image_path($img, 'browser', $public ? array(
      'name' => $img->name,
      'uid' => $img->uid,
    ) : FALSE);
    $output .= '<div class="imgp_help">' . t('Choose the settings you want, place the cursor in the Body box above and Insert image.') . '</div>';
    if (isset($img->img_title)) {
      $output .= '<div id="imgp_img_holder_title">' . $img->img_title . '</div>';
    }
    if (isset($img->img_description)) {
      $output .= '<div id="imgp_img_holder_description">' . nl2br($img->img_description) . '</div>';
    }
    $output .= '<div id="imgp_img_holder">';
    $output .= '<img id="imgp_img" src="' . $imgpath . '" alt="' . (isset($img->img_title) ? $img->img_title : t('Image')) . '" title="' . $img->img_name . '" />';
    $output .= '</div>';
    $output .= $form1 ? render($form1) : '';
    $output .= $form2 ? render($form2) : '';
  }
  return $output;
}