function responsive_menus_mlpm_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_mlpm_style_settings'
File
- ./
responsive_menus.module, line 920 - Responsify menus in Drupal.
Code
function responsive_menus_mlpm_style_settings() {
$form['responsive_menus_mlpm_css_selectors'] = array(
'#type' => 'textfield',
'#title' => t('CSS selectors for which menu to responsify'),
'#default_value' => variable_get('responsive_menus_mlpm_css_selectors', '#main-menu'),
'#description' => t('Enter CSS/jQuery selector of menus to responsify.'),
);
$form['responsive_menus_mlpm_media_size'] = array(
'#type' => 'textfield',
'#title' => t('Screen width to respond to'),
'#size' => 5,
'#default_value' => variable_get('responsive_menus_mlpm_media_size', 768),
'#description' => t('Width in pixels when we swap out responsive menu e.g. 768 (0 means the responsive menu will always show)'),
);
$form['responsive_menus_mlpm_move_to'] = array(
'#type' => 'textfield',
'#title' => t('CSS selector to move menu to'),
'#default_value' => variable_get('responsive_menus_mlpm_move_to', '#page-wrapper'),
'#description' => t('Enter a CSS/JQuery selector of the container the nav menu will be moved to. This is useful when using a theme you don\'t want to alter.'),
);
$form['responsive_menus_mlpm_nav_block'] = array(
'#type' => 'select',
'#title' => t('Add nav block?'),
'#options' => array(
1 => t('Yes'),
0 => t('No'),
),
'#default_value' => variable_get('responsive_menus_mlpm_nav_block', 1),
'#description' => t('MLPM requires a nav block to be in place. This can be added using javascript if you don\'t want to alter your theme.'),
);
$form['responsive_menus_mlpm_nav_block_name'] = array(
'#type' => 'textfield',
'#title' => t('Id for nav block'),
'#default_value' => variable_get('responsive_menus_mlpm_nav_block_name', 'mlpm-menu'),
'#description' => t('Enter the id of nav block.'),
);
$form['responsive_menus_mlpm_push'] = array(
'#type' => 'textarea',
'#title' => t('CSS selectors of containers to push'),
'#default_value' => variable_get('responsive_menus_mlpm_push', '#page'),
'#description' => t('CSS/jQuery selectors of the elements that need to be pushed when expading the MLPM (one per line)'),
);
$form['responsive_menus_mlpm_menu_height'] = array(
'#type' => 'textfield',
'#title' => 'Menu height',
'#description' => "Menu height (integer, '%', 'px', 'em').",
'#default_value' => variable_get('responsive_menus_mlpm_menu_height', '100%'),
);
$form['responsive_menus_mlpm_direction'] = array(
'#type' => 'select',
'#title' => t('Sliding direction'),
'#options' => array(
'ltr' => t('Left to right'),
'rtl' => t('Right to left'),
),
'#description' => '',
'#default_value' => variable_get('responsive_menus_mlpm_direction', 'ltr'),
);
$form['responsive_menus_mlpm_mode'] = array(
'#type' => 'select',
'#title' => t('Menu sliding mode'),
'#options' => array(
'overlap' => t('Overlap'),
'cover' => t('Cover'),
),
'#description' => '',
'#default_value' => variable_get('responsive_menus_mlpm_mode', 'overlap'),
);
$form['responsive_menus_mlpm_collapsed'] = array(
'#type' => 'select',
'#title' => t('How to load the menu'),
'#options' => array(
1 => t('Collapsed'),
0 => t('Expanded'),
),
'#description' => 'Initialize menu in collapsed/expanded mode',
'#default_value' => variable_get('responsive_menus_mlpm_collapsed', 1),
);
$form['responsive_menus_mlpm_full_collapse'] = array(
'#type' => 'select',
'#title' => t('Full collapse'),
'#options' => array(
1 => t('Yes'),
0 => t('No'),
),
'#description' => 'Do you want to fully hide base level holder when collapsed?',
'#default_value' => variable_get('responsive_menus_mlpm_full_collapse', 0),
);
$form['responsive_menus_mlpm_swipe'] = array(
'#type' => 'select',
'#title' => t('Swipe mode'),
'#options' => array(
'both' => t('Both'),
'desktop' => t('Desktop'),
'touchscreen' => t('Touchscreen'),
),
'#description' => '',
'#default_value' => variable_get('responsive_menus_mlpm_swipe', 'both'),
);
$form['responsive_menus_mlpm_decoration'] = array(
'#type' => 'fieldset',
'#title' => t('Menu decoration'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$style = variable_get('responsive_menus_mlpm_decoration', array());
$form['responsive_menus_mlpm_decoration']['font_awesome'] = array(
'#type' => 'checkbox',
'#title' => t('Include font awesome'),
'#description' => t('By default font awesome is used for the menu icons'),
'#default_value' => 1,
);
$form['responsive_menus_mlpm_decoration']['google_fonts'] = array(
'#type' => 'checkbox',
'#title' => t('Include google fonts'),
'#description' => t('By default google fonts are used to style this menu.'),
'#default_value' => 1,
);
$form['responsive_menus_mlpm_decoration']['back_text'] = array(
'#type' => 'textfield',
'#title' => t('Back text'),
'#description' => t('The text that will appear on the back links leading you to previous levels of the menu.'),
'#default_value' => isset($style['back_text']) ? $style['back_text'] : 'Back',
);
$form['responsive_menus_mlpm_decoration']['back_class'] = array(
'#type' => 'textfield',
'#title' => t('Back item class'),
'#description' => t('The class of the back link that leads to the pervious levels of the menu.'),
'#default_value' => isset($style['back_class']) ? $style['back_class'] : 'backItemClass',
);
$form['responsive_menus_mlpm_decoration']['back_icon'] = array(
'#type' => 'textfield',
'#title' => t('Back item icon'),
'#description' => t('The icon used for the back link that leads to previous levels of the menu (default requires font awesome).'),
'#default_value' => isset($style['back_icon']) ? $style['back_icon'] : 'fa fa-angle-right',
);
$form['responsive_menus_mlpm_decoration']['group_icon'] = array(
'#type' => 'textfield',
'#title' => t('Group icon'),
'#description' => t('The icon used on menu links that lead into new layers of the menu (default requires font awesome).'),
'#default_value' => isset($style['group_icon']) ? $style['group_icon'] : 'fa fa-angle-left',
);
$form['responsive_menus_mlpm_toggle'] = array(
'#type' => 'fieldset',
'#title' => t('Toggle control'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$toggle = variable_get('responsive_menus_mlpm_toggle', array());
$form['responsive_menus_mlpm_toggle']['container'] = array(
'#type' => 'textfield',
'#title' => t('Menu toggle control container'),
'#description' => t('The CSS/jQuery selector you would like an anchor tag that will toggle the menu open and closed (leave blank for no control).'),
'#default_value' => isset($toggle['container']) ? $toggle['container'] : '',
);
$form['responsive_menus_mlpm_toggle']['text'] = array(
'#type' => 'textarea',
'#title' => t('Menu toggle control text'),
'#description' => t('The text/filtered html you would like inside the toggle control'),
'#default_value' => isset($toggle['text']) ? $toggle['text'] : '',
);
$form['responsive_menus_mlpm_toggle']['off_menu'] = array(
'#type' => 'textfield',
'#title' => t('Container to detect off menu clicks'),
'#description' => t('The CSS/jQuery selector that will close the menu when clicked. This is useful for when you want to be able to close the menu by clicking off of the menu.'),
'#default_value' => isset($toggle['off_menu']) ? $toggle['off_menu'] : '',
);
return $form;
}