diff -ruN original/views_nivo_slider.module mod/views_nivo_slider.module
--- original/views_nivo_slider.module 2010-06-18 22:04:17.000000000 +0700
+++ mod/views_nivo_slider.module 2012-01-03 17:11:33.000000000 +0700
@@ -139,7 +139,12 @@
}
}
- $img = theme('imagecache' , $presetname , $image_url, $title, $title, $attributes, TRUE);
+ if (!empty($presetname)) {
+ $img = theme('imagecache' , $presetname , $image_url, $title, $title, $attributes, TRUE);
+ }
+ else {
+ $img = theme('image', $image_url, $title, $title, $attributes, TRUE);
+ }
if ($link) {
$img = ''.$img.'';
diff -ruN original/views_nivo_slider_style_plugin.inc mod/views_nivo_slider_style_plugin.inc
--- original/views_nivo_slider_style_plugin.inc 2010-06-18 22:04:17.000000000 +0700
+++ mod/views_nivo_slider_style_plugin.inc 2012-01-03 17:38:27.000000000 +0700
@@ -41,11 +41,13 @@
foreach (imagecache_presets() as $p) {
$presets[$p['presetname']] = $p['presetname'];
}
+
+ $preset_options = array('' => t('')) + $presets;
$form['imagefield_preset'] = array(
'#type' => 'select',
'#title' => t('Image field Preset'),
- '#options' => $presets,
+ '#options' => $preset_options,
'#default_value' => $this->options['imagefield_preset'],
'#description' => t('Select the imagecache preset to apply on image field.'),
);
@@ -114,11 +116,6 @@
),
);
- $presets = array();
- foreach (imagecache_presets() as $p) {
- $presets[$p['presetname']] = $p['presetname'];
- }
-
$form['controlNavThumbsIC'] = array(
'#type' => 'select',
'#title' => t('ImageCache presets for use in thumbs'),
@@ -192,6 +189,18 @@
);
}
+
+ function options_validate(&$form, &$state) {
+ parent::options_validate($form, $state);
+
+ $values = $state['values']['style_options'];
+
+ if (empty($values['imagefield_preset']) && $values['controlNav'] == 'thumbsIC') {
+ form_error($form['controlNav'], t("Control Navigator %type can't be used with original image.", array(
+ '%type' => t('Thumbnails with ImageCache presets'),
+ )));
+ }
+ }
function get_style_options() {
return array(