You are here

function cpn_uninstall in Code per Node 7

Same name and namespace in other branches
  1. 6 cpn.install \cpn_uninstall()

Implements hook_uninstall().

File

./cpn.install, line 210
Installation, schema and update hook implementations.

Code

function cpn_uninstall() {

  // If block table exists, drop CPN fields.
  if (db_table_exists('block')) {
    cpn_unalter_block();
  }

  // Delete CSS & JS files.
  file_unmanaged_delete_recursive(variable_get('cpn_path', 'public://cpn'));

  // Delete variables.
  $node_types = array_keys(node_type_get_types());
  foreach (array(
    'css',
    'js',
  ) as $type) {
    variable_del('cpn_aggregation_' . $type);
    variable_del('cpn_external_' . $type);
    variable_del('cpn_global_' . $type);
    variable_del('cpn_global_' . $type . '_admin');
    variable_del('cpn_global_' . $type . '_agree');
    variable_del('cpn_weight_' . $type);
    variable_del('cpn_wrapper_block_' . $type);
    variable_del('cpn_wrapper_node_' . $type);
    foreach ($node_types as $node_type) {
      variable_del('cpn_' . $type . '_' . $node_type);
      variable_del('cpn_' . $type . '_enabled_' . $node_type);
      variable_del('cpn_view_modes_node_' . $node_type);
    }
  }
  variable_del('cpn_codemirror_version');
  variable_del('cpn_path');
  variable_del('cpn_syntax_highlighting');
}