function bxslider_field_formatter_settings_form in BxSlider 7
Implements hook_field_formatter_settings_form().
File
- ./
bxslider.module, line 280 - Fields integration with BxSlider.
Code
function bxslider_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) {
$display = $instance['display'][$view_mode];
$settings = $display['settings'];
$image_styles = image_style_options(FALSE, PASS_THROUGH);
$element['image_style'] = array(
'#title' => t('Image style'),
'#type' => 'select',
'#default_value' => $settings['image_style'],
'#empty_option' => t('None (original image)'),
'#options' => $image_styles,
);
$element['description'] = array(
'#markup' => t('Visit <a href="@field-help" target="_blank">http://bxslider.com/options</a> for more information about bxSlider options.', array(
'@field-help' => url('http://bxslider.com/options'),
)),
);
$element['general'] = array(
'#type' => 'fieldset',
'#title' => t('General'),
'#weight' => 1,
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$element['general']['mode'] = array(
'#title' => t('Mode'),
'#type' => 'select',
'#default_value' => $settings['general']['mode'],
'#options' => array(
'horizontal' => 'horizontal',
'vertical' => 'vertical',
'fade' => 'fade',
),
);
$element['general']['speed'] = array(
'#title' => t('Speed'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['general']['speed'],
);
$element['general']['slideMargin'] = array(
'#title' => t('slideMargin'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['general']['slideMargin'],
);
$element['general']['startSlide'] = array(
'#title' => t('startSlide'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['general']['startSlide'],
);
$element['general']['randomStart'] = array(
'#type' => 'checkbox',
'#title' => t('randomStart'),
'#default_value' => $settings['general']['randomStart'],
);
$element['general']['infiniteLoop'] = array(
'#type' => 'checkbox',
'#title' => t('infiniteLoop'),
'#default_value' => $settings['general']['infiniteLoop'],
);
$element['general']['hideControlOnEnd'] = array(
'#type' => 'checkbox',
'#title' => t('hideControlOnEnd'),
'#default_value' => $settings['general']['hideControlOnEnd'],
);
$element['general']['easing'] = array(
'#title' => t('easing'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['general']['easing'],
);
$element['general']['captions'] = array(
'#type' => 'checkbox',
'#title' => t('captions'),
'#default_value' => $settings['general']['captions'],
);
$element['general']['ticker'] = array(
'#type' => 'checkbox',
'#title' => t('ticker'),
'#default_value' => $settings['general']['ticker'],
);
$element['general']['tickerHover'] = array(
'#type' => 'checkbox',
'#title' => t('tickerHover'),
'#default_value' => $settings['general']['tickerHover'],
);
$element['general']['adaptiveHeight'] = array(
'#type' => 'checkbox',
'#title' => t('adaptiveHeight'),
'#default_value' => $settings['general']['adaptiveHeight'],
);
$element['general']['adaptiveHeightSpeed'] = array(
'#title' => t('adaptiveHeightSpeed'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['general']['adaptiveHeightSpeed'],
);
$element['general']['video'] = array(
'#type' => 'checkbox',
'#title' => t('video'),
'#default_value' => $settings['general']['video'],
);
$element['general']['responsive'] = array(
'#type' => 'checkbox',
'#title' => t('responsive'),
'#default_value' => $settings['general']['responsive'],
);
$element['general']['useCSS'] = array(
'#type' => 'checkbox',
'#title' => t('useCSS'),
'#default_value' => $settings['general']['useCSS'],
);
$element['general']['preloadImages'] = array(
'#title' => t('preloadImages'),
'#type' => 'select',
'#default_value' => $settings['general']['preloadImages'],
'#options' => array(
'all' => 'all',
'visible' => 'visible',
),
);
$element['general']['preloadImages'] = array(
'#type' => 'checkbox',
'#title' => t('preloadImages'),
'#default_value' => $settings['general']['preloadImages'],
);
$element['general']['swipeThreshold'] = array(
'#title' => t('swipeThreshold'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['general']['swipeThreshold'],
);
$element['general']['oneToOneTouch'] = array(
'#type' => 'checkbox',
'#title' => t('oneToOneTouch'),
'#default_value' => $settings['general']['oneToOneTouch'],
);
$element['general']['preventDefaultSwipeX'] = array(
'#type' => 'checkbox',
'#title' => t('preventDefaultSwipeX'),
'#default_value' => $settings['general']['preventDefaultSwipeX'],
);
$element['general']['preventDefaultSwipeY'] = array(
'#type' => 'checkbox',
'#title' => t('preventDefaultSwipeY'),
'#default_value' => $settings['general']['preventDefaultSwipeY'],
);
if ($display['type'] == 'bxslider') {
$element['pager'] = array(
'#type' => 'fieldset',
'#title' => t('Pager'),
'#weight' => 2,
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$element['pager']['pager'] = array(
'#type' => 'checkbox',
'#title' => t('pager'),
'#default_value' => $settings['pager']['pager'],
);
$element['pager']['pagerType'] = array(
'#title' => t('pagerType'),
'#type' => 'select',
'#default_value' => $settings['pager']['pagerType'],
'#options' => array(
'full' => 'full',
'short' => 'short',
),
'#states' => array(
'enabled' => array(
':input[name="fields[' . $field['field_name'] . '][settings_edit_form][settings][pager][pager]"]' => array(
'checked' => TRUE,
),
),
),
);
$element['pager']['pagerShortSeparator'] = array(
'#title' => t('pagerShortSeparator'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['pager']['pagerShortSeparator'],
'#states' => array(
'enabled' => array(
':input[name="fields[' . $field['field_name'] . '][settings_edit_form][settings][pager][pager]"]' => array(
'checked' => TRUE,
),
),
),
);
$element['pager']['pagerSelector'] = array(
'#title' => t('pagerSelector'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['pager']['pagerSelector'],
'#states' => array(
'enabled' => array(
':input[name="fields[' . $field['field_name'] . '][settings_edit_form][settings][pager][pager]"]' => array(
'checked' => TRUE,
),
),
),
);
$element['pager']['pagerCustom_type_markup'] = array(
'#markup' => '<hr>',
);
$element['pager']['pagerCustom_type'] = array(
'#title' => t('Custom Pager'),
'#type' => 'select',
'#default_value' => $settings['pager']['pagerCustom_type'],
'#options' => array(
'none' => 'None',
'thumbnail_pager_method1' => 'Thumbnail pager - method 1',
'thumbnail_pager_method2' => 'Thumbnail pager - method 2',
),
'#description' => t('Select a thumbnail pager according to <a href="@method1">Thumbnail pager - method 1</a> or <a href="@method2">Thumbnail pager - method 2</a>.', array(
'@method1' => url('http://bxslider.com/examples/thumbnail-pager-1'),
'@method2' => url('http://bxslider.com/examples/thumbnail-pager-2'),
)),
'#states' => array(
'enabled' => array(
':input[name="fields[' . $field['field_name'] . '][settings_edit_form][settings][pager][pager]"]' => array(
'checked' => TRUE,
),
),
),
);
$element['pager']['pagerCustom_image_style'] = array(
'#title' => t('Custom Pager - Image style'),
'#type' => 'select',
'#default_value' => $settings['pager']['pagerCustom_image_style'],
'#empty_option' => t('None (thumbnail)'),
'#options' => $image_styles,
'#description' => t('Used only when some the "Custom Pager" option is selected.'),
'#states' => array(
'enabled' => array(
array(
array(
':input[name="fields[' . $field['field_name'] . '][settings_edit_form][settings][pager][pagerCustom_type]"]' => array(
'value' => 'thumbnail_pager_method1',
),
),
'xor',
array(
':input[name="fields[' . $field['field_name'] . '][settings_edit_form][settings][pager][pagerCustom_type]"]' => array(
'value' => 'thumbnail_pager_method2',
),
),
),
':input[name="fields[' . $field['field_name'] . '][settings_edit_form][settings][pager][pager]"]' => array(
'checked' => TRUE,
),
),
),
);
}
$element['controls'] = array(
'#type' => 'fieldset',
'#title' => t('Controls'),
'#weight' => 3,
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$element['controls']['controls'] = array(
'#type' => 'checkbox',
'#title' => t('controls'),
'#default_value' => $settings['controls']['controls'],
);
$element['controls']['nextText'] = array(
'#title' => t('nextText'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['controls']['nextText'],
);
$element['controls']['prevText'] = array(
'#title' => t('prevText'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['controls']['prevText'],
);
$element['controls']['nextSelector'] = array(
'#title' => t('nextSelector'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['controls']['nextSelector'],
);
$element['controls']['prevSelector'] = array(
'#title' => t('prevSelector'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['controls']['prevSelector'],
);
$element['controls']['autoControls'] = array(
'#type' => 'checkbox',
'#title' => t('autoControls'),
'#default_value' => $settings['controls']['autoControls'],
);
$element['controls']['startText'] = array(
'#title' => t('startText'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['controls']['startText'],
);
$element['controls']['stopText'] = array(
'#title' => t('stopText'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['controls']['stopText'],
);
$element['controls']['autoControlsCombine'] = array(
'#type' => 'checkbox',
'#title' => t('Auto'),
'#default_value' => $settings['controls']['autoControlsCombine'],
);
$element['controls']['autoControlsSelector'] = array(
'#title' => t('autoControlsSelector'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['controls']['autoControlsSelector'],
);
$element['auto'] = array(
'#type' => 'fieldset',
'#title' => t('Auto'),
'#weight' => 4,
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$element['auto']['auto'] = array(
'#type' => 'checkbox',
'#title' => t('Auto'),
'#default_value' => $settings['auto']['auto'],
);
$element['auto']['pause'] = array(
'#title' => t('pause'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['auto']['pause'],
);
$element['auto']['autoStart'] = array(
'#type' => 'checkbox',
'#title' => t('autoStart'),
'#default_value' => $settings['auto']['autoStart'],
);
$element['auto']['autoDirection'] = array(
'#title' => t('autoDirection'),
'#type' => 'select',
'#default_value' => $settings['auto']['autoDirection'],
'#options' => array(
'next' => 'next',
'prev' => 'prev',
),
);
$element['auto']['autoHover'] = array(
'#type' => 'checkbox',
'#title' => t('autoHover'),
'#default_value' => $settings['auto']['autoHover'],
);
$element['auto']['autoDelay'] = array(
'#title' => t('autoDelay'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['auto']['autoDelay'],
);
$element['carousel'] = array(
'#type' => 'fieldset',
'#title' => t('Carousel'),
'#weight' => 5,
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$element['carousel']['minSlides'] = array(
'#title' => t('minSlides'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['carousel']['minSlides'],
);
$element['carousel']['maxSlides'] = array(
'#title' => t('maxSlides'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['carousel']['maxSlides'],
);
$element['carousel']['moveSlides'] = array(
'#title' => t('moveSlides'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['carousel']['moveSlides'],
);
$element['carousel']['slideWidth'] = array(
'#title' => t('slideWidth'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['carousel']['slideWidth'],
);
if ($display['type'] == 'bxslider_ths') {
$element['thumbnail_slider'] = array(
'#type' => 'fieldset',
'#title' => t('Thumbnail slider'),
'#weight' => 10,
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$element['thumbnail_slider']['thumbnail_style'] = array(
'#title' => t('Image style'),
'#type' => 'select',
'#default_value' => $settings['thumbnail_slider']['thumbnail_style'],
'#empty_option' => t('None (original image)'),
'#options' => $image_styles,
);
$element['thumbnail_slider']['general'] = array(
'#type' => 'fieldset',
'#title' => t('General'),
'#weight' => 1,
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$element['thumbnail_slider']['general']['mode'] = array(
'#title' => t('Mode'),
'#type' => 'select',
'#default_value' => $settings['thumbnail_slider']['general']['mode'],
'#options' => array(
'horizontal' => 'horizontal',
'fade' => 'fade',
),
);
$element['thumbnail_slider']['general']['speed'] = array(
'#title' => t('Speed'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['thumbnail_slider']['general']['speed'],
);
$element['thumbnail_slider']['general']['slideMargin'] = array(
'#title' => t('slideMargin'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['thumbnail_slider']['general']['slideMargin'],
);
$element['thumbnail_slider']['general']['startSlide'] = array(
'#title' => t('startSlide'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['thumbnail_slider']['general']['startSlide'],
);
$element['thumbnail_slider']['general']['randomStart'] = array(
'#type' => 'checkbox',
'#title' => t('randomStart'),
'#default_value' => $settings['thumbnail_slider']['general']['randomStart'],
);
$element['thumbnail_slider']['general']['infiniteLoop'] = array(
'#type' => 'checkbox',
'#title' => t('infiniteLoop'),
'#default_value' => $settings['thumbnail_slider']['general']['infiniteLoop'],
);
$element['thumbnail_slider']['general']['hideControlOnEnd'] = array(
'#type' => 'checkbox',
'#title' => t('hideControlOnEnd'),
'#default_value' => $settings['thumbnail_slider']['general']['hideControlOnEnd'],
);
$element['thumbnail_slider']['general']['easing'] = array(
'#title' => t('easing'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['thumbnail_slider']['general']['easing'],
);
$element['thumbnail_slider']['general']['captions'] = array(
'#type' => 'checkbox',
'#title' => t('captions'),
'#default_value' => $settings['thumbnail_slider']['general']['captions'],
);
$element['thumbnail_slider']['general']['ticker'] = array(
'#type' => 'checkbox',
'#title' => t('ticker'),
'#default_value' => $settings['thumbnail_slider']['general']['ticker'],
);
$element['thumbnail_slider']['general']['tickerHover'] = array(
'#type' => 'checkbox',
'#title' => t('tickerHover'),
'#default_value' => $settings['thumbnail_slider']['general']['tickerHover'],
);
$element['thumbnail_slider']['general']['adaptiveHeight'] = array(
'#type' => 'checkbox',
'#title' => t('adaptiveHeight'),
'#default_value' => $settings['thumbnail_slider']['general']['adaptiveHeight'],
);
$element['thumbnail_slider']['general']['adaptiveHeightSpeed'] = array(
'#title' => t('adaptiveHeightSpeed'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['thumbnail_slider']['general']['adaptiveHeightSpeed'],
);
$element['thumbnail_slider']['general']['responsive'] = array(
'#type' => 'checkbox',
'#title' => t('responsive'),
'#default_value' => $settings['thumbnail_slider']['general']['responsive'],
);
$element['thumbnail_slider']['general']['useCSS'] = array(
'#type' => 'checkbox',
'#title' => t('useCSS'),
'#default_value' => $settings['thumbnail_slider']['general']['useCSS'],
);
$element['thumbnail_slider']['general']['preloadImages'] = array(
'#title' => t('preloadImages'),
'#type' => 'select',
'#default_value' => $settings['thumbnail_slider']['general']['preloadImages'],
'#options' => array(
'all' => 'all',
'visible' => 'visible',
),
);
$element['thumbnail_slider']['general']['preloadImages'] = array(
'#type' => 'checkbox',
'#title' => t('preloadImages'),
'#default_value' => $settings['thumbnail_slider']['general']['preloadImages'],
);
$element['thumbnail_slider']['general']['swipeThreshold'] = array(
'#title' => t('swipeThreshold'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['thumbnail_slider']['general']['swipeThreshold'],
);
$element['thumbnail_slider']['general']['oneToOneTouch'] = array(
'#type' => 'checkbox',
'#title' => t('oneToOneTouch'),
'#default_value' => $settings['thumbnail_slider']['general']['oneToOneTouch'],
);
$element['thumbnail_slider']['general']['preventDefaultSwipeX'] = array(
'#type' => 'checkbox',
'#title' => t('preventDefaultSwipeX'),
'#default_value' => $settings['thumbnail_slider']['general']['preventDefaultSwipeX'],
);
$element['thumbnail_slider']['general']['preventDefaultSwipeY'] = array(
'#type' => 'checkbox',
'#title' => t('preventDefaultSwipeY'),
'#default_value' => $settings['thumbnail_slider']['general']['preventDefaultSwipeY'],
);
$element['thumbnail_slider']['pager']['pager'] = array(
'#type' => 'hidden',
'#default_value' => $settings['thumbnail_slider']['pager']['pager'],
);
$element['thumbnail_slider']['controls'] = array(
'#type' => 'fieldset',
'#title' => t('Controls'),
'#weight' => 3,
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$element['thumbnail_slider']['controls']['controls'] = array(
'#type' => 'checkbox',
'#title' => t('controls'),
'#default_value' => $settings['thumbnail_slider']['controls']['controls'],
);
$element['thumbnail_slider']['controls']['nextText'] = array(
'#title' => t('nextText'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['thumbnail_slider']['controls']['nextText'],
);
$element['thumbnail_slider']['controls']['prevText'] = array(
'#title' => t('prevText'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['thumbnail_slider']['controls']['prevText'],
);
$element['thumbnail_slider']['controls']['autoControls'] = array(
'#type' => 'checkbox',
'#title' => t('autoControls'),
'#default_value' => $settings['thumbnail_slider']['controls']['autoControls'],
);
$element['thumbnail_slider']['controls']['startText'] = array(
'#title' => t('startText'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['thumbnail_slider']['controls']['startText'],
);
$element['thumbnail_slider']['controls']['stopText'] = array(
'#title' => t('stopText'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['thumbnail_slider']['controls']['stopText'],
);
$element['thumbnail_slider']['controls']['autoControlsCombine'] = array(
'#type' => 'checkbox',
'#title' => t('Auto'),
'#default_value' => $settings['thumbnail_slider']['controls']['autoControlsCombine'],
);
$element['thumbnail_slider']['auto'] = array(
'#type' => 'fieldset',
'#title' => t('Auto'),
'#weight' => 4,
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$element['thumbnail_slider']['auto']['auto'] = array(
'#type' => 'checkbox',
'#title' => t('Auto'),
'#default_value' => $settings['thumbnail_slider']['auto']['auto'],
);
$element['thumbnail_slider']['auto']['pause'] = array(
'#title' => t('pause'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['thumbnail_slider']['auto']['pause'],
);
$element['thumbnail_slider']['auto']['autoStart'] = array(
'#type' => 'checkbox',
'#title' => t('autoStart'),
'#default_value' => $settings['thumbnail_slider']['auto']['autoStart'],
);
$element['thumbnail_slider']['auto']['autoDirection'] = array(
'#title' => t('autoDirection'),
'#type' => 'select',
'#default_value' => $settings['thumbnail_slider']['auto']['autoDirection'],
'#options' => array(
'next' => 'next',
'prev' => 'prev',
),
);
$element['thumbnail_slider']['auto']['autoHover'] = array(
'#type' => 'checkbox',
'#title' => t('autoHover'),
'#default_value' => $settings['thumbnail_slider']['auto']['autoHover'],
);
$element['thumbnail_slider']['auto']['autoDelay'] = array(
'#title' => t('autoDelay'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['thumbnail_slider']['auto']['autoDelay'],
);
$element['thumbnail_slider']['carousel'] = array(
'#type' => 'fieldset',
'#title' => t('Carousel'),
'#weight' => 5,
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$element['thumbnail_slider']['carousel']['minSlides'] = array(
'#title' => t('minSlides'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['thumbnail_slider']['carousel']['minSlides'],
);
$element['thumbnail_slider']['carousel']['maxSlides'] = array(
'#title' => t('maxSlides'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['thumbnail_slider']['carousel']['maxSlides'],
);
$element['thumbnail_slider']['carousel']['moveSlides'] = array(
'#title' => t('moveSlides'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['thumbnail_slider']['carousel']['moveSlides'],
);
}
$colorbox_exist = module_exists('colorbox');
$element['colorbox'] = array(
'#type' => 'fieldset',
'#title' => t('Colorbox'),
'#weight' => 11,
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#description' => $colorbox_exist ? '' : t("Please, enable the Colorbox module firstly."),
);
$element['colorbox']['enable'] = array(
'#type' => 'checkbox',
'#title' => t('Colorbox enable'),
'#default_value' => $settings['colorbox']['enable'],
'#disabled' => $colorbox_exist ? FALSE : TRUE,
);
$element['colorbox']['image_style'] = array(
'#title' => t('Colorbox Image style'),
'#type' => 'select',
'#default_value' => $settings['colorbox']['image_style'],
'#empty_option' => t('None (original image)'),
'#options' => $image_styles,
'#disabled' => $colorbox_exist ? FALSE : TRUE,
);
$element['colorbox']['slideshow'] = array(
'#title' => t('Colorbox slideshow'),
'#type' => 'select',
'#default_value' => $settings['colorbox']['slideshow'],
'#empty_option' => t('No slideshow'),
'#options' => array(
'manual' => 'Manual',
'automatic' => 'Automatic',
),
'#disabled' => $colorbox_exist ? FALSE : TRUE,
);
$element['colorbox']['slideshow_speed'] = array(
'#title' => t('Colorbox slideshow speed'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['colorbox']['slideshow_speed'],
'#description' => t("Time between transitions (ms)."),
'#disabled' => $colorbox_exist ? FALSE : TRUE,
);
$element['colorbox']['transition'] = array(
'#title' => t('Colorbox transition'),
'#type' => 'select',
'#default_value' => $settings['colorbox']['transition'],
'#empty_option' => t('No transition'),
'#options' => array(
'elastic' => 'Elastic',
'fade' => 'Fade',
),
'#disabled' => $colorbox_exist ? FALSE : TRUE,
);
$element['colorbox']['transition_speed'] = array(
'#title' => t('Colorbox transition speed'),
'#type' => 'textfield',
'#size' => 60,
'#default_value' => $settings['colorbox']['transition_speed'],
'#description' => t("Duration of transition (ms)."),
'#disabled' => $colorbox_exist ? FALSE : TRUE,
);
return $element;
}