12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- //$Id:
- /*******************************************************************************
- * Implementation of hook_install().
- */
- function tripal_analysis_interpro_install() {
- // create the module's data directory
- tripal_create_moddir('tripal_analysis_interpro');
- // We need to register to tripal_analysis module so it can provide a control
- // for our interpro result. Basically the registration is done by inserting
- // modulename into the drupal {tripal_analysis} table AND inserting required
- // information to the chado Analysis table. Also in tripal_analysis_interpro.module,
- // we need to define HOOK_get_settings() for the module to work properly.
-
- // Inert into drupal's {tripal_analysis}
- tripal_analysis_register_child('tripal_analysis_interpro');
-
- // Add cvterm 'analysis_interpro_output_iteration_hits' for inserting into featureprop table
- tripal_add_cvterms('analysis_interpro_output_hit', 'Hit in the interpro html '.
- 'output. Each hit belongs to a chado feature. This cvterm represents a hit in the output');
- // Add cvterm 'analysis_interpro_settings' for inserting into analysisprop table
- tripal_add_cvterms('analysis_interpro_settings', 'Settings of an interpro analysis, '.
- 'including output file and run parameters separated by a bar |');
- }
- /*******************************************************************************
- * Implementation of hook_uninstall().
- */
- function tripal_analysis_interpro_uninstall() {
-
- // Delete all information associate with the module
- // Drupal complains when the user tries to uninstall tripal_analysis
- // and tripal_analysis_interpro at the same time. This is because Drupal drops
- // the {tripal_analysis} table before we can delete anything from it. Thus,
- // we perform a db_table_exists() check before the deletion
-
- //Delete the settings from {tripal_analysis} table
- tripal_analysis_unregister_child('tripal_analysis_interpro');
-
- // Delete module's variables from variables table.
- db_query("DELETE FROM {variable} WHERE name='%s'",
- 'tripal_analysis_interpro_setting');
- }
- /*******************************************************************************
- * Implementation of hook_requirements(). Make sure 'Tripal Core' and 'Tripal
- * Analysis' are enabled before installation
- */
- function tripal_analysis_interpro_requirements($phase) {
- $requirements = array();
- if ($phase == 'install') {
- if (!function_exists('tripal_create_moddir') || !function_exists('tripal_analysis_register_child')) {
- $requirements ['tripal_analysis_interpro'] = array(
- 'title' => "tripal_analysis_interpro",
- 'value' => "error. Some required modules are just being installed. Please try again.",
- 'severity' => REQUIREMENT_ERROR,
- );
- }
- }
- return $requirements;
- }
|