$item) { // Stop errors for empty URI. See issue [#1319268] for details. if (empty($item['uri'])) { continue; } // Get URL for "normal" image if (empty($optionset['imagestyle_normal'])) { $normal_url = file_create_url($item['uri']); } else { $normal_url = image_style_url($optionset['imagestyle_normal'], $item['uri']); } // Get URL for "big" image (for lightbox and fullscreen) if (empty($optionset['imagestyle_big'])) { $big_url = file_create_url($item['uri']); } elseif ($optionset['imagestyle_big'] != $optionset['imagestyle_normal']) { $big_url = image_style_url($optionset['imagestyle_big'], $item['uri']); } if (!empty($big_url)) { $options = array( 'attributes' => array( 'rel' => $big_url, ) ); } else { $options = array(); } $vars['items'][$delta] = array( '#theme' => 'image_formatter', '#item' => $item, '#image_style' => $thumb_style, '#path' => array( 'path' => $normal_url, 'options' => $options, ), ); } } /** * Theme 'views_view_galleria'. */ function theme_views_view_galleria($vars) { $items = array(); $view = $vars['view']; $img_field_name = $vars['img_field_name']; foreach ($vars['rows'] as $row) { $lang = $row->_field_data[$view->base_field]['entity']->language; // omit rows without image field. if (!isset($row->_field_data[$view->base_field]['entity']->{$img_field_name})) { continue; } $item = $row->_field_data[$view->base_field]['entity']->{$img_field_name}[$lang][0]; $items[] = $item; } return theme('galleria_container', array( 'items' => $items, 'settings' => $vars['options'], )); }