function tripal_pub_remote_alter_form_AGL

2.x tripal_pub.AGL.inc tripal_pub_remote_alter_form_AGL($form, $form_state, $num_criteria = 1)
3.x tripal_chado.pub_importer_AGL.inc tripal_pub_remote_alter_form_AGL($form, $form_state, $num_criteria = 1)
1.x AGL.inc tripal_pub_remote_alter_form_AGL($form, $form_state)

A hook for altering the publication importer form.

It Changes the 'Days' element to 'Year' and removes the 'Journal Name' filter.

Parameters

$form: The Drupal form array

$form_state: The form state array

$num_criteria: The number of criteria the user currently has added to the form

Return value

The form (drupal form api)

Related topics

File

tripal_pub/includes/importers/tripal_pub.AGL.inc, line 33
Importer for the USDA Agricultural Library (Agricola).

Code

function tripal_pub_remote_alter_form_AGL($form, $form_state, $num_criteria = 1) {

  // So far we haven't been able to get AGL to filter results to only
  // include pubs by the XX number days in the past.  So, we will
  // change the 'days' element to be the year to query
  $form['themed_element']['days']['#title'] = t('Year');
  $form['themed_element']['days']['#description'] = t('Please enter a year to limit records by the year they were published, created or modified in the database.');

  // The Journal Name filter doesn't seem to work, so remove it
  for ($i = 1; $i <= $num_criteria; $i++) {
    unset($form['themed_element']['criteria'][$i]["scope-$i"]['#options']['journal']);
  }
  return $form;
}