Kaynağa Gözat

Reorganized bulk loaer module directory structure to match other Tripal modules and removed setup instructions on admin page as they were incorrect

spficklin 11 yıl önce
ebeveyn
işleme
587f5f0d42

+ 0 - 68
tripal_bulk_loader/tripal_bulk_loader.admin.inc → tripal_bulk_loader/includes/tripal_bulk_loader.admin.inc

@@ -5,75 +5,7 @@
  * Bulk Loader Administration (Miscellaneous)
  */
 
-/**
- * Provides a description page and quick links for the bulk loader
- *
- * @ingroup tripal_bulk_loader
- */
-function tripal_bulk_loader_admin_template() {
-  $output = '';
 
-  $output .= '<br /><h3>Quick Links:</h3>';
-  $output .= '<ul>'
-    . '<li>'
-      . t('<a href="@link">Configure settings</a>',
-        array('@link' => url('admin/tripal/tripal_bulk_loader_template/configure')))
-      . '</li>'
-    . '<li>'
-      . t('List <a href="@link">Bulk Loader Jobs</a>',
-      array('@link' => url('admin/tripal/tripal_bulk_loader_template/jobs')))
-      . '</li>'
-    . '<li>'
-      . t('List <a href="@link">Manage Templates</a>',
-      array('@link' => url('admin/tripal/tripal_bulk_loader_template/manage_templates')))
-      . '</li>'
-      . '<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>'
-    . '</ul>';
-
-  $output .= '<h3>Module Description:</h3>';
-  $output .= '<p>This module provides the ability to create loading templates for any tab-delimited '
-    . 'data file allowing it to be loaded into chado. The Loading Templates are a direct mapping '
-    . 'between the columns in your file and the columns in chado tables. As such to use this tool '
-    . 'you need to be very familar with the chado schema -See '
-    . l(t('Chado -Getting Started'), 'http://gmod.org/wiki/Chado_-_Getting_Started')
-    . '. The ability to add constants and specify 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.</p>';
-  $output .= '<br />';
-
-  $output .= '<h3>Setup Instructions</h3>';
-  $output .= '<p>After intallation of the bulk loader module, the following tasks should be performed:</p>';
-  $output .= '<ol>';
-  $output .= '<li><b>Install Theme:</b> In order for Bulk Loading pages to be displayed correctly, '
-    .'the contents of the Tripal Bulk Loader theme directory ([drupal root]/sites/all/modules/tripal/tripal_bulk_loader/theme) '
-    .'should be moved to the base directory of the Tripal theme ([drupal root]/sites/all/themes/tripal). '
-    .'Finally the drupal cache should be cleared for the new theme to take effect -navigate to admin/settings/performance '
-    .'and click the Clear Cached Data button.</li>';
-  $output .= '</ol>';
-
-  return $output;
-}
 
 /**
  * Provides a description page and quick links for template management

+ 0 - 0
tripal_bulk_loader/tripal_bulk_loader.admin.templates.inc → tripal_bulk_loader/includes/tripal_bulk_loader.admin.templates.inc


+ 0 - 0
tripal_bulk_loader/tripal_bulk_loader.constants.inc → tripal_bulk_loader/includes/tripal_bulk_loader.constants.inc


+ 0 - 0
tripal_bulk_loader/tripal_bulk_loader.loader.inc → tripal_bulk_loader/includes/tripal_bulk_loader.loader.inc


+ 26 - 0
tripal_bulk_loader/theme/tripal_bulk_loader_admin.tpl.php

@@ -0,0 +1,26 @@
+<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>
+<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') ?>.
+   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.
+</p>
+<br />

+ 28 - 21
tripal_bulk_loader/tripal_bulk_loader.module

@@ -6,10 +6,10 @@
  * @defgroup tripal_bulk_loader Tripal Bulk Loader Module
  * @ingroup tripal_modules
  */
-include('tripal_bulk_loader.loader.inc');
-include('tripal_bulk_loader.constants.inc');
-include('tripal_bulk_loader.admin.inc');
-include('tripal_bulk_loader.admin.templates.inc');
+include('includes/tripal_bulk_loader.loader.inc');
+include('includes/tripal_bulk_loader.constants.inc');
+include('includes/tripal_bulk_loader.admin.inc');
+include('includes/tripal_bulk_loader.admin.templates.inc');
 
 // API
 include('api/tripal_bulk_loader.api.templates.inc');
