function tripal_feature_sync_form

1.x tripal_feature.sync_features.inc tripal_feature_sync_form()
1 string reference to 'tripal_feature_sync_form'
tripal_feature_menu in tripal_feature/tripal_feature.module
Menu items are automatically added for the new node types created by this module to the 'Create Content' Navigation menu item. This function adds more menu items needed for this module.

File

tripal_feature/includes/tripal_feature.sync_features.inc, line 38
@todo Add file header description

Code

function tripal_feature_sync_form() {

  $form['description'] = array(
    '#type' => 'item',
    '#value' => t("Add feature types, optionally select an organism and " .
      "click the 'Sync all Features' button to create Drupal " .
      "content for features in chado. Only features of the types listed " .
      "below in the Feature Types box will be synced. You may limit the " .
      "features to be synced by a specific organism. Depending on the " .
      "number of features in the chado database this may take a long " .
      "time to complete. "),
  );

  $form['feature_types'] = array(
    '#title' => t('Feature Types'),
    '#type' => 'textarea',
    '#description' => t("Enter the names of the feature types to sync.  Pages for these feature " .
      "types will be created automatically for features that exist in the " .
      "chado database.  The names listed here should be spearated by " .
      "spaces or entered separately on new lines. The names must match " .
      "exactly (spelling and case) with terms in the sequence ontology"),
    '#required' => TRUE,
    '#default_value' => variable_get('chado_sync_feature_types', 'gene contig'),
  );

  // get the list of organisms
  $sql = "SELECT * FROM {organism} ORDER BY genus, species";
  $orgs = tripal_organism_get_synced();
  $organisms[] = '';
  foreach ($orgs as $organism) {
    $organisms[$organism->organism_id] = "$organism->genus $organism->species ($organism->common_name)";
  }
  $form['organism_id'] = array(
    '#title' => t('Organism'),
    '#type' => t('select'),
    '#description' => t("Choose the organism for which features types set above will be synced. Only organisms which also have been synced will appear in this list."),
    '#options' => $organisms,
  );


  $form['button'] = array(
    '#type' => 'submit',
    '#value' => t('Sync all Features'),
    '#weight' => 3,
  );

  return $form;
}