Browse Source

Tripal Bulk Loader: Fixed create/edit template form and re-did menu system

Lacey Sanderson 11 years ago
parent
commit
65c702ec37

+ 1 - 7
tripal_bulk_loader/api/tripal_bulk_loader.api.templates.inc

@@ -32,13 +32,7 @@ function tripal_bulk_loader_is_record_name_unique($new_record_name, $template_id
     $template = db_query("SELECT * FROM {tripal_bulk_loader_template} WHERE template_id=:template", array(':template' => $template_id))->fetchObject();
     $template = db_query("SELECT * FROM {tripal_bulk_loader_template} WHERE template_id=:template", array(':template' => $template_id))->fetchObject();
     $template_array = unserialize($template->template_array);
     $template_array = unserialize($template->template_array);
     if (!is_array($template_array)) {
     if (!is_array($template_array)) {
-      watchdog(
-        'tripal_bulk_loader',
-        'Unable to retrieve template array from database where template_id=%template_id',
-        array('%template_id' => $template_id),
-        WATCHDOG_WARNING
-      );
-      return FALSE;
+      return TRUE;
     }
     }
   }
   }
 
 

+ 1 - 28
tripal_bulk_loader/includes/tripal_bulk_loader.admin.inc

@@ -14,39 +14,12 @@
  */
  */
 function tripal_bulk_loader_admin_manage_templates() {
 function tripal_bulk_loader_admin_manage_templates() {
   $output = '';
   $output = '';
-
-  $output .= '<br /><h3>Quick Links:</h3>';
-  $output .= '<ul>'
-    . '<li>'
-      . t('<a href="@create">Create</a> a new template',
-      array('@create' => url('admin/tripal/tripal_bulk_loader_template/manage_templates/create')))
-      . '</li>'
-    . '<li>'
-      . t('<a href="@edit">Edit</a> an existing template',
-      array('@edit' => url('admin/tripal/tripal_bulk_loader_template/manage_templates/edit')))
-      . '</li>'
-    . '<li>'
-      . t('<a href="@delete">Delete</a> an existing template',
-      array('@delete' => url('admin/tripal/tripal_bulk_loader_template/manage_templates/delete')))
-      . '</li>'
-    . '<li>'
-      . t('<a href="@import">Import</a> a new template',
-      array('@import' => url('admin/tripal/tripal_bulk_loader_template/manage_templates/import')))
-      . '</li>'
-    . '<li>'
-      . t('<a href="@export">Export</a> an existing template',
-      array('@export' => url('admin/tripal/tripal_bulk_loader_template/manage_templates/export')))
-      . '</li>'
-    . '</ul>';
-
   $output .= '<p>' . t('Templates, as the term is used for this module, refer to plans
   $output .= '<p>' . t('Templates, as the term is used for this module, refer to plans
   describing how the columns in the data file supplied to a bulk loading job map to tables
   describing how the columns in the data file supplied to a bulk loading job map to tables
   and fields in chado. Templates are created independently of bulk loading jobs so that
   and fields in chado. Templates are created independently of bulk loading jobs so that
   they can be re-used. Thus you only need one template to load any number of files of the
   they can be re-used. Thus you only need one template to load any number of files of the
   same format.') . '</p>';
   same format.') . '</p>';
 
 
-
-
   return $output;
   return $output;
 }
 }
 
 
@@ -91,7 +64,7 @@ function tripal_bulk_loader_admin_jobs() {
     $rows[] = array(
     $rows[] = array(
       l($n->job_id, 'admin/tripal/tripal_jobs/view/' . $n->job_id),
       l($n->job_id, 'admin/tripal/tripal_jobs/view/' . $n->job_id),
       l($n->loader_name, 'node/' . $n->nid),
       l($n->loader_name, 'node/' . $n->nid),
-      l($n->template_name, 'admin/tripal/tripal_bulk_loader_template/manage_templates/edit', array('query' => 'template_id=' . $n->template_id)),
+      l($n->template_name, 'admin/tripal/loaders/bulk/template/'.$n->template_id.'/edit'),
       $n->job_status,
       $n->job_status,
       ($n->progress) ? $n->progress . '%' : '',
       ($n->progress) ? $n->progress . '%' : '',
       l('View', 'node/' . $n->nid) . ' | ' .  l('Edit', 'node/' . $n->nid . '/edit')
       l('View', 'node/' . $n->nid) . ' | ' .  l('Edit', 'node/' . $n->nid . '/edit')

File diff suppressed because it is too large
+ 479 - 232
tripal_bulk_loader/includes/tripal_bulk_loader.admin.templates.inc


+ 6 - 21
tripal_bulk_loader/theme/tripal_bulk_loader_admin.tpl.php

@@ -1,26 +1,11 @@
-<h3>Quick Links:</h3>
-<ul>
-  <li><?php print l('Configure settings', 'admin/tripal/tripal_bulk_loader_template/configure') ?></li>
-  <li><?php print l('List Bulk Loader Jobs', 'admin/tripal/tripal_bulk_loader_template/jobs') ?></li>
-  <li><?php print l('Manage Templates', 'admin/tripal/tripal_bulk_loader_template/manage_templates')?>
-    <ul>
-      <li><?php print l('Create a new template', 'admin/tripal/tripal_bulk_loader_template/manage_templates/create')?></li>
-      <li><?php print l('Edit an existing template', 'admin/tripal/tripal_bulk_loader_template/manage_templates/edit')?></li>
-      <li><?php print l('Delete an existing template', 'admin/tripal/tripal_bulk_loader_template/manage_templates/delete')?></li>        
-      <li><?php print l('Import a new template', 'admin/tripal/tripal_bulk_loader_template/manage_templates/import')?></li>
-      <li><?php print l('Export an existing template', 'admin/tripal/tripal_bulk_loader_template/manage_templates/export')?></li>
-    </ul>
-  </li>
-</ul>
-<br>
 <h3>Module Description:</h3>
 <h3>Module Description:</h3>
-<p>This module allows you to create loading templates for any tab-delimited 
-   data file which can be used repetitively for loading data into chado. The Loading Templates are a direct mapping 
-   between the columns in your file and the columns in chado tables. To use this tool 
-   you need to be very familar with the chado schema -See 
+<p>This module allows you to create loading templates for any tab-delimited
+   data file which can be used repetitively for loading data into chado. The Loading Templates are a direct mapping
+   between the columns in your file and the columns in chado tables. To use this tool
+   you need to be very familar with the chado schema -See
    <?php  l(t('Chado -Getting Started'), 'http://gmod.org/wiki/Chado_-_Getting_Started') ?>.
    <?php  l(t('Chado -Getting Started'), 'http://gmod.org/wiki/Chado_-_Getting_Started') ?>.
-   The ability to add constants and specify values via foreign key contraints is also provided 
-   in order for the loader to fill chado columns which may be required but are not specified 
+   The ability to add constants and specify values via foreign key contraints is also provided
+   in order for the loader to fill chado columns which may be required but are not specified
    in your input file.
    in your input file.
 </p>
 </p>
 <br />
 <br />

+ 54 - 11
tripal_bulk_loader/theme/tripal_bulk_loader_modify_template_base_form.tpl.php

@@ -4,11 +4,25 @@ tr.odd .form-item, tr.even .form-item {
   white-space: normal;
   white-space: normal;
   word-wrap: break-word;
   word-wrap: break-word;
 }
 }
+fieldset {
+  padding: 20px;
+}
+td.active{
+  width: 10px;
+}
+td.tbl-action-record-links {
+  width: 150px;
+}
+td.tbl-action-field-links {
+  width: 100px;
+}
 </style>
 </style>
 
 
 <div id="tripal-bulk-loader-fields">
 <div id="tripal-bulk-loader-fields">
 <?php print drupal_render($form['template_name']); ?>
 <?php print drupal_render($form['template_name']); ?>
 
 
+<?php ddl($form, 'form in tpl'); ?>
+
 <!-- For each table display details in a draggable table -->
 <!-- For each table display details in a draggable table -->
 <?php if (!$form['records']['no_records']['#value']) { ?>
 <?php if (!$form['records']['no_records']['#value']) { ?>
   <fieldset><legend><?php print $form['records']['#title']; ?></legend>
   <fieldset><legend><?php print $form['records']['#title']; ?></legend>
@@ -16,23 +30,40 @@ tr.odd .form-item, tr.even .form-item {
     print drupal_render($form['records']['description']);
     print drupal_render($form['records']['description']);
 
 
     // generate table
     // generate table
-    drupal_add_tabledrag('draggable-table', 'order', 'sibling', 'records-reorder');
-    $header = array('Record Name', 'Chado Table', 'Action', 'Order', '');
+    drupal_add_tabledrag('records-table', 'order', 'sibling', 'records-reorder');
+    $header = array(' ', ' ', 'Record Name', 'Chado Table', 'Mode', 'Order',);
     $rows = array();
     $rows = array();
     foreach (element_children($form['records']['records-data']) as $key) {
     foreach (element_children($form['records']['records-data']) as $key) {
       $element = &$form['records']['records-data'][$key];
       $element = &$form['records']['records-data'][$key];
-      $element['new_priority']['#attributes']['class'] = 'records-reorder';
+      $element['new_priority']['#attributes']['class'] = array('records-reorder');
 
 
       $row = array();
       $row = array();
+      $row[] = '';
+      $row[] = array(
+        'class' => array('tbl-action-record-links'),
+        'data' => drupal_render($element['submit-edit_record']) . ' | '
+          . drupal_render($element['submit-delete_record']) . ' | '
+          . drupal_render($element['submit-duplicate_record']) . '<br>'
+          . drupal_render($element['view-fields-link']) . ' | '
+          . drupal_render($element['submit-add_field'])
+        );
       $row[] = drupal_render($element['title']);
       $row[] = drupal_render($element['title']);
       $row[] = drupal_render($element['chado_table']);
       $row[] = drupal_render($element['chado_table']);
       $row[] = drupal_render($element['mode']);
       $row[] = drupal_render($element['mode']);
-      $row[] = drupal_render($element['new_priority']) . drupal_render($element['id']);
-      $row[] = drupal_render($element['submit-edit_record']) . '<br>' . drupal_render($element['submit-duplicate_record']) . '<br>' . drupal_render($element['submit-add_field']);
-      $rows[] = array('data' => $row, 'class' => 'draggable');
+      $row[] = drupal_render($element['new_priority'])
+        . drupal_render($element['id']);
+
+      $rows[] = array('data' => $row, 'class' => array('draggable'));
     }
     }
 
 
-print theme('table', $header, $rows, array('id' => 'draggable-table', 'width' => '100%'));
+    print theme(
+      'table',
+      array(
+        'header' => $header,
+        'rows' => $rows,
+        'attributes' => array('id' => 'records-table')
+      )
+    );
 
 
     // Render submit
     // Render submit
     print drupal_render($form['records']['submit-new_record']);
     print drupal_render($form['records']['submit-new_record']);
@@ -48,13 +79,18 @@ print theme('table', $header, $rows, array('id' => 'draggable-table', 'width' =>
 
 
   <?php
   <?php
     // generate table
     // generate table
-  $header = array('','Record Name', 'Field Name', 'Chado Table', 'Chado Field', 'Data File Column', 'Constant Value', 'Foreign Record');
+    $header = array('','Record Name', 'Field Name', 'Chado Table', 'Chado Field', 'Data File Column', 'Constant Value', 'Foreign Record');
     $rows = array();
     $rows = array();
     foreach ($form['fields']['fields-data'] as $key => $element) {
     foreach ($form['fields']['fields-data'] as $key => $element) {
       if (preg_match('/^#/', $key)) { continue; }
       if (preg_match('/^#/', $key)) { continue; }
 
 
       $row = array();
       $row = array();
-      $row[] = drupal_render($element['edit_submit']) . '<br>' . drupal_render($element['delete_submit']);
+      $row[] = array(
+        'class' => array('tbl-action-field-links', 'active'),
+        'data' => drupal_render($element['edit_submit']) . ' | '
+          . drupal_render($element['delete_submit']) . '<br />'
+          . drupal_render($element['view-record-link'])
+        );
       $row[] = drupal_render($element['record_id']);
       $row[] = drupal_render($element['record_id']);
       $row[] = drupal_render($element['field_name']);
       $row[] = drupal_render($element['field_name']);
       $row[] = drupal_render($element['chado_table_name']);
       $row[] = drupal_render($element['chado_table_name']);
@@ -65,7 +101,14 @@ print theme('table', $header, $rows, array('id' => 'draggable-table', 'width' =>
 
 
       $rows[] = $row;
       $rows[] = $row;
     }
     }
-print theme('table', $header, $rows, array('style'=>'table-layout: fixed; width: 100%'));
+    print theme(
+      'table',
+      array(
+        'header' => $header,
+        'rows' => $rows,
+        //'attributes' => array('style'=>'table-layout: fixed; width: 100%')
+      )
+    );
 
 
     // Render other elements
     // Render other elements
     print drupal_render($form['fields']['add_field']);
     print drupal_render($form['fields']['add_field']);
@@ -75,5 +118,5 @@ print theme('table', $header, $rows, array('style'=>'table-layout: fixed; width:
 <?php } ?>
 <?php } ?>
 
 
 <!-- Display Rest of form -->
 <!-- Display Rest of form -->
-<?php print drupal_render($form); ?>
+<?php print drupal_render_children($form); ?>
 </div>
 </div>

+ 83 - 27
tripal_bulk_loader/tripal_bulk_loader.module

@@ -9,6 +9,8 @@
  */
  */
 include('includes/tripal_bulk_loader.loader.inc');
 include('includes/tripal_bulk_loader.loader.inc');
 include('includes/tripal_bulk_loader.constants.inc');
 include('includes/tripal_bulk_loader.constants.inc');
+
+// Administration
 include('includes/tripal_bulk_loader.admin.inc');
 include('includes/tripal_bulk_loader.admin.inc');
 include('includes/tripal_bulk_loader.admin.templates.inc');
 include('includes/tripal_bulk_loader.admin.templates.inc');
 
 
@@ -53,111 +55,157 @@ function tripal_bulk_loader_menu() {
   );
   );
 
 
   // Admin pages -----------------
   // Admin pages -----------------
-  $items['admin/tripal/tripal_bulk_loader_template'] = array(
+  $items['admin/tripal/loaders/bulk'] = array(
     'title' => 'Bulk Loader',
     'title' => 'Bulk Loader',
     'description' => 'Templates for loading tab-delimited data',
     'description' => 'Templates for loading tab-delimited data',
-    'page callback' => 'theme',
-    'page arguments' => array('tripal_bulk_loader_admin'),
     'access arguments' => array('administer tripal_bulk_loader'),
     'access arguments' => array('administer tripal_bulk_loader'),
     'type' => MENU_NORMAL_ITEM,
     'type' => MENU_NORMAL_ITEM,
   );
   );
-  $items['admin/tripal/tripal_bulk_loader_template/configure'] = array(
+  $items['admin/tripal/loaders/bulk/configure'] = array(
     'title' => 'Configure',
     'title' => 'Configure',
     'description' => 'Configuration of global options related to bulk loading jobs',
     'description' => 'Configuration of global options related to bulk loading jobs',
     'page callback' => 'drupal_get_form',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_bulk_loader_configuration_form'),
     'page arguments' => array('tripal_bulk_loader_configuration_form'),
     'access arguments' => array('administer tripal_bulk_loader'),
     'access arguments' => array('administer tripal_bulk_loader'),
+    'weight' => 8,
     'type' => MENU_NORMAL_ITEM,
     'type' => MENU_NORMAL_ITEM,
   );
   );
-  $items['admin/tripal/tripal_bulk_loader_template/manage_templates'] = array(
-    'title' => 'Manage Templates',
-    'description' => 'Create/Update/Delete/Import/Export Templates',
+  $items['admin/tripal/loaders/bulk/help'] = array(
+    'title' => 'Help',
+    'description' => "A description of the Tripal Bulk Loader module including a short description of it's usage.",
     'page callback' => 'tripal_bulk_loader_admin_manage_templates',
     'page callback' => 'tripal_bulk_loader_admin_manage_templates',
     'access arguments' => array('administer tripal_bulk_loader'),
     'access arguments' => array('administer tripal_bulk_loader'),
+    'weight' => 10,
     'type' => MENU_NORMAL_ITEM,
     'type' => MENU_NORMAL_ITEM,
   );
   );
-  $items['admin/tripal/tripal_bulk_loader_template/jobs'] = array(
+  $items['admin/tripal/loaders/bulk/jobs'] = array(
     'title' => 'Bulk Loader Jobs',
     'title' => 'Bulk Loader Jobs',
     'description' => 'Listing of Bulk Loading Jobs',
     'description' => 'Listing of Bulk Loading Jobs',
     'page callback' => 'tripal_bulk_loader_admin_jobs',
     'page callback' => 'tripal_bulk_loader_admin_jobs',
     'access arguments' => array('administer tripal_bulk_loader'),
     'access arguments' => array('administer tripal_bulk_loader'),
+    'weight' => -10,
     'type' => MENU_NORMAL_ITEM,
     'type' => MENU_NORMAL_ITEM,
   );
   );
 
 
   // Create/Edit Template --------
   // Create/Edit Template --------
-  $items['admin/tripal/tripal_bulk_loader_template/manage_templates/create'] = array(
+  $items['admin/tripal/loaders/bulk/template/create'] = array(
     'title' => 'Create Template',
     'title' => 'Create Template',
     'description' => 'Create loader template for loading tab-delimited data',
     'description' => 'Create loader template for loading tab-delimited data',
     'page callback' => 'drupal_get_form',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_bulk_loader_modify_template_base_form', 'create'),
     'page arguments' => array('tripal_bulk_loader_modify_template_base_form', 'create'),
     'access arguments' => array('administer tripal_bulk_loader'),
     'access arguments' => array('administer tripal_bulk_loader'),
+    'weight' => -8,
     'type' => MENU_NORMAL_ITEM,
     'type' => MENU_NORMAL_ITEM,
   );
   );
-  $items['admin/tripal/tripal_bulk_loader_template/manage_templates/edit'] = array(
+  $items['admin/tripal/loaders/bulk/template/%tblid/edit'] = array(
     'title' => 'Edit Template',
     'title' => 'Edit Template',
     'description' => 'Edit loader template for loading tab-delimited data',
     'description' => 'Edit loader template for loading tab-delimited data',
     'page callback' => 'drupal_get_form',
     'page callback' => 'drupal_get_form',
-    'page arguments' => array('tripal_bulk_loader_modify_template_base_form', 'edit'),
+    'page arguments' => array('tripal_bulk_loader_modify_template_base_form', 'edit',5),
     'access arguments' => array('administer tripal_bulk_loader'),
     'access arguments' => array('administer tripal_bulk_loader'),
+    'type' => MENU_CALLBACK,
+  );
+  $items['admin/tripal/loaders/bulk/template/edit'] = array(
+    'title' => 'Edit Template',
+    'description' => 'Edit loader template for loading tab-delimited data',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('tripal_bulk_loader_modify_template_base_form', 'edit',FALSE),
+    'access arguments' => array('administer tripal_bulk_loader'),
+    'weight' => -6,
     'type' => MENU_NORMAL_ITEM,
     'type' => MENU_NORMAL_ITEM,
   );
   );
-  $items['admin/tripal/tripal_bulk_loader_template/edit_record'] = array(
+
+  // Add/Edit Record -----
+  $items['admin/tripal/loaders/bulk/template/%tblid/add_record'] = array(
+    'title' => 'Add Template Field',
+    'description' => 'Add a template field to an existing tripal bulk loader template.',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('tripal_bulk_loader_add_template_field_form',5),
+    'access arguments' => array('administer tripal_bulk_loader'),
+    'type' => MENU_CALLBACK,
+  );
+  $items['admin/tripal/loaders/bulk/template/%tblid/edit_record/%tblid'] = array(
     'title' => 'Edit Template Record',
     'title' => 'Edit Template Record',
     'description' => 'Edit a record in an existing tripal bulk loader template.',
     'description' => 'Edit a record in an existing tripal bulk loader template.',
     'page callback' => 'drupal_get_form',
     'page callback' => 'drupal_get_form',
-    'page arguments' => array('tripal_bulk_loader_edit_template_record_form'),
+    'page arguments' => array('tripal_bulk_loader_edit_template_record_form',5,7),
+    'access arguments' => array('administer tripal_bulk_loader'),
+    'type' => MENU_CALLBACK,
+  );
+  $items['admin/tripal/loaders/bulk/template/%tblid/delete_record/%tblid'] = array(
+    'title' => 'Delete Template Record',
+    'description' => 'Delete a record in an existing tripal bulk loader template.',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('tripal_bulk_loader_delete_template_record_form',5,7),
+    'access arguments' => array('administer tripal_bulk_loader'),
+    'type' => MENU_CALLBACK,
+  );
+  $items['admin/tripal/loaders/bulk/template/%tblid/duplicate_record/%tblid'] = array(
+    'title' => 'Duplicate Template Record',
+    'description' => 'Duplicate a record in an existing tripal bulk loader template.',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('tripal_bulk_loader_duplicate_template_record_form',5,7),
     'access arguments' => array('administer tripal_bulk_loader'),
     'access arguments' => array('administer tripal_bulk_loader'),
     'type' => MENU_CALLBACK,
     'type' => MENU_CALLBACK,
   );
   );
-  $items['admin/tripal/tripal_bulk_loader_template/add_field'] = array(
+
+  // Add/Edit Field ------
+  $items['admin/tripal/loaders/bulk/template/%tblid/add_field/%tblid'] = array(
     'title' => 'Add Template Field',
     'title' => 'Add Template Field',
     'description' => 'Add a template field to an existing tripal bulk loader template.',
     'description' => 'Add a template field to an existing tripal bulk loader template.',
     'page callback' => 'drupal_get_form',
     'page callback' => 'drupal_get_form',
-    'page arguments' => array('tripal_bulk_loader_add_template_field_form'),
+    'page arguments' => array('tripal_bulk_loader_add_template_field_form',5,7),
     'access arguments' => array('administer tripal_bulk_loader'),
     'access arguments' => array('administer tripal_bulk_loader'),
     'type' => MENU_CALLBACK,
     'type' => MENU_CALLBACK,
   );
   );
-  $items['admin/tripal/tripal_bulk_loader_template/edit_field'] = array(
+  $items['admin/tripal/loaders/bulk/template/%tblid/edit_field/%tblid/%tblid'] = array(
     'title' => 'Edit Template Field',
     'title' => 'Edit Template Field',
     'description' => 'Edit an existing field from a tripal bulk loader template.',
     'description' => 'Edit an existing field from a tripal bulk loader template.',
     'page callback' => 'drupal_get_form',
     'page callback' => 'drupal_get_form',
-    'page arguments' => array('tripal_bulk_loader_edit_template_field_form'),
+    'page arguments' => array('tripal_bulk_loader_edit_template_field_form',5,7,8),
     'access arguments' => array('administer tripal_bulk_loader'),
     'access arguments' => array('administer tripal_bulk_loader'),
     'type' => MENU_CALLBACK,
     'type' => MENU_CALLBACK,
   );
   );
+  $items['admin/tripal/loaders/bulk/template/%tblid/delete_field/%tblid/%tblid'] = array(
+    'title' => 'Delete Template Field',
+    'description' => 'Delete an existing field from a tripal bulk loader template.',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('tripal_bulk_loader_delete_template_field_form',5,7,8),
+    'access arguments' => array('administer tripal_bulk_loader'),
+    'type' => MENU_CALLBACK,
+  );
+
   // Delete Template -----
   // Delete Template -----
-  $items['admin/tripal/tripal_bulk_loader_template/manage_templates/delete'] = array(
+  $items['admin/tripal/loaders/bulk/manage_templates/delete'] = array(
     'title' => 'Delete Template',
     'title' => 'Delete Template',
     'description' => 'Delete bulk loader template',
     'description' => 'Delete bulk loader template',
     'page callback' => 'drupal_get_form',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_bulk_loader_delete_template_base_form'),
     'page arguments' => array('tripal_bulk_loader_delete_template_base_form'),
     'access arguments' => array('administer tripal_bulk_loader'),
     'access arguments' => array('administer tripal_bulk_loader'),
+    'weight' => -4,
     'type' => MENU_NORMAL_ITEM,
     'type' => MENU_NORMAL_ITEM,
   );
   );
   // Import/Export ---------
   // Import/Export ---------
-  $items['admin/tripal/tripal_bulk_loader_template/manage_templates/import'] = array(
+  $items['admin/tripal/loaders/bulk/manage_templates/import'] = array(
     'title' => 'Import Template',
     'title' => 'Import Template',
     'description' => 'Import Loaders',
     'description' => 'Import Loaders',
     'page callback' => 'drupal_get_form',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_bulk_loader_import_export_template_form', 'import'),
     'page arguments' => array('tripal_bulk_loader_import_export_template_form', 'import'),
     'access arguments' => array('administer tripal_bulk_loader'),
     'access arguments' => array('administer tripal_bulk_loader'),
+    'weight' => 2,
     'type' => MENU_NORMAL_ITEM,
     'type' => MENU_NORMAL_ITEM,
   );
   );
-  $items['admin/tripal/tripal_bulk_loader_template/manage_templates/export'] = array(
+  $items['admin/tripal/loaders/bulk/manage_templates/export'] = array(
     'title' => 'Export Template',
     'title' => 'Export Template',
     'description' => 'Export Loaders',
     'description' => 'Export Loaders',
     'page callback' => 'drupal_get_form',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_bulk_loader_import_export_template_form', 'export'),
     'page arguments' => array('tripal_bulk_loader_import_export_template_form', 'export'),
     'access arguments' => array('administer tripal_bulk_loader'),
     'access arguments' => array('administer tripal_bulk_loader'),
+    'weight' => 4,
     'type' => MENU_NORMAL_ITEM,
     'type' => MENU_NORMAL_ITEM,
   );
   );
   // AHAH ---------
   // AHAH ---------
-  $items['admin/tripal/tripal_bulk_loader_template/add_field_ahah'] = array(
-    'page callback' => 'tripal_bulk_loader_add_field_ahah',
-    'access arguments' => array('administer tripal_bulk_loader'),
-    'type' => MENU_CALLBACK,
-  );
-  $items['admin/tripal/tripal_bulk_loader_template/edit_field_ahah'] = array(
+  $items['admin/tripal/loaders/bulk/edit_field_ahah'] = array(
     'page callback' => 'tripal_bulk_loader_edit_field_ahah',
     'page callback' => 'tripal_bulk_loader_edit_field_ahah',
     'access arguments' => array('administer tripal_bulk_loader'),
     'access arguments' => array('administer tripal_bulk_loader'),
     'type' => MENU_CALLBACK,
     'type' => MENU_CALLBACK,
@@ -166,6 +214,11 @@ function tripal_bulk_loader_menu() {
   return $items;
   return $items;
 }
 }
 
 
+function tblid_to_arg($arg, $map, $index) {
+  if (preg_match('/^\d+$/', $arg)) {
+    return $arg;
+  }
+}
 
 
 /**
 /**
  * Implements hook_theme
  * Implements hook_theme
@@ -188,10 +241,12 @@ function tripal_bulk_loader_theme() {
       'path' => drupal_get_path('module', 'tripal_bulk_loader') . '/theme',
       'path' => drupal_get_path('module', 'tripal_bulk_loader') . '/theme',
     ),
     ),
     'tripal_bulk_loader_modify_template_base_form' => array(
     'tripal_bulk_loader_modify_template_base_form' => array(
-      'variables' => array('form' => NULL),
+      'arguments' => array('form' => NULL),
       'template' => 'tripal_bulk_loader_modify_template_base_form',
       'template' => 'tripal_bulk_loader_modify_template_base_form',
       'path' => drupal_get_path('module', 'tripal_bulk_loader') . '/theme',
       'path' => drupal_get_path('module', 'tripal_bulk_loader') . '/theme',
+      'render element' => 'form'
     ),
     ),
+    /**
     'tripal_bulk_loader_edit_template_field_form' => array(
     'tripal_bulk_loader_edit_template_field_form' => array(
       'variables' => array('form' => NULL),
       'variables' => array('form' => NULL),
       'template' => 'tripal_bulk_loader_edit_template_field_form',
       'template' => 'tripal_bulk_loader_edit_template_field_form',
@@ -202,6 +257,7 @@ function tripal_bulk_loader_theme() {
       'template' => 'tripal_bulk_loader_add_template_field_form',
       'template' => 'tripal_bulk_loader_add_template_field_form',
       'path' => drupal_get_path('module', 'tripal_bulk_loader') . '/theme',
       'path' => drupal_get_path('module', 'tripal_bulk_loader') . '/theme',
     ),
     ),
+    */
     'tripal_bulk_loader_admin' => array(
     'tripal_bulk_loader_admin' => array(
       'template' => 'tripal_bulk_loader_admin',
       'template' => 'tripal_bulk_loader_admin',
       'variables' =>  array(NULL),
       'variables' =>  array(NULL),

Some files were not shown because too many files changed in this diff