@@ -39,7 +39,7 @@ function tripal_bulk_loader_menu() {
     'description' => 'Edit a group of constants associated with the current bulk loader',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_bulk_loader_edit_constant_set_form', 1, 3),
-    'access arguments' => array('administer site configuration'),
+    'access arguments' => array('administer tripal_bulk_loader'),
     'type' => MENU_CALLBACK,
   );
   $items['node/%node/constants/%/delete'] = array(
@@ -47,7 +47,7 @@ function tripal_bulk_loader_menu() {
     'description' => 'Delete a group of constants associated with the current bulk loader',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_bulk_loader_delete_constant_set_form', 1, 3),
-    'access arguments' => array('administer site configuration'),
+    'access arguments' => array('administer tripal_bulk_loader'),
     'type' => MENU_CALLBACK,
   );
 
@@ -55,8 +55,9 @@ function tripal_bulk_loader_menu() {
   $items['admin/tripal/tripal_bulk_loader_template'] = array(
     'title' => 'Bulk Loader',
     'description' => 'Templates for loading tab-delimited data',
-    'page callback' => 'tripal_bulk_loader_admin_template',
-    'access arguments' => array('administer site configuration'),
+    'page callback' => 'theme',
+    'page arguments' => array('tripal_bulk_loader_admin'),
+    'access arguments' => array('administer tripal_bulk_loader'),
     'type' => MENU_NORMAL_ITEM,
   );
   $items['admin/tripal/tripal_bulk_loader_template/configure'] = array(
@@ -64,21 +65,21 @@ function tripal_bulk_loader_menu() {
     'description' => 'Configuration of global options related to bulk loading jobs',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_bulk_loader_configuration_form'),
-    'access arguments' => array('administer site configuration'),
+    'access arguments' => array('administer tripal_bulk_loader'),
     'type' => MENU_NORMAL_ITEM,
   );
   $items['admin/tripal/tripal_bulk_loader_template/manage_templates'] = array(
     'title' => 'Manage Templates',
     'description' => 'Create/Update/Delete/Import/Export Templates',
     'page callback' => 'tripal_bulk_loader_admin_manage_templates',
-    'access arguments' => array('administer site configuration'),
+    'access arguments' => array('administer tripal_bulk_loader'),
     'type' => MENU_NORMAL_ITEM,
   );
   $items['admin/tripal/tripal_bulk_loader_template/jobs'] = array(
     'title' => 'Bulk Loader Jobs',
     'description' => 'Listing of Bulk Loading Jobs',
     'page callback' => 'tripal_bulk_loader_admin_jobs',
-    'access arguments' => array('administer site configuration'),
+    'access arguments' => array('administer tripal_bulk_loader'),
     'type' => MENU_NORMAL_ITEM,
   );
 
@@ -88,7 +89,7 @@ function tripal_bulk_loader_menu() {
     'description' => 'Create loader template for loading tab-delimited data',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_bulk_loader_modify_template_base_form', 'create'),
-    'access arguments' => array('administer site configuration'),
+    'access arguments' => array('administer tripal_bulk_loader'),
     'type' => MENU_NORMAL_ITEM,
   );
   $items['admin/tripal/tripal_bulk_loader_template/manage_templates/edit'] = array(
@@ -96,7 +97,7 @@ function tripal_bulk_loader_menu() {
     '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'),
-    'access arguments' => array('administer site configuration'),
+    'access arguments' => array('administer tripal_bulk_loader'),
     'type' => MENU_NORMAL_ITEM,
   );
   $items['admin/tripal/tripal_bulk_loader_template/edit_record'] = array(
@@ -104,7 +105,7 @@ function tripal_bulk_loader_menu() {
     'description' => 'Edit a record in an existing tripal bulk loader template.',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_bulk_loader_edit_template_record_form'),
-    'access arguments' => array('administer site configuration'),
+    'access arguments' => array('administer tripal_bulk_loader'),
     'type' => MENU_CALLBACK,
   );
   $items['admin/tripal/tripal_bulk_loader_template/add_field'] = array(
@@ -112,7 +113,7 @@ function tripal_bulk_loader_menu() {
     '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'),
-    'access arguments' => array('administer site configuration'),
+    'access arguments' => array('administer tripal_bulk_loader'),
     'type' => MENU_CALLBACK,
   );
   $items['admin/tripal/tripal_bulk_loader_template/edit_field'] = array(
@@ -120,7 +121,7 @@ function tripal_bulk_loader_menu() {
     'description' => 'Edit an existing field from a tripal bulk loader template.',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_bulk_loader_edit_template_field_form'),
-    'access arguments' => array('administer site configuration'),
+    'access arguments' => array('administer tripal_bulk_loader'),
     'type' => MENU_CALLBACK,
   );
   // Delete Template -----
@@ -129,7 +130,7 @@ function tripal_bulk_loader_menu() {
     'description' => 'Delete bulk loader template',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_bulk_loader_delete_template_base_form'),
-    'access arguments' => array('administer site configuration'),
+    'access arguments' => array('administer tripal_bulk_loader'),
     'type' => MENU_NORMAL_ITEM,
   );
   // Import/Export ---------
@@ -138,7 +139,7 @@ function tripal_bulk_loader_menu() {
     'description' => 'Import Loaders',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_bulk_loader_import_export_template_form', 'import'),
-    'access arguments' => array('administer site configuration'),
+    'access arguments' => array('administer tripal_bulk_loader'),
     'type' => MENU_NORMAL_ITEM,
   );
   $items['admin/tripal/tripal_bulk_loader_template/manage_templates/export'] = array(
@@ -146,18 +147,18 @@ function tripal_bulk_loader_menu() {
     'description' => 'Export Loaders',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_bulk_loader_import_export_template_form', 'export'),
-    'access arguments' => array('administer site configuration'),
+    'access arguments' => array('administer tripal_bulk_loader'),
     'type' => MENU_NORMAL_ITEM,
   );
   // AHAH ---------
   $items['admin/tripal/tripal_bulk_loader_template/add_field_ahah'] = array(
     'page callback' => 'tripal_bulk_loader_add_field_ahah',
-    'access arguments' => array('administer site configuration'),
+    'access arguments' => array('administer tripal_bulk_loader'),
     'type' => MENU_CALLBACK,
   );
   $items['admin/tripal/tripal_bulk_loader_template/edit_field_ahah'] = array(
     'page callback' => 'tripal_bulk_loader_edit_field_ahah',
-    'access arguments' => array('administer site configuration'),
+    'access arguments' => array('administer tripal_bulk_loader'),
     'type' => MENU_CALLBACK,
   );
 
@@ -191,6 +192,11 @@ function tripal_bulk_loader_theme() {
       'arguments' => array('form' => NULL),
       'template' => 'tripal_bulk_loader_add_template_field_form',
     ),
+    'tripal_bulk_loader_admin' => array(
+      'template' => 'tripal_bulk_loader_admin',
+      'arguments' =>  array(NULL),
+      'path' => drupal_get_path('module', 'tripal_bulk_loader') . '/theme'
+    ),
   );
 }
 
@@ -252,6 +258,7 @@ function tripal_bulk_loader_perm() {
       'create tripal_bulk_loader',
       'delete tripal_bulk_loader',
       'edit tripal_bulk_loader',
+      'administer tripal_bulk_loader',
   );
 }
 

+ 2 - 1
tripal_cv/api/tripal_cv.api.inc

@@ -831,6 +831,7 @@ function tripal_cv_get_custom_tables($table = NULL) {
  *   
  * @ingroup tripal_cv_api
  */
+
 function tripal_cv_submit_obo_job($obo_id = NULL, $obo_name = NULL, $obo_url = NULL, $obo_file = NULL) {
   global $user;
 
@@ -875,7 +876,7 @@ function tripal_cv_add_obo_ref($name, $path) {
   $record->name = $name;
   $record->path = $path;
   drupal_write_record('tripal_cv_obo', $record);
-  return $record->obo_id;
+  return $record->obo_id;  
 }
 
 /**