Tripal
Functions
tripal_pub.chado_node.inc File Reference

Functions

 tripal_pub_node_info ()
 
 chado_pub_form ($node, $form_state)
 
 chado_pub_validate ($node, $form, &$form_state)
 
 chado_pub_validate_check_uniquename ($uniquename, $pub_id=NULL)
 
 chado_pub_validate_check_duplicate ($title, $pyear, $series_name, $cvterm, $pub_id=NULL)
 
 tripal_pub_node_access ($node, $op, $account)
 
 chado_pub_insert ($node)
 
 chado_pub_update ($node)
 
 chado_pub_load ($nodes)
 
 chado_pub_delete (&$node)
 
 tripal_pub_node_view ($node, $view_mode, $langcode)
 
 tripal_pub_node_insert ($node)
 
 tripal_pub_node_load ($nodes, $types)
 
 tripal_pub_node_update ($node)
 
 tripal_pub_node_presave ($node)
 
 chado_pub_chado_node_default_title_format ()
 
 chado_pub_chado_node_sync_select_query ($query)
 

Detailed Description

Implements Drupal Node hooks to create the chado_analysis node content type.

Function Documentation

◆ chado_pub_chado_node_default_title_format()

chado_pub_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 pub nodes based on chado fields.

◆ chado_pub_chado_node_sync_select_query()

chado_pub_chado_node_sync_select_query (   $query)

Implements [content_type]_chado_node_sync_select_query().

Adds a where clause to the query to exclude the NULL pub.

◆ chado_pub_delete()

chado_pub_delete ( $node)

Implements hook_delete().

This function takes a node and if the delete button has been chosen by the user, the publication and it's details will be removed.Following,given the node-ID, the instance will be deleted from the 'chado_pub' table.

@parm $node Then node to be deleted

◆ chado_pub_form()

chado_pub_form (   $node,
  $form_state 
)

Implements hook_form().

◆ chado_pub_insert()

chado_pub_insert (   $node)

Implements hook_insert().

◆ chado_pub_load()

chado_pub_load (   $nodes)

Implements hook_load().

Parameters
$nodeThe node that is to be loaded
Returns
$node The node with the information to be loaded into the database

◆ chado_pub_update()

chado_pub_update (   $node)

Implements hook_update().

The purpose of the function is to allow the module to take action when an edited node is being updated. It updates any name changes to the database tables that werec reated upon registering a Publication. As well, the database will be changed, so the user changed information will be saved to the database.

Parameters
$nodeThe node being updated

◆ chado_pub_validate()

chado_pub_validate (   $node,
  $form,
$form_state 
)

Implements hook_validate().

◆ chado_pub_validate_check_duplicate()

chado_pub_validate_check_duplicate (   $title,
  $pyear,
  $series_name,
  $cvterm,
  $pub_id = NULL 
)

Check for duplicate publications. To be called from hook_validate(). Sets the form error if a duplicate

Parameters
$titleThe title of the publication
$pyearThe year the publication was published
$series_nameThe series name of the publication
$cvtermThe type of publication
$pub_idthe unique id of the publication

◆ chado_pub_validate_check_uniquename()

chado_pub_validate_check_uniquename (   $uniquename,
  $pub_id = NULL 
)

Validate the publication uniquename. To be called from hook_validate().

Parameters
$uniquenameThe uniquename of the publication
$pub_idIf an update, provide the pub_id so we don't check for a matching uniquename of the pub we are editing

◆ tripal_pub_node_access()

tripal_pub_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_pub_node_info()

tripal_pub_node_info ( )

Implements hook_node_info().

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

◆ tripal_pub_node_insert()

tripal_pub_node_insert (   $node)

Implements hook_node_insert(). Acts on all content types.

We want the publications to always have a URL of http://[base url]/pub/[pub id] where [pub id] is the Chado publication ID. This will allow for easy linking into the publication without needing to know the node. Of course if you know the node that will still work too (e.g. http://[base url]/node/[node id] so the nodeapi function ensures that the URL path is set after insert or update of the node and when the node is loaded if it hasn't yet been set.

◆ tripal_pub_node_load()

tripal_pub_node_load (   $nodes,
  $types 
)

Implements hook_node_load(). Acts on all content types.

We want the publications to always have a URL of http://[base url]/pub/[pub id] where [pub id] is the Chado publication ID. This will allow for easy linking into the publication without needing to know the node. Of course if you know the node that will still work too (e.g. http://[base url]/node/[node id] so the nodeapi function ensures that the URL path is set after insert or update of the node and when the node is loaded if it hasn't yet been set.

◆ tripal_pub_node_presave()

tripal_pub_node_presave (   $node)

Implements hook_node_presave(). Acts on all content types.

◆ tripal_pub_node_update()

tripal_pub_node_update (   $node)

Implements hook_node_update(). Acts on all content types.

We want the publications to always have a URL of http://[base url]/pub/[pub id] where [pub id] is the Chado publication ID. This will allow for easy linking into the publication without needing to know the node. Of course if you know the node that will still work too (e.g. http://[base url]/node/[node id] so the nodeapi function ensures that the URL path is set after insert or update of the node and when the node is loaded if it hasn't yet been set.

◆ tripal_pub_node_view()

tripal_pub_node_view (   $node,
  $view_mode,
  $langcode 
)

Implements hook_node_view(). Acts on all content types.