function nodesinblock_settings_save in Nodes In Block 6
Same name and namespace in other branches
- 7 nodesinblock.admin.inc \nodesinblock_settings_save()
Submit callback: save settings. We use parts of system_settings_submit here to save the variables.
1 string reference to 'nodesinblock_settings_save'
- nodesinblock_settings in ./
nodesinblock.admin.inc - Menu callback to configure general settings for nodes in block.
File
- ./
nodesinblock.admin.inc, line 150 - Administration page for nodes in block.
Code
function nodesinblock_settings_save($form, &$form_state) {
// Exclude unnecessary elements.
unset($form_state['values']['submit'], $form_state['values']['reset'], $form_state['values']['form_id'], $form_state['values']['op'], $form_state['values']['form_token'], $form_state['values']['form_build_id']);
foreach ($form_state['values'] as $key => $value) {
if (is_array($value) && isset($form_state['values']['array_filter'])) {
$value = array_keys(array_filter($value));
}
variable_set($key, $value);
}
drupal_set_message(t('The configuration options have been saved.'));
cache_clear_all();
}