From 9443ffb0591259110dcddaf8863bbf703f4504e6 Mon Sep 17 00:00:00 2001 From: mrded Date: Fri, 14 Dec 2012 15:12:10 +0000 Subject: [PATCH] Possibility to do not choose image's preset --- views_nivo_slider.module | 7 +++---- views_nivo_slider_style_plugin.inc | 9 --------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/views_nivo_slider.module b/views_nivo_slider.module index a824e45..fdd865b 100644 --- a/views_nivo_slider.module +++ b/views_nivo_slider.module @@ -93,12 +93,11 @@ function template_preprocess_views_nivo_slider_view_nivo_sliderfields(&$vars) { $style = $view->style_options; $row = $vars['row']; - $presetname = $style['imagefield_preset']; + $presetname = $view->field[$options['image_field']]->options['settings']['image_style']; $thumbnail_url = $title = $link = NULL; // Force URL format for image_field if (isset($view->field[$options['image_field']])) { - $view->field[$options['image_field']]->options['settings']['image_style'] = $presetname; //$view->field[$options['image_field']]->options['type'] = 'path_plain'; $view->field[$options['image_field']]->options['alter']['make_link'] = 0; } @@ -191,10 +190,10 @@ function template_preprocess_views_nivo_slider_view_nivo_sliderfields(&$vars) { 'attributes' => $attributes, ); - $img = theme('image_style', $params); + $img = (!$presetname) ? theme('image', $params) : theme('image_style', $params); if ($link) { - $img = '' . $img . ''; + $img = l($img, $link, array('html' => TRUE, 'attributes' => array('class' => 'views-processed'))); } $vars['content'] = $img; diff --git a/views_nivo_slider_style_plugin.inc b/views_nivo_slider_style_plugin.inc index 7d7d8e6..ad97ea5 100644 --- a/views_nivo_slider_style_plugin.inc +++ b/views_nivo_slider_style_plugin.inc @@ -15,7 +15,6 @@ class views_nivo_slider_style_plugin extends views_plugin_style { unset($options['grouping']); $options['nivo_version'] = array('default' => '2.7.x'); - $options['imagefield_preset'] = array('default' => ''); $options['style'] = array('default'=> 'default'); $options['effect'] = array('default'=> 'random'); $options['slices'] = array('default'=> '15'); @@ -54,14 +53,6 @@ class views_nivo_slider_style_plugin extends views_plugin_style { '#description' => t('Select the jQuery Nivo Slider plugin version to use.'), ); - $form['imagefield_preset'] = array( - '#type' => 'select', - '#title' => t('Image field style'), - '#options' => $presets, - '#default_value' => $this->options['imagefield_preset'], - '#description' => t('Select the image style to apply on image field.'), - ); - $form['style'] = array( '#type' => 'select', '#title' => t('Style'), -- 1.7.10.2 (Apple Git-33)