function tripal_bulk_loader_import_template_form_submit
2.x tripal_bulk_loader.admin.templates.inc | tripal_bulk_loader_import_template_form_submit($form, &$form_state) |
3.x tripal_bulk_loader.admin.templates.inc | tripal_bulk_loader_import_template_form_submit($form, &$form_state) |
Import Template Form Submit
Parameters
$form: The form that was submitted
$form_state: The values and storage that were submitted
Related topics
File
- tripal_bulk_loader/
includes/ tripal_bulk_loader.admin.templates.inc, line 766 - All functions in this file pertain to administrative management of bulk loader templates
Code
function tripal_bulk_loader_import_template_form_submit($form, &$form_state) {
$options = array(
'template_name' => trim($form_state['values']['template_name']),
'template_array' => trim($form_state['values']['template_array'])
);
$errors = array();
$warnings = array();
// Use the API function to insert a bulk loader.
if (tripal_insert_bulk_loader_template($options, $errors, $warnings)) {
drupal_set_message(t('Successfully imported Tripal bulk loader template.'));
$form_state['rebuild'] = FALSE;
$form_state['redirect'] = 'admin/tripal/loaders/bulk/templates';
}
else {
drupal_set_message(t('Unable to import Tripal bulk loader template.'), 'error');
}
}