You are here

function biblio_batch_uninstall_finished in Bibliography Module 7

Same name and namespace in other branches
  1. 6.2 biblio.install \biblio_batch_uninstall_finished()
1 string reference to 'biblio_batch_uninstall_finished'
biblio_uninstall in ./biblio.install

File

./biblio.install, line 177

Code

function biblio_batch_uninstall_finished($success, $results, $operations) {
  if ($success) {

    // @todo taxonomy.

    /*
        if (module_exists('taxonomy')) {
        $voc = taxonomy_get_vocabularies();
        foreach ($voc as $vid => $vocabulary) {
        if ($vocabulary->module == 'biblio')  taxonomy_del_vocabulary($vid);
        }
        }
    */
    $vars = db_query("SELECT * FROM {variable} WHERE name LIKE 'biblio_%'");
    foreach ($vars as $var) {
      variable_del($var->name);
    }

    // Remove Biblio Node fields.
    $field_instances = field_info_instances('node', 'biblio');
    foreach ($field_instances as $instance) {
      field_delete_instance($instance);
    }

    // Remove Biblio Comment fields.
    $field_instances = field_info_instances('comment', 'comment_node_biblio');
    foreach ($field_instances as $instance) {
      field_delete_instance($instance);
    }
  }
}