Commit 8c46786a authored by frjo's avatar frjo
Browse files

If no style is set in formatter, fall back on theme_image().

parent 398735ef
......@@ -65,7 +65,7 @@ function colorbox_admin_settings() {
'#title' => t('Image style'),
'#empty_option' => t('None (original image)'),
'#options' => $image_styles,
'#default_value' => variable_get('colorbox_image_style', 0),
'#default_value' => variable_get('colorbox_image_style', ''),
'#description' => t('Select which image style to use for viewing images in the colorbox.'),
);
$form['colorbox_insert_module']['colorbox_insert_gallery'] = array(
......
......@@ -94,7 +94,13 @@ function theme_colorbox_image_formatter($variables) {
* @ingroup themeable
*/
function theme_colorbox_imagefield($variables) {
$image = theme('image_style', $variables['image']);
if (!empty($variables['image']['style_name'])) {
$image = theme('image_style', $variables['image']);
}
else {
$image = theme('image', $variables['image']);
}
$options = array(
'html' => TRUE,
'attributes' => array(
......@@ -103,9 +109,8 @@ function theme_colorbox_imagefield($variables) {
'rel' => 'gallery-' . $variables['gid']
)
);
$output = l($image, $variables['path'], $options);
return $output;
return l($image, $variables['path'], $options);
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment