summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFredrik Jonsson2011-09-16 01:24:42 (GMT)
committer Fredrik Jonsson2011-09-16 01:24:42 (GMT)
commit0ed469b8c4eb6671d2a8a02068d51fd73401042a (patch)
tree669f40b7cd277ca8814732b1be2dfe5d43864479
parentf8433fc2a46f74ef226201110d37af736671433e (diff)
Made the descriptions in the formatter settings more concise.7.x-1.2
-rw-r--r--colorbox.install20
-rw-r--r--colorbox.module14
2 files changed, 30 insertions, 4 deletions
diff --git a/colorbox.install b/colorbox.install
index c975c7f..341a09e 100644
--- a/colorbox.install
+++ b/colorbox.install
@@ -52,3 +52,23 @@ function colorbox_update_7001() {
return $ret;
}
+
+/**
+ * Delete the unused colorbox_title_trim and
+ * colorbox_title_trim_length variabels.
+ */
+function colorbox_update_7002() {
+ $ret = array();
+ $colorbox_title_trim = variable_get('colorbox_title_trim', NULL);
+ $colorbox_title_trim_length = variable_get('colorbox_title_trim_length', NULL);
+ if (!empty($colorbox_title_trim)) {
+ variable_set('colorbox_caption_trim', $colorbox_title_trim);
+ }
+ if (!empty($colorbox_title_trim_length)) {
+ variable_set('colorbox_caption_trim_length', $colorbox_title_trim_length);
+ }
+ variable_del('colorbox_title_trim');
+ variable_del('colorbox_title_trim_length');
+
+ return $ret;
+}
diff --git a/colorbox.module b/colorbox.module
index 476abb3..9bf530a 100644
--- a/colorbox.module
+++ b/colorbox.module
@@ -444,6 +444,7 @@ function colorbox_field_formatter_settings_form($field, $instance, $view_mode, $
'#default_value' => $settings['colorbox_node_style'],
'#empty_option' => t('None (original image)'),
'#options' => $image_styles_hide,
+ '#description' => t('Image style to use in the node.'),
);
$element['colorbox_image_style'] = array(
'#title' => t('Colorbox image style'),
@@ -451,6 +452,7 @@ function colorbox_field_formatter_settings_form($field, $instance, $view_mode, $
'#default_value' => $settings['colorbox_image_style'],
'#empty_option' => t('None (original image)'),
'#options' => $image_styles,
+ '#description' => t('Image style to use in the Colorbox.'),
);
$gallery = array(
@@ -466,7 +468,7 @@ function colorbox_field_formatter_settings_form($field, $instance, $view_mode, $
'#type' => 'select',
'#default_value' => $settings['colorbox_gallery'],
'#options' => $gallery,
- '#description' => t('Should the gallery be disabled, images within a single field, a single post (default) or all images on the page. The "Custom" option will display a field where a custom value may be entered.'),
+ '#description' => t('How Colorbox should group the image galleries.'),
);
$element['colorbox_gallery_custom'] = array(
'#title' => t('Custom gallery'),
@@ -498,7 +500,7 @@ function colorbox_field_formatter_settings_form($field, $instance, $view_mode, $
'#type' => 'select',
'#default_value' => $settings['colorbox_caption'],
'#options' => $caption,
- '#description' => t('With "Automatic" (default) Colorbox will use the first none empty value of title, the alt text or the node title, in that order as the Caption.'),
+ '#description' => t('Automatic will use the first none empty value of the title, the alt text and the node title.'),
);
return $element;
@@ -543,7 +545,9 @@ function colorbox_field_formatter_settings_summary($field, $instance, $view_mode
'custom' => t('Custom'),
'none' => t('No gallery'),
);
- $summary[] = t('Colorbox gallery type: @type', array('@type' => $gallery[$settings['colorbox_gallery']])) . ($settings['colorbox_gallery'] == 'custom' ? ' (' . $settings['colorbox_gallery_custom'] . ')' : '');
+ if (isset($settings['colorbox_gallery'])) {
+ $summary[] = t('Colorbox gallery type: @type', array('@type' => $gallery[$settings['colorbox_gallery']])) . ($settings['colorbox_gallery'] == 'custom' ? ' (' . $settings['colorbox_gallery_custom'] . ')' : '');
+ }
$caption = array(
'auto' => t('Automatic'),
@@ -552,7 +556,9 @@ function colorbox_field_formatter_settings_summary($field, $instance, $view_mode
'node_title' => t('Node title'),
'none' => t('None'),
);
- $summary[] = t('Colorbox caption: @type', array('@type' => $caption[$settings['colorbox_caption']]));
+ if (isset($settings['colorbox_caption'])) {
+ $summary[] = t('Colorbox caption: @type', array('@type' => $caption[$settings['colorbox_caption']]));
+ }
return implode('<br />', $summary);
}