You are here

function lightbox2_update_3 in Lightbox2 8

Same name and namespace in other branches
  1. 5.2 lightbox2.install \lightbox2_update_3()
  2. 6 lightbox2.install \lightbox2_update_3()
  3. 7.2 lightbox2.install \lightbox2_update_3()
  4. 7 lightbox2.install \lightbox2_update_3()

'lightbox2_disable_these_urls' was renamed to 'lightbox2_page_list'. 'lightbox2_page_init_action' was also added which determines whether the lightbox functionality should be enabled or disabled for the page list. 'lightbox2_disable_zoom' has been replaced by 'lightbox2_disable_resize'. 'lightbox2_disable_zoom' still exists but has a different meaning.

Should have been created with lightbox2_update_600x() naming convention, but too late now.

File

./lightbox2.install, line 166
Installation functions for Lightbox2.

Code

function lightbox2_update_3() {
  $disabled_urls = \Drupal::config('lightbox2.settings')
    ->get('lightbox2_disable_these_urls');
  \Drupal::configFactory()
    ->getEditable('lightbox2.settings')
    ->set('lightbox2_page_init_action', 'page_disable')
    ->save();
  \Drupal::configFactory()
    ->getEditable('lightbox2.settings')
    ->set('lightbox2_page_list', $disabled_urls)
    ->save();
  \Drupal::config('lightbox2.settings')
    ->clear('lightbox2_disable_these_urls')
    ->save();
  $disable_zoom = \Drupal::config('lightbox2.settings')
    ->get('lightbox2_disable_zoom');
  \Drupal::configFactory()
    ->getEditable('lightbox2.settings')
    ->set('lightbox2_disable_resize', $disable_zoom)
    ->save();
  \Drupal::configFactory()
    ->getEditable('lightbox2.settings')
    ->set('lightbox2_disable_zoom', FALSE)
    ->save();
  return array();
}