function tripal_feature_delete_form

2.x tripal_feature.delete.inc tripal_feature_delete_form()
3.x tripal_feature.delete.inc tripal_feature_delete_form()
1.x tripal_feature-delete.inc tripal_feature_delete_form()
1 string reference to 'tripal_feature_delete_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-delete.inc, line 7
@todo Add file header description

Code

function tripal_feature_delete_form() {
  // get the list of organisms
  $sql = "SELECT * FROM {organism} ORDER BY genus, species";
  $org_rset = chado_query($sql);
  $organisms = array();
  $organisms[''] = '';
  while ($organism = db_fetch_object($org_rset)) {
    $organisms[$organism->organism_id] = "$organism->genus $organism->species ($organism->common_name)";
  }
  $form['desc'] = array(
    '#type' => 'markup',
    '#value' => t("Use one or more of the following fields to identify sets of features to be deleted."),
  );

  $form['feature_names'] = array(
    '#type' => 'textarea',
    '#title' => t('Feature Names'),
    '#description' => t('Please provide a list of feature names or unique names,
       separated by spaces or by new lines to be delete. If you specify feature names then
       all other options below will be ignored (except the unique checkbox).'),
  );
  $form['is_unique'] = array(
    '#title' => t('Names are Unique Names'),
    '#type' => 'checkbox',
    '#description' => t('Select this checbox if the names listed in the feature
      names box above are the unique name of the feature rather than the human readable names.'),
  );
  $form['seq_type'] = array(
    '#type' => 'textfield',
    '#title' => t('Sequence Type'),
    '#description' => t('Please enter the Sequence Ontology term that describes the features to be deleted. Use in conjunction with an organism or anaylysis.'),
  );

  $form['organism_id'] = array(
    '#title' => t('Organism'),
    '#type' => t('select'),
    '#description' => t("Choose the organism for which features will be deleted."),
    '#options' => $organisms,
  );


  // get the list of analyses
  $sql = "SELECT * FROM {analysis} ORDER BY name";
  $org_rset = chado_query($sql);
  $analyses = array();
  $analyses[''] = '';
  while ($analysis = db_fetch_object($org_rset)) {
    $analyses[$analysis->analysis_id] = "$analysis->name ($analysis->program $analysis->programversion, $analysis->sourcename)";
  }
  //  TODO: ADD THIS BACK IN LATER
  //
  //   $form['analysis']['analysis_id'] = array (
  //     '#title'       => t('Analysis'),
  //     '#type'        => t('select'),
  //     '#description' => t("Choose the analysis for which associated features will be deleted."),
  //     '#options'     => $analyses,
  //   );

  $form['button'] = array(
    '#type' => 'submit',
    '#value' => t('Delete Features'),
  );
  return $form;
}