| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 | <?php/** * @file * Install the tripal project *//** * Implements hook_disable(). * Disable default views when module is disabled * * @ingroup tripal_project */function tripal_project_disable() {  // Disable all default views provided by this module  require_once("tripal_project.views_default.inc");  $views = tripal_project_views_default_views();  foreach (array_keys($views) as $view_name) {    tripal_disable_view($view_name,FALSE,array('suppress_error' => TRUE));  }}/** * Implementation of hook_requirements(). * * @ingroup tripal_project */function tripal_project_requirements($phase) {  $requirements = array();  if ($phase == 'install') {    // make sure chado is installed    if (!$GLOBALS["chado_is_installed"]) {      $requirements ['tripal_project'] = array(        'title' => "tripal_project",        'value' => "ERROR: Chado must be installed before this module can be enabled",        'severity' => REQUIREMENT_ERROR,      );    }  }  return $requirements;}/** * Implementation of hook_install(). * * @ingroup tripal_project */function tripal_project_install() {  tripal_project_add_cvs();  tripal_project_add_cvterms();  // set the default vocabularies  tripal_set_default_cv('projectprop', 'type_id', 'project_property');  tripal_set_default_cv('project_relationship', 'type_id', 'project_relationship');}/** * Implementation of hook_uninstall(). * * @ingroup tripal_project */function tripal_project_uninstall() {}/** * Implementation of hook_schema(). * * @ingroup tripal_project */function tripal_project_schema() {  $schema['chado_project'] = array(    'fields' => array(      'nid' => array(        'type' => 'int',        'unsigned' => TRUE,        'not null' => TRUE,      ),      'vid' => array(          'type' => 'int',          'not null' => TRUE,      ),      'project_id' => array(        'type' => 'int',        'unsigned' => TRUE,        'not null' => TRUE,      ),    ),    'primary key' => array('nid', 'vid', 'project_id'),  );  return $schema;}/** * Add cvs pertaining to projects * * @ingroup tripal_project */function tripal_project_add_cvs() {  // Add the cv for project properties  tripal_insert_cv(    'project_property',    'Contains properties for projects'  );  // Add cv for relationship types  tripal_insert_cv(    'project_relationship',    'Contains Types of relationships between projects.'  );}/** * Add cvterms pertaining to projects * * @ingroup tripal_project */function tripal_project_add_cvterms() {  // Insert cvterm 'Project Description' into cvterm table of chado  // database. This CV term is used to keep track of the project  // description in the projectprop table.  tripal_insert_cvterm(    array(      'name' => 'Project Description',      'definition'  => 'Description of a project',      'cv_name' => 'project_property',      'is_relationship' => 0,      'db_name' => 'tripal'    ),    array('update_existing' => TRUE)  );}
 |