|
@@ -199,32 +199,20 @@ function tripal_organism_theme($existing, $type, $theme, $path) {
|
|
|
);
|
|
|
return $items;
|
|
|
}
|
|
|
-/**
|
|
|
- *
|
|
|
- * @param $node
|
|
|
- */
|
|
|
-function tripal_organism_node_presave($node) {
|
|
|
- switch ($node->type) {
|
|
|
- case 'chado_organism':
|
|
|
- // set the title for the node
|
|
|
- $node->title = "$node->genus $node->species";
|
|
|
- break;
|
|
|
- }
|
|
|
-}
|
|
|
/**
|
|
|
*
|
|
|
* @ingroup tripal_feature
|
|
|
*/
|
|
|
function tripal_organism_node_view($node, $view_mode, $langcode) {
|
|
|
switch ($node->type) {
|
|
|
- case 'chado_organism':
|
|
|
- // Show feature browser and counts
|
|
|
- if ($view_mode == 'full') {
|
|
|
- $node->content['tripal_organism_base'] = array(
|
|
|
- '#value' => theme('tripal_organism_base', array('node' => $node)),
|
|
|
- );
|
|
|
- }
|
|
|
- break;
|
|
|
+ case 'chado_organism':
|
|
|
+ // Show feature browser and counts
|
|
|
+ if ($view_mode == 'full') {
|
|
|
+ $node->content['tripal_organism_base'] = array(
|
|
|
+ '#value' => theme('tripal_organism_base', array('node' => $node)),
|
|
|
+ );
|
|
|
+ }
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
/**
|
|
@@ -269,7 +257,7 @@ function tripal_organism_permission() {
|
|
|
*/
|
|
|
function tripal_organism_views_api() {
|
|
|
return array(
|
|
|
- 'api' => 2.0,
|
|
|
+ 'api' => 3.0,
|
|
|
);
|
|
|
}
|
|
|
/**
|
|
@@ -440,6 +428,13 @@ function chado_organism_insert($node) {
|
|
|
drupal_write_record('chado_organism', $record);
|
|
|
}
|
|
|
|
|
|
+ // set the title for the node
|
|
|
+ $record = new stdClass();
|
|
|
+ $record->title = "$node->genus $node->species";
|
|
|
+ $record->nid = $node->nid;
|
|
|
+ drupal_write_record('node', $record, 'nid');
|
|
|
+ drupal_write_record('node_revisions', $record, 'nid');
|
|
|
+
|
|
|
// add the image
|
|
|
chado_organism_add_image($node);
|
|
|
}
|
|
@@ -472,6 +467,13 @@ function chado_organism_update($node) {
|
|
|
);
|
|
|
$org_status = tripal_core_chado_update('organism', $match, $values);
|
|
|
|
|
|
+ // set the title for the node
|
|
|
+ $record = new stdClass();
|
|
|
+ $record->title = "$node->genus $node->species";
|
|
|
+ $record->nid = $node->nid;
|
|
|
+ drupal_write_record('node', $record, 'nid');
|
|
|
+ drupal_write_record('node_revisions', $record, 'nid');
|
|
|
+
|
|
|
// add the image
|
|
|
chado_organism_add_image($node);
|
|
|
}
|