You are here

function responsive_navigation_block_configure in Responsive Navigation 7

Implements hook_block_configure().

File

./responsive_navigation.module, line 75

Code

function responsive_navigation_block_configure($delta) {
  $form['responsive_navigation_name_' . $delta] = array(
    '#type' => 'textfield',
    '#title' => t('Block name'),
    '#description' => t('This name is used in the block list.'),
    '#default_value' => variable_get('responsive_navigation_name_' . $delta, 'Responsive Navigation ' . $delta),
    '#weight' => 0,
  );
  $form['menu'] = array(
    '#type' => 'fieldset',
    '#title' => t('Menu settings'),
    '#weight' => 1,
    '#collapsible' => TRUE,
  );
  $form['menu']['responsive_navigation_menu_' . $delta] = array(
    '#type' => 'select',
    '#title' => t('Menu parent'),
    '#description' => t('The menu parent from which to show a Responsive Navigation menu.'),
    '#default_value' => variable_get('responsive_navigation_menu_' . $delta, 'navigation:0'),
    '#options' => menu_parent_options(menu_get_menus(), 0),
  );
  $form['menu']['responsive_navigation_depth_' . $delta] = array(
    '#type' => 'select',
    '#title' => t('Menu depth'),
    '#description' => t('The depth of the menu, i.e. the number of child levels starting with the parent selected above. Leave set to -1 to display all children and use 0 to display no children.'),
    '#default_value' => variable_get('responsive_navigation_depth_' . $delta, -1),
    '#options' => drupal_map_assoc(range(-1, 5)),
  );
  $form['menu']['responsive_navigation_respect_expand_' . $delta] = array(
    '#type' => 'select',
    '#title' => t('Respect "Show as expanded" option'),
    '#description' => t('Menu items have a "Show as expanded" option, which is disabled by default. Since menu items do NOT have this option checked by default, you should choose Yes here once you have configured the menu items that you DO want to expand.'),
    '#options' => array(
      0 => t('No'),
      1 => t('Yes'),
    ),
    '#default_value' => variable_get('responsive_navigation_respect_expand_' . $delta, 0),
  );
  $form['responsive_navigation'] = array(
    '#type' => 'fieldset',
    '#title' => t('responsive-nav.js block settings'),
    '#description' => t('These are settings that will be passed to responsive-nav.js for this menu block.'),
    '#weight' => 2,
    '#collapsible' => TRUE,
  );
  $form['responsive_navigation']['responsive_navigation_animate_' . $delta] = array(
    '#type' => 'select',
    '#title' => t('Animate'),
    '#options' => array(
      0 => t('False'),
      1 => t('True'),
    ),
    '#description' => t('Use CSS3 transitions, true or false'),
    '#default_value' => variable_get('responsive_navigation_animate_' . $delta, 1),
    '#required' => TRUE,
  );
  $form['responsive_navigation']['responsive_navigation_transition_' . $delta] = array(
    '#type' => 'textfield',
    '#title' => t('Transition'),
    '#description' => t('Speed of the transition in milliseconds. Default: 400'),
    '#default_value' => variable_get('responsive_navigation_transition_' . $delta, 400),
    '#size' => 4,
    '#required' => TRUE,
  );
  $form['responsive_navigation']['responsive_navigation_label_' . $delta] = array(
    '#type' => 'textfield',
    '#title' => t('Label'),
    '#default_value' => variable_get('responsive_navigation_label_' . $delta, 'Menu'),
    '#description' => t('Change the default label for the responsive navigation link toggle.'),
    '#required' => TRUE,
  );
  $form['responsive_navigation']['responsive_navigation_insert_' . $delta] = array(
    '#type' => 'select',
    '#title' => t('Insert'),
    '#options' => array(
      'before' => t('Before'),
      'after' => t('After'),
    ),
    '#default_value' => variable_get('responsive_navigation_insert_' . $delta, 'before'),
    '#description' => t('Select where to insert the toggle before or after the navigation.'),
    '#required' => TRUE,
  );
  $form['responsive_navigation']['responsive_navigation_openpos_' . $delta] = array(
    '#type' => 'select',
    '#title' => t('Open Position'),
    '#options' => array(
      'relative' => t('Relative'),
      'static' => t('Static'),
    ),
    '#default_value' => variable_get('responsive_navigation_openpos_' . $delta, 'relative'),
    '#description' => t('Select the position of the opened navigation.'),
    '#required' => TRUE,
  );
  $form['responsive_navigation']['responsive_navigation_jsclass_' . $delta] = array(
    '#type' => 'textfield',
    '#title' => t('Javascript Class'),
    '#default_value' => variable_get('responsive_navigation_jsclass_' . $delta, 'js'),
    '#description' => t('The class "JS enabled" is added to the html element.'),
  );
  return $form;
}