|
@@ -17,6 +17,34 @@ function blast_ui_install() {
|
|
|
tripal_create_files_dir('tripal_blast');
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * Implements hook_uninstall().
|
|
|
+ */
|
|
|
+function blast_ui_uninstall() {
|
|
|
+ // Remove all nodes of type blastdb
|
|
|
+
|
|
|
+ $query = new EntityFieldQuery();
|
|
|
+ $query->entityCondition('entity_type', 'node')
|
|
|
+ // Restrict to BLASTDB nodes.
|
|
|
+ ->entityCondition('bundle', 'blastdb')
|
|
|
+ // Restrict to Published nodes.
|
|
|
+ ->propertyCondition('status', 1)
|
|
|
+ // Restrict to nodes the current user has permission to view.
|
|
|
+ ->addTag('node_access');
|
|
|
+ $entities = $query->execute();
|
|
|
+
|
|
|
+ // Get all BlastDB nodes and delete them
|
|
|
+ $nodes = node_load_multiple(array_keys($entities['node']));
|
|
|
+ foreach ($nodes as $node) {
|
|
|
+ print "Delete node " . $node->title . "\n";
|
|
|
+ $nrs = node_revision_list($node);
|
|
|
+ foreach ($nrs as $nr) {
|
|
|
+ node_revision_delete($nr->vid);
|
|
|
+ }
|
|
|
+ node_delete($node->nid);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* Implements hook_schema().
|
|
|
* Create the blastdb database table for storing addditional info related to blastdb nodes.
|
|
@@ -24,7 +52,7 @@ function blast_ui_install() {
|
|
|
* NOTE: This hook is called via Drupal magic during the installation process and no longer
|
|
|
* needs to be called explicitly in hook_install().
|
|
|
*/
|
|
|
-function blast_ui_schema(){
|
|
|
+function blast_ui_schema() {
|
|
|
// A table to keep extra information related to blastdb nodes.
|
|
|
$schema['blastdb'] = array(
|
|
|
'description' => t('The base table for blastdb node'),
|