You are here

function responsive_menus_sidr_style_settings in Responsive Menus 7

Form callback from hook_responsive_menus_style_info().

Return value

array Drupal FAPI formatted array.

1 string reference to 'responsive_menus_sidr_style_settings'
responsive_menus_responsive_menus_style_info in ./responsive_menus.module
Implements hook_responsive_menus_style_info().

File

./responsive_menus.module, line 747
Responsify menus in Drupal.

Code

function responsive_menus_sidr_style_settings() {
  $form['responsive_menus_sidr_css_selectors'] = array(
    '#type' => 'textarea',
    '#title' => t('CSS selectors for which menu to responsify'),
    '#default_value' => variable_get('responsive_menus_sidr_css_selectors', '#main-menu'),
    '#description' => t('Enter CSS/jQuery selectors of menus to responsify.  Comma separated or 1 per line'),
  );
  $form['responsive_menus_sidr_trigger_txt'] = array(
    '#type' => 'textarea',
    '#title' => t('Text or HTML for trigger button'),
    '#default_value' => variable_get('responsive_menus_sidr_trigger_txt', t('Menu')),
  );
  $form['responsive_menus_sidr_menu_side'] = array(
    '#type' => 'select',
    '#title' => t('Position of the menu (left/right)'),
    '#options' => array(
      'left' => t('Left'),
      'right' => t('Right'),
    ),
    '#default_value' => variable_get('responsive_menus_sidr_menu_side', array(
      'left' => 'Left',
    )),
  );
  $form['responsive_menus_sidr_menu_theme'] = array(
    '#type' => 'select',
    '#title' => t('Theme'),
    '#options' => array(
      'dark' => t('Dark'),
      'light' => t('Light'),
      'custom' => t('Custom'),
    ),
    '#default_value' => variable_get('responsive_menus_sidr_menu_theme', 'dark'),
    '#description' => t('Select which <a href="@theme">theme</a> will be used to style the menu. If "Custom" is selected, no CSS will be added; you will need to add your own styles.', array(
      '@theme' => 'http://www.berriart.com/sidr/#themes',
    )),
  );
  $form['responsive_menus_sidr_animation_speed'] = array(
    '#type' => 'textfield',
    '#title' => t('Sidr animation speed'),
    '#size' => 5,
    '#default_value' => variable_get('responsive_menus_sidr_animation_speed', 200),
    '#description' => t('Speed (in milliseconds) of menu open/close. 1000 = 1 second.'),
  );
  $form['responsive_menus_sidr_media_size'] = array(
    '#type' => 'textfield',
    '#title' => t('Screen width to respond to'),
    '#size' => 5,
    '#default_value' => variable_get('responsive_menus_sidr_media_size', 768),
    '#description' => t('Width in pixels when we swap out responsive menu e.g. 768'),
  );
  $form['responsive_menus_sidr_displace'] = array(
    '#type' => 'select',
    '#title' => t('Displace body content?'),
    '#options' => array(
      1 => t('Yes'),
      0 => t('No'),
    ),
    '#default_value' => variable_get('responsive_menus_sidr_displace', 1),
    '#description' => t('This setting controls whether the page is pushed when menu is opened.'),
  );
  $form['responsive_menus_sidr_renaming'] = array(
    '#type' => 'select',
    '#title' => t('Rename classes'),
    '#options' => array(
      1 => t('Yes'),
      0 => t('No'),
    ),
    '#default_value' => variable_get('responsive_menus_sidr_renaming', 1),
    '#description' => t('Controls whether Sidr will rename classes within the the selectors specified.'),
  );
  $form['responsive_menus_sidr_on_open'] = array(
    '#type' => 'textarea',
    '#title' => t('onOpen callback (function)'),
    '#description' => t("Enter Javacript to be called when the menu is opened.  Example: alert('Great job'); See !documentation for examples.", array(
      '!documentation' => l(t('Sidr documentation'), 'http://www.berriart.com/sidr/#documentation'),
    )),
    '#default_value' => variable_get('responsive_menus_sidr_on_open', ''),
  );
  $form['responsive_menus_sidr_on_close'] = array(
    '#type' => 'textarea',
    '#title' => t('onClose callback (function)'),
    '#description' => t("Enter Javacript to be called when the menu is closed.  Example: alert('Great job'); See !documentation for examples.", array(
      '!documentation' => l(t('Sidr documentation'), 'http://www.berriart.com/sidr/#documentation'),
    )),
    '#default_value' => variable_get('responsive_menus_sidr_on_close', ''),
  );

  /*
   * Other sidr attributes not implemented:

  renaming (Boolean) Default: true
  When filling the sidr with existing content, choose to rename or not the classes and ids.

  body (String) Default: 'body' [ Version 1.1.0 an above ]
  For doing the page movement the 'body' element is animated by default, you can select another element to animate with this option.

  displace (Boolean) Default: true [ Version 1.2.0 an above ]
  Displace the body content or not.
  */
  return $form;
}