You are here

function popups_admin_settings in Popups API (Ajax Dialogs) 6.2

Same name and namespace in other branches
  1. 5 popups.module \popups_admin_settings()
  2. 6 popups.module \popups_admin_settings()
  3. 7 popups.module \popups_admin_settings()

Form for the Popups Settings page.

1 string reference to 'popups_admin_settings'
popups_menu in ./popups.module
Implementation of hook_menu().

File

./popups.module, line 412
This module provides a hook_popups for links to be opened in an Ajax Popup Modal Dialog.

Code

function popups_admin_settings() {
  popups_add_popups();
  drupal_set_title("Popups Settings");
  $form = array();
  $form['popups_always_scan'] = array(
    '#type' => 'checkbox',
    '#title' => t('Scan all pages for popup links.'),
    '#default_value' => variable_get('popups_always_scan', 0),
  );
  $form['popups_autoclose_final_message'] = array(
    '#type' => 'checkbox',
    '#title' => t('Automatically close final confirmation messages.'),
    '#default_value' => variable_get('popups_autoclose_final_message', 1),
  );

  // Retrieve all available skins, forcing the registry to refresh.
  $skins['Unskinned'] = array();
  $skins += popups_skins(TRUE);
  $skin_options = drupal_map_assoc(array_keys($skins));
  $form['popups_skins'] = array(
    '#type' => 'fieldset',
    '#title' => t('Skins'),
    '#description' => t('Choose a skin from the list. After you save, click !here to test it out.', array(
      '!here' => l('here', 'user', array(
        'attributes' => array(
          'class' => 'popups',
        ),
      )),
    )),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form['popups_skins']['popups_skin'] = array(
    '#type' => 'radios',
    '#title' => t('Available skins'),
    '#default_value' => variable_get('popups_skin', 'Basic'),
    '#options' => $skin_options,
  );
  return system_settings_form($form);
}