function lang_dropdown_hideout_submit in Language Switcher Dropdown 7.2
Implements hook_block_save().
1 string reference to 'lang_dropdown_hideout_submit'
- lang_dropdown_hideout_form_block_admin_configure_alter in lang_dropdown_hideout/
lang_dropdown_hideout.module - Implements hook_form_alter().
File
- lang_dropdown_hideout/
lang_dropdown_hideout.module, line 77 - LSD Hideout main module file.
Code
function lang_dropdown_hideout_submit($form, &$form_state) {
$lang_dropdown_hideout_settings = array(
'hidden_languages' => array(),
);
foreach ($form_state['values']['lang_dropdown']['hideout']['role_names'] as $rid => $name) {
$lang_dropdown_hideout_settings['hidden_languages'][$rid] = array_filter($form_state['values']['lang_dropdown']['hideout']['languages']['checkboxes'][$rid]);
}
// Clear the cached pages and blocks.
cache_clear_all();
// Notice that both language dropdown and locale switchers share same
// configuration for same type, ex both the language dropdown switcher
// (content) and locale switcher (content) share this config.
variable_set('lang_dropdown_hideout_' . $form['delta']['#value'], $lang_dropdown_hideout_settings);
}