You are here

function menu_target_menu_configure_extra_elements in Menu target 7

Same name and namespace in other branches
  1. 8 menu_target.admin.inc \menu_target_menu_configure_extra_elements()

Allows users to enable or disable the Menu target functionality on menu base.

See also

menu_target_form_menu_configure_alter()

1 call to menu_target_menu_configure_extra_elements()
menu_target_form_menu_configure_alter in ./menu_target.module
Implements hook_form_FORM_ID_alter().

File

./menu_target.admin.inc, line 66
Allows content editors to choose wether or not to open menu items in a new window

Code

function menu_target_menu_configure_extra_elements(&$form) {
  $form['menu_target'] = array(
    '#type' => 'fieldset',
    '#title' => t('Menu target'),
  );
  $form['menu_target']['menu_target_enabled'] = array(
    '#type' => 'checkbox',
    '#title' => t('Menu target enabled'),
    '#default_value' => variable_get('menu_target_enabled', 1),
  );
  $form['menu_target']['menu_target_settings'] = array(
    '#type' => 'container',
    '#states' => array(
      'invisible' => array(
        'input[name="menu_target_enabled"]' => array(
          'checked' => FALSE,
        ),
      ),
    ),
  );
  $form['menu_target']['menu_target_settings']['menu_target_type'] = array(
    '#type' => 'radios',
    '#title' => t('Type'),
    '#options' => array(
      'html' => t('Degradable'),
      'javascript' => t('XHTML Valid'),
    ),
    '#default_value' => variable_get('menu_target_type', 'html'),
    '#description' => t("Here you can choose which behavior is used to open links in new windows. If you choose 'Degradable', the HTML !link1 attribute will be used. Since this attribute does not validate for XHTML doctypes since version 1.1, you can also choose to use the 'XHTML valid' option. This will use JavaScript to open links in a new window", array(
      '!link1' => l(t('target'), 'http://www.w3.org/TR/html4/present/frames.html#adef-target'),
    )),
  );
  $form['#submit'][] = '_menu_target_menu_configure_extra_elements_submit';
}