You are here

function lightbox2_settings_form in Lightbox2 5

Implementation of hook_settings()

1 string reference to 'lightbox2_settings_form'
lightbox2_menu in ./lightbox2.module
Implementation of hook_menu()

File

./lightbox2.module, line 106

Code

function lightbox2_settings_form() {

  // Define Lightbox2 Plus form.
  $form['lightbox2_plus_options'] = array(
    '#type' => 'fieldset',
    '#title' => t('Lightbox2 Plus'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );

  // Add Checkbox for Lightbox2 Plus.
  $form['lightbox2_plus_options']['lightbox2_plus'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use Lightbox2 Plus'),
    '#description' => t('Un-checking this box will enable Lightbox2 Lite.'),
    '#default_value' => variable_get('lightbox2_plus', true),
  );

  // Define Image Node Options form.
  $form['image_node_options'] = array(
    '#type' => 'fieldset',
    '#title' => t('Lightbox2 Plus Image Node options'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );

  // Add Checkbox for Image Node.
  $form['image_node_options']['lightbox2_image_node'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable for Image Nodes'),
    '#description' => t('Checking this box will enable automatic URL formatting for Image Nodes.'),
    '#default_value' => variable_get('lightbox2_image_node', true),
  );

  // Add Checkbox for Image Node Grouping.
  $form['image_node_options']['lightbox2_image_group'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable Grouping'),
    '#description' => t('Checking this box will enable automatic grouping of Image Nodes on a page. Useful for image galleries.'),
    '#default_value' => variable_get('lightbox2_image_group', true),
  );

  // Add Checkbox for disabling lightbox for gallery lists
  $form['image_node_options']['lightbox2_disable_nested_galleries'] = array(
    '#type' => 'checkbox',
    '#title' => t('Disable Lightbox for Gallery Lists'),
    '#description' => t('Checking this box will disable the lightbox for images in gallery lists, but will still use the lightbox when viewing gallery images.'),
    '#default_value' => variable_get('lightbox2_disable_nested_galleries', true),
  );

  // Add Checkbox for Gallery2 Image Filter.
  $form['image_node_options']['lightbox2G2_filter'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable Gallery 2 Filter'),
    '#description' => t('Checking this box will enable the Gallery 2 filter.'),
    '#default_value' => variable_get('lightbox2G2_filter', true),
  );

  // Add Textarea for urls without lightbox
  $form['image_node_options']['lightbox2_disable_these_urls'] = array(
    '#type' => 'textarea',
    '#title' => t('Disable LightBox for these urls'),
    '#description' => t('List the urls where the lightbox should be disabled, e.g. "node/add/page".  Put each url on a separate line. You can use the % character as a wildcard.'),
    '#default_value' => variable_get('lightbox2_disable_these_urls', ''),
  );
  return system_settings_form($form);
}