Imágenes adjuntas

Actualizacion al 21 de septiembre de 2010, con la versión de módulo Image 6.x-1.0-beta6

 

Modificaciones al módulo Image >> ImageAttach(/sites/all/modules/image/contrib/image_attach.module). En la función:

function theme_image_attach_attached_images($nid, $image_nodes = array(), $options = array()) {
  // Merge in defaults.
  $options += array(
    'size' => IMAGE_THUMBNAIL,
    'link' => 'image',
  );

  $img_size = $options['size'];
  $link_destination = $options['link'];

  // Link images to the attaching node.
  if ($link_destination == 'node') {
    $link_path = "node/$nid";
  }

  $output = '';
  foreach ($image_nodes as $image) {
    if (!node_access('view', $image)) {
      // If the image is restricted, don't show it as an attachment.
      continue;
    }

    // Link images to the image node.
    if ($link_destination == 'image') {
      $link_path = "node/$image->nid";
    }

    // Get a fresh copy of the attributes for each image node.
    $div_attributes = $options['attributes'];

    // Create CSS classes, beginning with those passed in to the function.
    $classes = array();
    if (isset($div_attributes['class'])) {
      $classes[] = $div_attributes['class'];
    }
    // replace with base class in DIV
    //$classes[] = 'image-attach-' . $teaser_or_body;
    $classes[] = 'image-attach-node-' . $image->nid;
    if (!$image->status) {
      $classes[] = 'image-unpublished';
    }
    $div_attributes['class'] = implode(' ', $classes);

    // Add the width as inline CSS.
    $info = image_get_info(file_create_path($image->images[$img_size]));
    if (!isset($div_attributes['style'])) {
      $div_attributes['style'] = '';
    }
    $div_attributes['style'] .= 'width: ' . $info['width'] . 'px;';

    $output .= '

 

Sustituir la línea(702) que dice:

// $output .= l($image_img, $link_path, array('html' => TRUE));

Por esta otra, tal como aparece en el ejemplo:

$output .= $image_img;