You are here

function theme_imagepicker_view in Image Picker 6.2

3 theme calls to theme_imagepicker_view()
imagepicker_admin_view in ./imagepicker.admin.inc
imagepicker_user_view in ./imagepicker.user.inc
imagepicker_user_view_public in ./imagepicker.user.inc

File

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

Code

function theme_imagepicker_view($img, $imgpath, $info, $exifinfo = '') {
  $output = '<div id="imgp_img_view">';
  $output .= $img['img_title'] ? '<div id="imgp_img_view_title">' . $img['img_title'] . '</div>' : '';
  $output .= '<img id="imgp_img_view_img" src="' . $imgpath . '" alt="' . $img['img_title'] . '" title="' . $img['img_name'] . '" />';
  $output .= $img['img_description'] ? '<div id="imgp_img_view_desc">' . nl2br($img['img_description']) . '</div>' : '';
  $output .= '<div>';
  $output .= t('Width') . ": " . $info['width'] . "&nbsp;&nbsp;&nbsp;";
  $output .= t('Height') . ": " . $info['height'] . "&nbsp;&nbsp;&nbsp;";
  $output .= t('Type') . ": " . $info['extension'] . "&nbsp;&nbsp;&nbsp;";
  $output .= t('Size') . ": " . $info['file_size'] . '</div>';
  if ($exifinfo) {
    $output .= '<a id="imgp_trig">' . t('Show/Hide Exif Info') . '</a>';
    $output .= '<div id="imgp_targ" >';
    if (is_array($exifinfo)) {

      // using php function exif_read_data().
      foreach ($exifinfo as $key => $section) {
        $header = array(
          array(
            'data' => drupal_ucfirst(drupal_strtolower($key)),
            'colspan' => 2,
          ),
        );
        $rows = array();
        foreach ($section as $name => $val) {
          if ($key == 'COMMENT') {
            $a = explode(':', $val);
            $rows[] = array(
              $a[0] . ':',
              $a[1],
            );
          }
          else {
            $rows[] = array(
              $name . ': ',
              $val,
            );
          }
        }
        $output .= theme('table', $header, $rows);
        unset($header);
        unset($rows);
      }
      $output .= '</div>';
    }
    else {

      // from an external source eg exiftool
      $output .= '<pre>';
      $output .= check_plain($exifinfo);
      $output .= '</pre>';
      $output .= '</div>';
    }
  }
  $output .= '</div>';
  return $output;
}