function css_injector_edit_save in CSS Injector 7.2
Same name and namespace in other branches
- 6 css_injector.admin.inc \css_injector_edit_save()
- 7 css_injector.admin.inc \css_injector_edit_save()
Submit button callback for the CSS rule edit form.
1 call to css_injector_edit_save()
- css_injector_edit_save_and_continue in ./
css_injector.admin.inc - Save and continue callback for the CSS rule edit form.
1 string reference to 'css_injector_edit_save'
- css_injector_edit in ./
css_injector.admin.inc - Form builder function for the CSS rule edit form.
File
- ./
css_injector.admin.inc, line 220 - css_injector.admin.inc Administrative interface for CSS Injector.
Code
function css_injector_edit_save($form, &$form_state) {
$rule = $form_state['values'];
$crid = !empty($form_state['values']['crid']) ? $form_state['values']['crid'] : NULL;
drupal_write_record('css_injector_rule', $rule, empty($crid) ? array() : 'crid');
$form_state['values']['rule'] = $rule;
file_unmanaged_save_data($rule['css_text'], _css_injector_rule_uri($rule['crid']), FILE_EXISTS_REPLACE);
_css_injector_load_rule(NULL, TRUE);
drupal_set_message(t('Your CSS injection rule %title was saved.', array(
'%title' => $rule['title'],
)));
$form_state['redirect'] = 'admin/config/development/css-injector';
}