You are here

function beautytips_admin in BeautyTips 6

Same name and namespace in other branches
  1. 6.2 beautytips.admin.inc \beautytips_admin()
  2. 7.2 beautytips.admin.inc \beautytips_admin()

Beautytips administration page

1 string reference to 'beautytips_admin'
beautytips_menu in ./beautytips.module
Implementation of hook_menu.

File

./beautytips.module, line 12
Provides API for adding beautytips to pages. Adds Beautytips settings page and provides some built in functionality.

Code

function beautytips_admin() {
  $form['beautytips_text'] = array(
    '#type' => 'fieldset',
    '#title' => 'Text Input Tooltips',
  );
  $form['beautytips_text']['beautytips_text_input'] = array(
    '#type' => 'checkbox',
    '#title' => 'Display Text input popups',
    '#default_value' => variable_get('beautytips_text_input', FALSE),
  );
  $form['beautytips_text']['beautytips_position'] = array(
    '#type' => 'radios',
    '#title' => 'Which side should the text popups appear on?',
    '#options' => array(
      'bottom' => t('bottom'),
      'top' => t('top'),
      'left' => t('left'),
      'right' => t('right'),
    ),
    '#default_value' => variable_get('beautytips_position', 'bottom'),
  );
  $form['beautytips_text']['form_id'] = array(
    '#type' => 'fieldset',
    '#title' => 'Restrict text popups to specific forms. (OPTIONAL)',
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['beautytips_text']['form_id']['beautytips_form_id'] = array(
    '#type' => 'textfield',
    '#title' => 'Enter the form id(s) to use for text popup beautytips',
    '#description' => t('You need to use Drupal php syntax like page_node_form'),
    '#default_value' => variable_get('beautytips_form_id', ''),
  );
  $form['beautytips_text']['form_id']['beautytips_show_form'] = array(
    '#type' => 'checkbox',
    '#title' => 'Display form_ids',
    '#description' => t("Turn this on if you want to see the names of the form ids to enter above.  The names will appear on the pages where the forms are displayed.") . '<div>' . t("Make sure that you turn it off when you're done retrieving the form_ids.") . '</div>',
    '#default_value' => variable_get('beautytips_show_form', FALSE),
  );
  $form['beautytips_help'] = array(
    '#type' => 'fieldset',
    '#title' => 'Help Link Tooltips',
  );
  $form['beautytips_help']['beautytips_drupal_help'] = array(
    '#type' => 'checkbox',
    '#title' => 'Display Help link popups',
    '#description' => t('Add popups for Drupal help links as well as advanced help links.'),
    '#default_value' => variable_get('beautytips_drupal_help', FALSE),
  );
  $form['beautytips_styles'] = array(
    '#type' => 'radios',
    '#title' => 'Choose a style',
    '#description' => 'Mouse over the radio buttons to see a preview.',
    '#options' => array(
      'default' => t('default'),
      'netflix' => t('Netflix'),
      'facebook' => t('Facebook'),
      'transparent' => t('Transparent with Big Text'),
      'big_green' => t('Green with no border'),
      'google_maps' => t('Google Maps'),
    ),
    '#default_value' => variable_get('beautytips_styles', 'default'),
  );
  $form['#submit'][] = 'beautytips_admin_submit';
  $path = drupal_get_path('module', 'beautytips') . '/js/bt_admin_page.js';
  drupal_add_js($path);
  beautytips_add_beautytips();
  return system_settings_form($form);
}