Browse Source

Added upload file permission

Stephen Ficklin 8 years ago
parent
commit
74cfacc807

+ 4 - 0
tripal/tripal.module

@@ -358,6 +358,10 @@ function tripal_permission() {
       'description' => t('Allows the user to create, update and delete Tripal content types.'),
       'restrict access' => TRUE,
     ),
+    'upload files' => array(
+      'title' => t('Upload Files'),
+      'description' => t('Allows the user to upload files using Tripal\'s HTML5 loader.'),
+    ),
     'view dev helps' => array(
       'title' => t('View Developer Hints'),
       'description' => t('Tripal will provide blue shaded boxes that provide

+ 4 - 0
tripal_chado/includes/TripalImporter/OBOImporter.inc

@@ -361,6 +361,10 @@ class OBOImporter extends TripalImporter {
   }
   /**
    * @see TripalImporter::run()
+   *
+   * @param $details
+   *   The following arguments are supported:
+   *     - obo_id:  (required) The ID of the ontology to be imported.
    */
   public function run($details) {
 

+ 8 - 1
tripal_chado/includes/setup/tripal_chado.setup.inc

@@ -108,13 +108,20 @@ function tripal_chado_load_ontologies() {
      ),
 
   );
+
+  module_load_include('inc', 'tripal_chado', 'includes/TripalImporter/OBOImporter');
   for ($i = 0; $i < count($ontologies); $i++) {
     $obo_id = tripal_insert_obo($ontologies[$i]['name'], $ontologies[$i]['path']);
     if ($ontologies[$i]['auto_load'] == TRUE) {
       // Only load ontologies that are not already in the cv table.
       $cv = tripal_get_cv(array('name' => $ontologies[$i]['cv_name']));
       if (!$cv) {
-        tripal_chado_load_obo_v1_2_id($obo_id);
+        print "Loading ontology: " . $ontologies[$i]['name'] . "...\n";
+        $obo = new OBOImporter();
+        $obo->run(array('obo_id' => $obo_id));
+      }
+      else {
+        print "Ontology already loaded (skipping): " . $ontologies[$i]['name'] . "...\n";
       }
     }
   }