You are here

function _js_injector_delete_rule in JS injector 6.2

Same name and namespace in other branches
  1. 6 js_injector.module \_js_injector_delete_rule()
  2. 7 js_injector.module \_js_injector_delete_rule()

Helper function to delete an existing rule and its accompanying file.

1 call to _js_injector_delete_rule()
js_injector_delete_confirm_submit in ./js_injector.admin.inc
Execute node deletion.

File

./js_injector.module, line 150
Allows administrators to inject js into the page output based on configurable rules. Useful for adding simple js tweaks without modifying a site's official theme.

Code

function _js_injector_delete_rule($crid) {
  if ($rule = _js_injector_load_rule($crid)) {
    file_delete(file_create_path(_js_injector_rule_path($crid)));
    db_query("DELETE FROM {js_injector_rule} WHERE crid = %d", $crid);
  }
}