You are here

function lightbox2_iframe_settings_form in Lightbox2 7

Same name and namespace in other branches
  1. 8 lightbox2.admin.inc \lightbox2_iframe_settings_form()
  2. 5.2 lightbox2.module \lightbox2_iframe_settings_form()
  3. 6 lightbox2.admin.inc \lightbox2_iframe_settings_form()
  4. 7.2 lightbox2.admin.inc \lightbox2_iframe_settings_form()

Configuration form for controlling the iframe behaviour.

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

File

./lightbox2.admin.inc, line 661
Administrative page callbacks for the lightbox2 module.

Code

function lightbox2_iframe_settings_form() {

  // Add the javascript which disables / enables form elements.
  drupal_add_js(drupal_get_path('module', 'lightbox2') . '/js/lightbox2.js', 'module');

  // Set up a hidden variable.
  $form['lightbox2_lite'] = array(
    '#type' => 'hidden',
    '#value' => variable_get('lightbox2_lite', FALSE),
  );

  // Add text box for iframe width.
  $form['lightbox2_default_frame_width'] = array(
    '#type' => 'textfield',
    '#title' => t('Default width'),
    '#description' => t('The default width of the iframe in pixels.'),
    '#default_value' => variable_get('lightbox2_default_frame_width', 600),
    '#size' => 20,
  );

  // Add text box for iframe height.
  $form['lightbox2_default_frame_height'] = array(
    '#type' => 'textfield',
    '#title' => t('Default height'),
    '#description' => t('The default height of the iframe in pixels.'),
    '#default_value' => variable_get('lightbox2_default_frame_height', 400),
    '#size' => 20,
  );

  // Add option for iframe border.
  $form['lightbox2_frame_border'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable border'),
    '#description' => t('Enable iframe border.  You can modify the border style in your theme\'s css file using the iframe\'s id "lightboxFrame".'),
    '#default_value' => variable_get('lightbox2_frame_border', 1),
  );
  return system_settings_form($form);
}