You are here

function cpn_delete_file in Code per Node 7

Same name and namespace in other branches
  1. 6 cpn.module \cpn_delete_file()

Deletes CSS & JavaScript from the file system (but only if it exists).

5 calls to cpn_delete_file()
cpn_block_submit in ./cpn.module
Block submit callback.
cpn_node_delete in ./cpn.module
Implements hook_node_delete().
cpn_node_type_submit in ./cpn.module
Node type submit callback.
cpn_node_update in ./cpn.module
Implements hook_node_update().
cpn_settings_submit in ./cpn.admin.inc
Settings form - submit callback.

File

./cpn.module, line 778
Primary hook implementations.

Code

function cpn_delete_file($filename) {
  $path = variable_get('cpn_path', 'public://cpn') . '/' . $filename;
  if (file_exists($path)) {
    return file_unmanaged_delete($path);
  }
  return FALSE;
}