function tripal_bulk_loader_import_template_form
2.x tripal_bulk_loader.admin.templates.inc | tripal_bulk_loader_import_template_form($form, &$form_state) |
3.x tripal_bulk_loader.admin.templates.inc | tripal_bulk_loader_import_template_form($form, &$form_state) |
Import Template Form
On export, simply selects the serialized array from the db for a given template and presents it to the user. On import, a serialized template array and a name is supplied and a template record is created.
@todo Make array presented to the user more readable. (ie: unserialize and print to the screen)
Parameters
$form_state: The values and storage for the form
$mode: Either 'import' or 'export' to indicate which function is being performed
Return value
A form array to be rendered by drupal_get_form
Related topics
1 string reference to 'tripal_bulk_loader_import_template_form'
- tripal_bulk_loader_menu in tripal_bulk_loader/
tripal_bulk_loader.module - Implements hook_menu().
File
- tripal_bulk_loader/
includes/ tripal_bulk_loader.admin.templates.inc, line 690 - All functions in this file pertain to administrative management of bulk loader templates
Code
function tripal_bulk_loader_import_template_form($form, &$form_state) {
$form = array();
// set the breadcrumb
$breadcrumb = array();
$breadcrumb[] = l('Home', '<front>');
$breadcrumb[] = l('Administration', 'admin');
$breadcrumb[] = l('Tripal', 'admin/tripal');
$breadcrumb[] = l('Chado Data Loaders', 'admin/tripal/loaders');
$breadcrumb[] = l('Bulk Loader', 'admin/tripal/loaders/bulk');
$breadcrumb[] = l('Templates', 'admin/tripal/loaders/bulk/templates');
drupal_set_breadcrumb($breadcrumb);
$form['template_name'] = array(
'#type' => 'textfield',
'#title' => 'Template Name',
'#weight' => 1,
);
$form['template_array'] = array(
'#type' => 'textarea',
'#title' => 'Template Definition',
'#default_value' => (isset($form_state['values']['template_array'])) ? $form_state['values']['template_array'] : '',
'#description' => t('A serialized array describing the template.'),
'#rows' => 14,
'#weight' => 5,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => 'Import',
'#weight' => 10,
);
return $form;
}