function word_link_admin_settings_submit in Word Link 8
Same name and namespace in other branches
- 7 word_link.admin.inc \word_link_admin_settings_submit()
Submit form for a settings page.
File
- ./
word_link.admin.inc, line 102 - Administrative pages for the Word Link module.
Code
function word_link_admin_settings_submit($form, &$form_state) {
$types = $form_state['values']['word_link_settings']['word_link_node_types'];
foreach ($form_state['values']['word_link_settings']['word_link_node_types'] as $content => $type) {
$fields = array();
foreach ($type['fields'] as $field) {
if (preg_match('/.+__.+/', $field) != 0) {
$fc = explode('__', $field);
$fields[$fc[0]][$fc[1]] = $fc[1];
}
else {
$fields[$field] = $field;
}
}
$types[$content]['fields'] = $fields;
}
variable_set('word_link_limit', $form_state['values']['word_link_settings']['word_link_limit']);
variable_set('word_link_tags_except', $form_state['values']['word_link_settings']['word_link_tags_except']);
variable_set('word_link_node_types', $types);
variable_set('word_link_css', $form_state['values']['word_link_settings']['word_link_css']);
drupal_set_message(t('Saved'));
}