diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 81d32556b7b6751567ebbcf59b81978422179461..0000000000000000000000000000000000000000 --- a/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -#ignore the folder from PhpStorm IDE -.idea - -#ignore files used by eclipse -.buildpath -.project -.settings diff --git a/js/lightbox.js b/js/lightbox.js index 061cfd60ba8b9197aa636f48d701cda48ab6e7c2..481f693e3bd6dc7441f74080ceee29901fd222c4 100644 --- a/js/lightbox.js +++ b/js/lightbox.js @@ -1072,8 +1072,9 @@ Lightbox = { parts["flashvars"] = parts["style"].match(/flashvars:\s?(.*?);/)[1]; } } - if ($(link).attr('rel').match(/\[.*\]\[(.*)\]/)) { - parts["title"] = $(link).attr('rel').match(/\[.*\]\[(.*)\]/)[1]; + if ($(link).attr('rel').match(/\[.*\]\[([\s\S]*)\]/)) { + var title = $(link).attr('rel').match(/\[.*\]\[([\s\S]*)\]/)[1]; + parts["title"] = title.replace(/\n/g, '
'); } return parts; }, diff --git a/lightbox2.formatter.inc b/lightbox2.formatter.inc index 7907cab77bdaf26cc30daa660c9604e3b181d5ed..9224c2a2b5424663d3c9720e359b47b5b9345d1c 100644 --- a/lightbox2.formatter.inc +++ b/lightbox2.formatter.inc @@ -27,7 +27,7 @@ function theme_lightbox2_image($variables) { $image_style = $variables['image_style']; $node_id = $variables['node_id']; $field_name = $variables['field_name']; - $caption = $variables['caption']; + $caption = isset($variables['caption']) ? $variables['caption'] : 'hidden'; if (!$variables["lightbox_style"]) { $path['path'] = file_create_url($item['uri']); diff --git a/lightbox2.info b/lightbox2.info index 48fa008a2ef55ec2472f9a73e3c48a2953d0899f..0d8a6a49030d0ca55faa7f1b666a5b5209647fdf 100644 --- a/lightbox2.info +++ b/lightbox2.info @@ -4,7 +4,7 @@ description = Enables Lightbox2 for Drupal core = 7.x package = User interface -dependencies[] = entity +dependencies[] = entity:entity files[] = lightbox2.install files[] = lightbox2.module @@ -13,10 +13,3 @@ files[] = lightbox2.admin.inc files[] = lightbox2_handler_field_lightbox2.inc configure = admin/config/user-interface/lightbox2 - -; Information added by drupal.org packaging script on 2010-09-24 -version = "7.x-dev" -core = "7.x" -project = "lightbox2" - - diff --git a/lightbox2.install b/lightbox2.install index a9a2bdc269ce16defb1ce527981a7d0d83b27995..13caeb8858b3ef8d481b554c3893506ca381fb0a 100644 --- a/lightbox2.install +++ b/lightbox2.install @@ -29,6 +29,7 @@ function lightbox2_uninstall() { variable_del('lightbox2_image_count_str'); variable_del('lightbox2_page_count_str'); variable_del('lightbox2_video_count_str'); + variable_del('lightbox2_filter_xss_allowed_tags'); variable_del('lightbox2_disable_resize'); variable_del('lightbox2_disable_zoom'); variable_del('lightbox2_enable_login'); @@ -38,6 +39,7 @@ function lightbox2_uninstall() { variable_del('lightbox2_flv_player_flashvars'); variable_del('lightbox2_page_init_action'); variable_del('lightbox2_page_list'); + variable_del('lightbox2_image_group_node_id'); variable_del('lightbox2_disable_these_urls'); variable_del('lightbox2_imagefield_group_node_id'); variable_del('lightbox2_imagefield_use_node_title'); @@ -104,11 +106,13 @@ function lightbox2_uninstall() { * too late now. */ function lightbox2_update_1() { - $ret = array(); - $ret[] = update_sql('UPDATE {variable} SET name="lightbox2_lite" - WHERE name="lightbox2_plus";'); - - return $ret; + $variable_name = 'lightbox2_plus'; + $var = variable_get($variable_name); + if ($var) { + variable_set('lightbox2_lite', $var); + variable_del($variable_name); + } + return array(); } /** @@ -184,11 +188,11 @@ function lightbox2_update_6001() { * 'lightbox2_slideshow_pause_on_prev_click'. */ function lightbox2_update_6002() { - $vars = variable_init(); - if (array_key_exists('lightbox2_slideshow_pause_on_prev_click', $vars)) { - $value = $vars['lightbox2_slideshow_pause_on_prev_click']; - variable_set('lightbox2_slideshow_pause_on_previous_click', $value); - variable_del('lightbox2_slideshow_pause_on_prev_click'); + $variable_name = 'lightbox2_slideshow_pause_on_prev_click'; + $var = variable_get($variable_name); + if ($var) { + variable_set('lightbox2_slideshow_pause_on_previous_click', $var); + variable_del($variable_name); } return array(); } @@ -199,4 +203,3 @@ function lightbox2_update_6002() { function lightbox2_update_6003() { return array(); } - diff --git a/lightbox2.module b/lightbox2.module index ea5643e630e98870baa26e3a9d0a52512104afa4..3c276339d475850e74964e819e3cbdaff97d962e 100644 --- a/lightbox2.module +++ b/lightbox2.module @@ -875,6 +875,7 @@ function lightbox2_field_formatter_settings_form($field, $instance, $view_mode, return $form; } + /** * Implements hook_field_formatter_settings_summary(). */ @@ -888,19 +889,26 @@ function lightbox2_field_formatter_settings_summary($field, $instance, $view_mod $summary = ''; - if(isset($settings['caption']) && isset($settings['type']) && isset($settings['image_style']) && isset($settings['lightbox_style'])) { - $summary .= ''.t('Caption field') . ': ' . $fields[$settings['caption']] . '
'; - $summary .= ''.t('Display') . ': ' ; + if (!isset($image_styles[$settings['image_style']])) { + $image_styles[$settings['image_style']] = 0; + } + if (!isset($image_styles[$settings['lightbox_style']])) { + $image_styles[$settings['lightbox_style']] = 0; + } + + if (isset($settings['caption']) && isset($settings['type']) && isset($settings['image_style']) && isset($settings['lightbox_style'])) { + $summary .= '' . t('Caption field') . ': ' . $fields[$settings['caption']] . '
'; + $summary .= '' . t('Display') . ': '; $summary .= $types[$settings['type']]; $summary .= ': '; $summary .= $image_styles[$settings['image_style']]; $summary .= ' => '; $summary .= $image_styles[$settings['lightbox_style']]; - } else { + } + else { $summary = 'Title - Lightbox: original => original'; } - return $summary; }