function tripal_feature_admin_validate

2.x tripal_feature.admin.inc tripal_feature_admin_validate($form, &$form_state)
3.x tripal_feature.admin.inc tripal_feature_admin_validate($form, &$form_state)
1.x tripal_feature.admin.inc tripal_feature_admin_validate($form, &$form_state)

Related topics

File

tripal_feature/includes/tripal_feature.admin.inc, line 152
@todo Add file header description

Code

function tripal_feature_admin_validate($form, &$form_state) {
  global $user; // we need access to the user info
  $job_args = array();

  variable_set('chado_browser_feature_types', $form_state['values']['feature_types']);

  switch ($form_state['values']['op']) {

    case t('Sync all Features'):
      tripal_add_job('Sync all features', 'tripal_feature', 
      'tripal_feature_sync_features', $job_args, $user->uid);
      break;

    case t('Set/Reset Taxonomy for all feature nodes'):
      tripal_add_job('Set all feature taxonomy', 'tripal_feature', 
      'tripal_features_set_taxonomy', $job_args, $user->uid);
      break;

    case t('Reindex all feature nodes'):
      tripal_add_job('Reindex all features', 'tripal_feature', 
      'tripal_features_reindex', $job_args, $user->uid);
      break;

    case t('Clean up orphaned features'):
      tripal_add_job('Cleanup orphaned features', 'tripal_feature', 
      'tripal_features_cleanup', $job_args, $user->uid);
      break;

    case t('Set Browser'):
      variable_set('tripal_feature_browse_setting', $form_state['values']['browse_features']);
      variable_set('tripal_library_feature_browse_setting', $form_state['values']['browse_features_library']);
      variable_set('tripal_analysis_feature_browse_setting', $form_state['values']['browse_features_analysis']);
      break;

    case t('Set Summary'):
      variable_set('tripal_feature_summary_setting', $form_state['values']['feature_summary']);
      variable_set('tripal_feature_summary_report_mapping', $form_state['values']['feature_mapping']);
      break;

    case t('Set Feature URLs'):
      variable_set('chado_feature_url', $form_state['values']['feature_url']);
      tripal_add_job('Set Feature URLs', 'tripal_feature', 
      'tripal_feature_set_urls', $job_args, $user->uid);
      break;
  }

}