diff --git a/colorbox.install b/colorbox.install index c975c7f7d98fcd188b597cfb3c01b72205bfe27f..341a09ee5ff097c158e763a08764cf6f262cb57c 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 476abb33a41537aa01f515b9782aa6e8191da257..9bf530ae7867b218c809b02ff86ea58708a8a645 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('
', $summary); }