You are here

function js_injector_edit_save in JS injector 6.2

Same name and namespace in other branches
  1. 6 js_injector.admin.inc \js_injector_edit_save()
  2. 7 js_injector.admin.inc \js_injector_edit_save()

Submit button callback for the js rule edit form.

1 call to js_injector_edit_save()
js_injector_edit_save_and_continue in ./js_injector.admin.inc
Save and continue callback for the CSS rule edit form.
1 string reference to 'js_injector_edit_save'
js_injector_edit in ./js_injector.admin.inc
Constructor for the js rule edit form.

File

./js_injector.admin.inc, line 234
Administration pages for js_injector.

Code

function js_injector_edit_save($form, &$form_state) {
  $rule = $form_state['rule'];
  drupal_write_record('js_injector_rule', $rule, empty($rule['crid']) ? NULL : 'crid');
  file_save_data($rule['js_text'], file_create_path(_js_injector_rule_path($rule['crid'])), FILE_EXISTS_REPLACE);
  _js_injector_load_rule(NULL, TRUE);
  drupal_set_message('Your js injection rule was saved.');
  $form_state['redirect'] = 'admin/settings/js_injector';
}