function hook_chado_node_sync_form_submit

2.x tripal_core.chado_nodes.api.inc hook_chado_node_sync_form_submit($form, $form_state)

Bypass chado node api sync form submit.

Allows you to use this function as your own submit.

This might be necessary if you want to add additional arguments to the tripal job or to call your own sync'ing function if the generic chado_node_sync_records() is not sufficient.

Note: For your own module, replace hook in the function name with the machine-name of your chado node type (ie: chado_feature).

Related topics

File

tripal_core/api/tripal_core.chado_nodes.api.inc, line 1259
API to handle much of the common functionality implemented when creating a drupal node type.

Code

function hook_chado_node_sync_form_submit($form, $form_state) {

  global $user;

  $job_args = array(
    // The base chado table (ie: feature).
    $base_table,
    // The maximum number of records to sync or FALSE for sync all that match.
    $max_sync,
    // The organism_id to restrict records to or FALSE if not to restrict by organism_id.
    $organism_id,
    // A string with the cvterm.name of the types to restrict to separated by |||
    $types
  );

  // You should register a tripal job
  tripal_add_job(
  // The title of the job -be descriptive.
  $title, 
  // The name of your module.
  $module, 
  // The chado node api sync function.
  'chado_node_sync_records', 
  // An array with the arguments to pass to the above function.
  $job_args, 
  // The user who submitted the job.
  $user->uid
  );

}