function jump_menu_block_settings_submit in Better Jump Menus 8
Same name and namespace in other branches
- 7 jump_menu.module \jump_menu_block_settings_submit()
Submit handler to save block-specific jump menu settings.
1 string reference to 'jump_menu_block_settings_submit'
- jump_menu_form_block_admin_configure_alter in ./
jump_menu.module - Implements hook_form_FORM_ID_alter(). Add custom options to block editing forms.
File
- ./
jump_menu.module, line 359 - Make use of the CTools jump menu and grabs from an existing menu. See: modules/ctools/includes/jump-menu.inc NOTE: Menu items must be checked as "expanded" for traversing to work.
Code
function jump_menu_block_settings_submit($form, &$form_state) {
$settings = variable_get('jump_menu_block_settings_show_current', array());
$delta = $form_state['values']['delta'];
// Clear out our block settings array if no restrictions are applied.
if ($form_state['values']['jump_menu_show_current'] == JUMP_MENU_DEFAULT_BLOCK_SETTINGS_SHOW_CURRENT) {
// $setting = variable_get('jump_menu_block_settings_show_current');
if (isset($settings[$delta])) {
unset($settings[$delta]);
}
}
else {
$settings[$delta] = $form_state['values']['jump_menu_show_current'];
}
// Save the settings.
variable_set('jump_menu_block_settings_show_current', $settings);
}