function tripal_bulk_loader_delete_template_base_form
2.x tripal_bulk_loader.admin.templates.inc | tripal_bulk_loader_delete_template_base_form($form, &$form_state) |
3.x tripal_bulk_loader.admin.templates.inc | tripal_bulk_loader_delete_template_base_form( |
1.x tripal_bulk_loader.admin.templates.inc | tripal_bulk_loader_delete_template_base_form() |
Delete Template Form This form allows admin to delete already existing templates
Related topics
1 string reference to 'tripal_bulk_loader_delete_template_base_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 589 - All functions in this file pertain to administrative management of bulk loader templates
Code
function tripal_bulk_loader_delete_template_base_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);
$template_id = $form_state['build_info']['args'][0];
$form_state['storage']['template_id'] = $template_id;
$description = '';
if (isset($_GET['template_name'])) {
$form_state['storage']['template_name'] = $_GET['template_name'];
$description .= '<p><strong>Template:</strong> ' . $_GET['template_name'] . '</p>';
}
$description .= '<p><strong>Are you sure you want to delete this template?</strong></p>';
$yes = 'Delete Template';
$no = 'Cancel';
$form['#attributes']['class'][] = 'confirmation';
$form['description'] = array('#markup' => $description);
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => $yes ? $yes : t('Confirm'),
);
$form['actions']['cancel'] = array(
'#type' => 'link',
'#title' => $no ? $no : t('Cancel'),
'#href' => 'admin/tripal/loaders/bulk/template/' . $template_id . '/edit',
);
// By default, render the form using theme_confirm_form().
if (!isset($form['#theme'])) {
$form['#theme'] = 'confirm_form';
}
return $form;
}