Tripal
Functions
tripal_feature.chado_node.inc File Reference

Functions

 tripal_feature_node_info ()
 
 chado_feature_form ($node, &$form_state)
 
 chado_feature_validate ($node, $form, &$form_state)
 
 tripal_feature_node_access ($node, $op, $account)
 
 chado_feature_insert ($node)
 
 chado_feature_update ($node)
 
 chado_feature_delete ($node)
 
 chado_feature_add_synonyms ($synonyms, $feature_id)
 
 chado_feature_load ($nodes)
 
 tripal_feature_node_presave ($node)
 
 tripal_feature_node_insert ($node)
 
 tripal_feature_node_update ($node)
 
 tripal_feature_node_view ($node, $view_mode, $langcode)
 
 chado_feature_chado_node_default_title_format ()
 
 chado_feature_chado_node_default_url_format ()
 

Detailed Description

Implementation of hooks to create a feature content type

Function Documentation

◆ chado_feature_add_synonyms()

chado_feature_add_synonyms (   $synonyms,
  $feature_id 
)

Add synonyms to a feature

Parameters
$synonymsA string containing synonyms separated by a return character
$feature_idThe feature to attach the synonyms to

◆ chado_feature_chado_node_default_title_format()

chado_feature_chado_node_default_title_format ( )

Implements [content_type]_chado_node_default_title_format().

Defines a default title format for the Chado Node API to set the titles on Chado Feature nodes based on chado fields.

◆ chado_feature_chado_node_default_url_format()

chado_feature_chado_node_default_url_format ( )

Implements hook_chado_node_default_url_format().

Designates a default URL format for feature nodes.

◆ chado_feature_delete()

chado_feature_delete (   $node)

Implements hook_delete().

◆ chado_feature_form()

chado_feature_form (   $node,
$form_state 
)

Implementation of hook_form().

◆ chado_feature_insert()

chado_feature_insert (   $node)

Implements hook_insert().

When a new chado_feature node is created we also need to add information to our chado_feature table. This function is called on insert of a new node of type 'chado_feature' and inserts the necessary information.

◆ chado_feature_load()

chado_feature_load (   $nodes)

Implements hook_load().

When a node is requested by the user this function is called to allow us to add auxiliary data to the node object.

◆ chado_feature_update()

chado_feature_update (   $node)

Implements hook_update().

◆ chado_feature_validate()

chado_feature_validate (   $node,
  $form,
$form_state 
)

Implementation of hook_validate().

This validation is being used for three activities: CASE A: Update a node that exists in both drupal and chado CASE B: Synchronizing a node from chado to drupal CASE C: Inserting a new node that exists in niether drupal nor chado

◆ tripal_feature_node_access()

tripal_feature_node_access (   $node,
  $op,
  $account 
)

Implement hook_node_access().

This hook allows node modules to limit access to the node types they define.

Parameters
$nodeThe node on which the operation is to be performed, or, if it does not yet exist, the type of node to be created
$opThe operation to be performed
$accountA user object representing the user for whom the operation is to be performed
Returns
If the permission for the specified operation is not set then return FALSE. If the permission is set then return NULL as this allows other modules to disable access. The only exception is when the $op == 'create'. We will always return TRUE if the permission is set.

◆ tripal_feature_node_info()

tripal_feature_node_info ( )

Implements hook_node_info().

Provide information to drupal about the node types that we're creating in this module

◆ tripal_feature_node_insert()

tripal_feature_node_insert (   $node)

Implements hook_node_insert(). Acts on all content types.

◆ tripal_feature_node_presave()

tripal_feature_node_presave (   $node)

Implements hook_node_presave(). Acts on all content types.

◆ tripal_feature_node_update()

tripal_feature_node_update (   $node)

Implements hook_node_update(). Acts on all content types.

◆ tripal_feature_node_view()

tripal_feature_node_view (   $node,
  $view_mode,
  $langcode 
)

Implements hook_node_view(). Acts on all content types.