123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- <?php
- /**
- * @file
- * Functions pertaining to the install/uninstall of this module
- */
- /**
- * Disable default views when module is disabled
- */
- function tripal_organism_disable() {
- // Disable all default views provided by this module
- require_once("tripal_organism.views_default.inc");
- $views = tripal_organism_views_default_views();
- foreach (array_keys($views) as $view_name) {
- tripal_views_admin_disable_view($view_name,FALSE,array('suppress_error' => TRUE));
- }
- }
- /**
- * Implementation of hook_install().
- *
- * @ingroup tripal_organism
- */
- function tripal_organism_install() {
- // create the module's data directory
- tripal_create_files_dir('tripal_organism');
- // create the directory where image files will be stored. We create this
- tripal_create_files_dir('tripal_organism', '/images');
- // cvs & cvterms
- tripal_organism_add_cvs();
- tripal_organism_add_cvterms();
- }
- /**
- * Implementation of hook_schema().
- *
- * @ingroup tripal_organism
- */
- function tripal_organism_schema() {
- $schema['chado_organism'] = array(
- 'fields' => array(
- 'vid' => array(
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'default' => 0
- ),
- 'nid' => array(
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'default' => 0
- ),
- 'organism_id' => array(
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0
- )
- ),
- 'indexes' => array(
- 'organism_id' => array('organism_id')
- ),
- 'unique keys' => array(
- 'nid_vid' => array('nid', 'vid'),
- 'vid' => array('vid')
- ),
- 'primary key' => array('nid'),
- );
- return $schema;
- }
- /**
- * Implementation of hook_uninstall().
- *
- * @ingroup tripal_organism
- */
- function tripal_organism_uninstall() {
- }
- /**
- * Implementation of hook_requirements().
- *
- */
- function tripal_organism_requirements($phase) {
- $requirements = array();
- if ($phase == 'install') {
- // make sure chado is installed
- if (!$GLOBALS["chado_is_installed"]) {
- $requirements ['tripal_organism'] = array(
- 'title' => "tripal_organism",
- 'value' => "ERROR: Chado must be installed before this module can be enabled",
- 'severity' => REQUIREMENT_ERROR,
- );
- }
- }
- return $requirements;
- }
- /**
- *
- */
- function tripal_organism_add_cvs() {
- tripal_cv_add_cv('organism_property', 'Contains properties for organisms');
- }
- /**
- *
- */
- function tripal_organism_add_cvterms() {
- }
- /**
- * This is the required update for tripal_organism when upgrading from Drupal core API 6.x.
- */
- function tripal_organism_update_7000() {
- tripal_organism_add_cvs();
- tripal_organism_add_cvterms();
- }
|