Jelajahi Sumber

nightly check-in

Stephen Ficklin 9 tahun lalu
induk
melakukan
5e7016c179

+ 4 - 4
tripal_core/tripal_core.info

@@ -9,7 +9,7 @@ configure = admin/tripal
 stylesheets[all][] = theme/css/tripal.css
 scripts[]          = theme/js/tripal.js
 
-dependencies[]     = views
-dependencies[]     = path
-dependencies[]     = search
-dependencies[]     = php
+dependencies[] = views
+dependencies[] = path
+dependencies[] = search
+dependencies[] = php

+ 10 - 10
tripal_cv/api/tripal_cv.api.inc

@@ -226,7 +226,7 @@ function tripal_get_cvterm($identifiers, $options = array()) {
     $property = $identifiers['property'];
     unset($identifiers['property']);
     $cvterm = chado_get_record_with_property(
-      array('table' => 'cvterm', 'base_records' => $identifiers), 
+      array('table' => 'cvterm', 'base_records' => $identifiers),
       array('type_name' => $property),
       $options
     );
@@ -277,7 +277,7 @@ function tripal_get_cvterm($identifiers, $options = array()) {
  *
  * @param $cv_id
  *   The chado cv_id; only cvterms with the supplied cv_id will be returned
- *   
+ *
  * @return
  *   An associative array with the cvterm_id's as keys. The first
  *   element in the array has a key of '0' and a value of 'Select a Type'
@@ -289,7 +289,7 @@ function tripal_get_cvterm_select_options($cv_id) {
   $values = array('cv_id' => $cv_id);
   $s_options = array('order_by' => array('name' => 'ASC'));
 
-  $cvterms = chado_select_record('cvterm', $columns, $values, $s_options); 
+  $cvterms = chado_select_record('cvterm', $columns, $values, $s_options);
 
   $options = array();
   $options[0] = 'Select a Type';
@@ -818,8 +818,8 @@ function tripal_submit_obo_job($obo) {
 
 /**
  * Add the OBO to the tripal_cv_obo table in the Drupal database.
- * 
- * If the OBO name already exists in the table then the path is updated. 
+ *
+ * If the OBO name already exists in the table then the path is updated.
  *
  * @param $name
  *   The human readable name of this ontology
@@ -838,7 +838,7 @@ function tripal_insert_obo($name, $path) {
     ->condition('name', $name)
     ->execute()
     ->fetchField();
-  
+
   if ($obo_id) {
     db_update('tripal_cv_obo')
       ->fields(array(
@@ -896,8 +896,8 @@ function tripal_autocomplete_cvterm($cv_id, $string = '') {
  * @param $record_id
  *   The primary key of the basetable to associate the cvterm with. This should be in integer.
  * @param $cvterm
- *   An associative array describing the cvterm. Valid keys include: 
- *     - name: the name for the cvterm, 
+ *   An associative array describing the cvterm. Valid keys include:
+ *     - name: the name for the cvterm,
  *     - cv_name: the name of the cv the cvterm belongs to.
  *     - cv_id: the primary key of the cv the cvterm belongs to.
  * @param $options
@@ -920,7 +920,7 @@ function tripal_associate_cvterm($basetable, $record_id, $cvterm, $options = arr
     );
     if (isset($cvterm['cv_id'])) {
       $values['cv_id'] = $cvterm['cv_id'];
-    } 
+    }
     elseif (isset($cvterm['cv_name'])) {
       $values['cv_id'] = array(
         'name' => $cvterm['cv_name']
@@ -964,7 +964,7 @@ function tripal_associate_cvterm($basetable, $record_id, $cvterm, $options = arr
       return FALSE;
     }
   }
-  
+
   // Now add the link between the record & cvterm
   if ($cvterm['cvterm_id'] > 0) {
     $values = array(

+ 6 - 1
tripal_cv/includes/tripal_cv.cvterm_form.inc

@@ -199,7 +199,6 @@ function tripal_cv_add_cvterm_form_fields(&$form, $form_state, $cv_id = 0, $cvte
     '#collapsible' => 0,
   );
 
-
   $form['fields']['name']= array(
     '#type'          => 'textfield',
     '#title'         => t("Term Name"),
@@ -208,6 +207,12 @@ function tripal_cv_add_cvterm_form_fields(&$form, $form_state, $cv_id = 0, $cvte
     '#required'      => TRUE,
   );
 
+  $form['fields']['internal_id']= array(
+    '#type'          => 'item',
+    '#title'         => t("Internal ID"),
+    '#markup'        => $cvterm->cvterm_id,
+  );
+
   $form['fields']['definition']= array(
     '#type'          => 'textarea',
     '#title'         => t('Description'),

+ 2 - 0
tripal_cv/tripal_cv.module

@@ -24,6 +24,8 @@ require_once 'includes/tripal_cv.cv_form.inc';
 require_once 'includes/tripal_cv.cvterm_form.inc';
 require_once 'includes/tripal_cv.cvtermpath_form.inc';
 
+require_once 'entities/tripal_cv.entities.inc';
+
 /**
  * Implements hook_init().
  * Adds CSS and JS needed for this modules rendered content

+ 23 - 16
tripal_organism/theme/templates/tripal_organism_base.tpl.php

@@ -1,5 +1,12 @@
 <?php
 
+$cv = entity_load('trp_vocabulary', array(20, 21, 22));
+$cvterm = entity_load('trp_vocabulary_term', array(489, 44099, 45222, 527));
+$gene = entity_load('trp_SO_0000704', array(3));
+dpm($cv);
+dpm($cvterm);
+dpm($gene);
+
 $organism  = $variables['node']->organism;
 $organism = chado_expand_var($organism,'field','organism.comment'); ?>
 
@@ -7,13 +14,13 @@ $organism = chado_expand_var($organism,'field','organism.comment'); ?>
 
 // generate the image tag
 $image = '';
-$image_url = tripal_get_organism_image_url($organism); 
+$image_url = tripal_get_organism_image_url($organism);
 if ($image_url) {
   $image = "<img class=\"tripal-organism-img\" src=\"$image_url\">";
 }
 
-// the $headers array is an array of fields to use as the colum headers. 
-// additional documentation can be found here 
+// the $headers array is an array of fields to use as the colum headers.
+// additional documentation can be found here
 // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
 // This table for the organism has a vertical header (down the first column)
 // so we do not provide headers here, but specify them in the $rows array below.
@@ -22,13 +29,13 @@ $headers = array();
 // the $rows array contains an array of rows where each row is an array
 // of values for each column of the table in that row.  Additional documentation
 // can be found here:
-// https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7 
+// https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
 $rows = array();
 
 // genus row
 $rows[] = array(
   array(
-    'data' => 'Genus', 
+    'data' => 'Genus',
     'header' => TRUE,
     'width' => '20%',
   ),
@@ -38,9 +45,9 @@ $rows[] = array(
 // species row
 $rows[] = array(
   array(
-    'data' => 'Species', 
+    'data' => 'Species',
     'header' => TRUE
-  ), 
+  ),
   '<i>' . $organism->species . '</i>'
 );
 
@@ -56,7 +63,7 @@ $rows[] = array(
 // abbreviation row
 $rows[] = array(
   array(
-    'data' => 'Abbreviation', 
+    'data' => 'Abbreviation',
     'header' => TRUE
   ),
   $organism->abbreviation
@@ -79,23 +86,23 @@ if (user_access('view ids')) {
 }
 
 // the $table array contains the headers and rows array as well as other
-// options for controlling the display of the table.  Additional 
+// options for controlling the display of the table.  Additional
 // documentation can be found here:
 // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
 $table = array(
-  'header' => $headers, 
-  'rows' => $rows, 
+  'header' => $headers,
+  'rows' => $rows,
   'attributes' => array(
     'id' => 'tripal_organism-table-base',
     'class' => 'tripal-organism-data-table tripal-data-table',
-  ), 
+  ),
   'sticky' => FALSE,
   'caption' => '',
-  'colgroups' => array(), 
-  'empty' => '', 
-); 
+  'colgroups' => array(),
+  'empty' => '',
+);
 
 // once we have our table array structure defined, we call Drupal's theme_table()
 // function to generate the table.
 print theme_table($table); ?>
-<div style="text-align: justify"><?php print $image . $organism->comment?></div>  
+<div style="text-align: justify"><?php print $image . $organism->comment?></div>

+ 4 - 4
tripal_organism/theme/templates/tripal_organism_teaser.tpl.php

@@ -2,14 +2,14 @@
 $organism  = $variables['node']->organism;
 $image_url  = tripal_get_organism_image_url($organism); ?>
 
-<div class="tripal_organism-teaser tripal-teaser"> 
-  <div class="tripal-organism-teaser-title tripal-teaser-title"><?php 
+<div class="tripal_organism-teaser tripal-teaser">
+  <div class="tripal-organism-teaser-title tripal-teaser-title"><?php
     print l("<i>$organism->genus $organism->species</i> ($organism->common_name)", "node/$node->nid", array('html' => TRUE));?>
   </div>
-  <div class="tripal-organism-teaser-text tripal-teaser-text"><?php 
+  <div class="tripal-organism-teaser-text tripal-teaser-text"><?php
     if ($image_url) { ?>
       <img class="tripal-teaser-img" src="<?php print $image_url ?>" ><?php
-    } 
+    }
     print substr($organism->comment, 0, 650);
     if (strlen($organism->comment) > 650) {
       print "... " . l("[more]", "node/$node->nid");