123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- <?php
- function tripal_project_disable() {
-
- 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));
- }
- }
- function tripal_project_requirements($phase) {
- $requirements = array();
- if ($phase == 'install') {
-
- 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;
- }
- function tripal_project_install() {
- tripal_project_add_cvs();
- tripal_project_add_cvterms();
-
- tripal_set_default_cv('projectprop', 'type_id', 'project_property');
- tripal_set_default_cv('project_relationship', 'type_id', 'project_relationship');
- }
- function tripal_project_uninstall() {
- }
- 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;
- }
- function tripal_project_add_cvs() {
-
- tripal_insert_cv(
- 'project_property',
- 'Contains properties for projects'
- );
-
- tripal_insert_cv(
- 'project_relationship',
- 'Contains Types of relationships between projects.'
- );
- }
- function tripal_project_add_cvterms() {
-
-
-
- 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)
- );
- }
|