Commit 73efd209 authored by frjo's avatar frjo
Browse files

#752610: Add an option to place a colorbox.css in the theme. #757942: Fixes a...

#752610: Add an option to place a colorbox.css in the theme. #757942: Fixes a bug with the slideshow setting.
parent 8ace13aa
...@@ -87,21 +87,25 @@ function colorbox_admin_settings() { ...@@ -87,21 +87,25 @@ function colorbox_admin_settings() {
'#collapsed' => TRUE '#collapsed' => TRUE
); );
$colorbox_path = variable_get('colorbox_path', COLORBOX_PATH); $colorbox_path = variable_get('colorbox_path', COLORBOX_PATH);
$example_styles = array( $colorbox_styles = array(
'default' => t('Default'), 'default' => t('Default'),
$colorbox_path .'/example1' => t('Example 1'), $colorbox_path .'/example1' => t('Example 1'),
$colorbox_path .'/example2' => t('Example 2'), $colorbox_path .'/example2' => t('Example 2'),
$colorbox_path .'/example3' => t('Example 3'), $colorbox_path .'/example3' => t('Example 3'),
$colorbox_path .'/example4' => t('Example 4'), $colorbox_path .'/example4' => t('Example 4'),
$colorbox_path .'/example5' => t('Example 5'), $colorbox_path .'/example5' => t('Example 5'),
'none' => t('Let the theme handle styling.'),
); );
$theme_path = path_to_theme();
if (is_file($theme_path .'/colorbox.css')) {
$colorbox_styles[$theme_path] = t('Theme');
}
$colorbox_styles['none'] = t('None');
$form['colorbox_custom_settings']['colorbox_style'] = array( $form['colorbox_custom_settings']['colorbox_style'] = array(
'#type' => 'select', '#type' => 'select',
'#title' => t('Style'), '#title' => t('Style'),
'#options' => $example_styles, '#options' => $colorbox_styles,
'#default_value' => variable_get('colorbox_style', 'default'), '#default_value' => variable_get('colorbox_style', 'default'),
'#description' => t('Select the style to use for the Colorbox. The examples are the ones that comes with Colorbox.'), '#description' => t('Select the style to use for the Colorbox. The example styles are the ones that come with the Colorbox script. Tips: Place a "colorbox.css" file in your theme directory to get an option "Theme".'),
); );
$form['colorbox_custom_settings']['colorbox_custom_settings_activate'] = array( $form['colorbox_custom_settings']['colorbox_custom_settings_activate'] = array(
'#type' => 'radios', '#type' => 'radios',
...@@ -178,7 +182,7 @@ function colorbox_admin_settings() { ...@@ -178,7 +182,7 @@ function colorbox_admin_settings() {
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Path to Colorbox'), '#title' => t('Path to Colorbox'),
'#default_value' => $colorbox_path, '#default_value' => $colorbox_path,
'#description' => t('Enter the path relative to Drupal root to the colorbox directory. NO trailing slash!'), '#description' => t('Enter the path relative to Drupal root where the colorbox directory is located. NO trailing slash!'),
); );
$form['colorbox_advanced_settings']['colorbox_pages'] = array( $form['colorbox_advanced_settings']['colorbox_pages'] = array(
'#type' => 'textarea', '#type' => 'textarea',
......
...@@ -145,7 +145,7 @@ function _colorbox_doheader() { ...@@ -145,7 +145,7 @@ function _colorbox_doheader() {
'transition' => variable_get('colorbox_transition_type', 'elastic'), 'transition' => variable_get('colorbox_transition_type', 'elastic'),
'speed' => variable_get('colorbox_transition_speed', 350), 'speed' => variable_get('colorbox_transition_speed', 350),
'opacity' => variable_get('colorbox_opacity', '0.9'), 'opacity' => variable_get('colorbox_opacity', '0.9'),
'slideshow' => variable_get('colorbox_slideshow', FALSE), 'slideshow' => variable_get('colorbox_slideshow', 0) ? TRUE : FALSE,
'current' => variable_get('colorbox_text_current', '{current} of {total}'), 'current' => variable_get('colorbox_text_current', '{current} of {total}'),
'previous' => variable_get('colorbox_text_previous', '« Prev'), 'previous' => variable_get('colorbox_text_previous', '« Prev'),
'next' => variable_get('colorbox_text_next', 'Next »'), 'next' => variable_get('colorbox_text_next', 'Next »'),
......
Supports Markdown
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