Browse Source

Tripal Stock adheres to Drupal coding standards

Pubudu Basnayaka 12 years ago
parent
commit
5e3c34852a

+ 3 - 3
tripal_stock/other_module_api_functions.inc

@@ -35,11 +35,11 @@ function get_max_chado_rank($tablename, $where_options) {
     if (preg_match('/INT/', $val_array['type'])) {
       $where[] = $key . "=" . $val_array['value'];
     }
-     else {
+    else {
       if ($val_array['exact']) {
-      $operator='='; }
+        $operator='='; }
       else { $operator='~'; }
-      $where[] = $key . $operator . "'" . $val_array['value'] . "'";
+        $where[] = $key . $operator . "'" . $val_array['value'] . "'";
     }
   }
 

+ 147 - 147
tripal_stock/tripal_stock-administration.inc

@@ -17,8 +17,8 @@ function tripal_stock_module_description_page() {
 
   $text = '<h3>Tripal Stock Administrative Tools Quick Links</h3>';
     $text .= '<ul>';
-      $text .= '<li>' . l('Configuration', 'admin/tripal/tripal_stock/configuration') . '</li>';
-      $text .= '<li>' . l('Stock Listing', 'stocks') . '</li>';
+      $text .= '<li>' . l(t('Configuration'), 'admin/tripal/tripal_stock/configuration') . '</li>';
+      $text .= '<li>' . l(t('Stock Listing'), 'stocks') . '</li>';
     $text .= '</ul>';
 
   $text .= '<h3>Module Description:</h3>';
@@ -81,8 +81,8 @@ function tripal_stock_module_description_page() {
   $text .= '<p>In order to access a more flexible listing of stocks you must first install the <a href="http://drupal.org/project/views">Drupal Views2 module</a>. You should then be able to access the default views <a href="../build/views/">here</a>. Essentially, Views is a module which allows you to create custom SQL queries completely through the web interface without knowing SQL. Furthermore, it also does some formatting of the results allowing you to display them as HTML lists, tables or grids. You can also expose filters to the user to let them customize the results they see and even implement various sorting.</p>';
   $text .= '<p>To use one of the Default Views simply click "Enable" and then "Edit" to change it to show exactly what you want. To view the current listing simply clikc "View Page" at the top of the Edit user interface. There are a number of good tutorials out there for Views2, any of which can be used to help you create your own custom listings of biological content. (Note: there aren\'t any tutorials specifically for tripal content but any tutorial for Views2 will show you how to use the views interface.</p></li>';
 
-   $text .= '<h3>Page Customizations</h3>';
-   $text .= '<p>There are several ways to customize the look-and-feel for the way Chado data is presented through Tripal.
+  $text .= '<h3>Page Customizations</h3>';
+  $text .= '<p>There are several ways to customize the look-and-feel for the way Chado data is presented through Tripal.
              Below is a description of several methods.  These methods may be used in conjunction with one another to
              provide fine-grained control.
              <ul>
@@ -148,90 +148,90 @@ function tripal_stock_module_description_page() {
 function tripal_stock_admin() {
   $form = array();
 
-   // before proceeding check to see if we have any
-   // currently processing jobs. If so, we don't want
-   // to give the opportunity to sync Stocks
-   $active_jobs = FALSE;
-   if (tripal_get_module_active_jobs('tripal_stock')) {
-      $active_jobs = TRUE;
-   }
-   if ($active_jobs) {
-
-   $form['notice'] = array(
-         '#type' => 'fieldset',
-         '#title' => t('Stock Management Temporarily Unavailable')
-      );
-
-   $form['notice']['message'] = array(
-         '#value' => t("Currently, stock management jobs are waiting or ".
-            "are running. Managemment features have been hidden until these ".
-            "jobs complete.  Please check back later once these jobs have ".
-            "finished.  You can view the status of pending jobs in the Tripal ".
-            "jobs page."),
-      );
-
-   }
-   else {
-
-   // SET Vocabularies -----------------------------------------------------------------------------------------
-   $form['set_cv'] = array(
+  // before proceeding check to see if we have any
+  // currently processing jobs. If so, we don't want
+  // to give the opportunity to sync Stocks
+  $active_jobs = FALSE;
+  if (tripal_get_module_active_jobs('tripal_stock')) {
+    $active_jobs = TRUE;
+  }
+  if ($active_jobs) {
+
+  $form['notice'] = array(
+       '#type' => 'fieldset',
+       '#title' => t('Stock Management Temporarily Unavailable')
+    );
+
+  $form['notice']['message'] = array(
+       '#value' => t("Currently, stock management jobs are waiting or ".
+          "are running. Managemment features have been hidden until these ".
+          "jobs complete.  Please check back later once these jobs have ".
+          "finished.  You can view the status of pending jobs in the Tripal ".
+          "jobs page."),
+    );
+
+  }
+  else {
+
+    // SET Vocabularies -----------------------------------------------------------------------------------------
+    $form['set_cv'] = array(
       '#type' => 'fieldset',
       '#title' => t('Set Stock Controlled Vocabularies'),
       '#weight' => -10
-   );
+    );
 
-   $form['set_cv']['message'] = array(
+    $form['set_cv']['message'] = array(
          '#value' => t("This setting allows you to set which chado controlled vocabularies (cv)"
                 ." are used. Cvs are used to control user input for the type of stock,"
           ." any properties they enter for a stock & the types of relationships"
           ." between stocks. Only cvs already loaded into chado can be selected here.")
-   );
+    );
 
-   $cv_options = tripal_cv_get_cv_options();
+    $cv_options = tripal_cv_get_cv_options();
 
-   $form['set_cv']['stock_types_cv'] = array(
+    $form['set_cv']['stock_types_cv'] = array(
      '#type' => 'select',
      '#title' => t('Controlled Vocabulary governing Stock Types'),
      '#options' => $cv_options,
      '#default_value' => variable_get('chado_stock_types_cv', 0)
-   );
+    );
 
-   $form['set_cv']['stock_prop_types_cv'] = array(
+    $form['set_cv']['stock_prop_types_cv'] = array(
      '#type' => 'select',
      '#title' => t('Controlled Vocabulary governing Types of Stock Properties'),
      '#description' => t("This cv must contain a cvterm entry where name='synonym'."),
      '#options' => $cv_options,
      '#default_value' => variable_get('chado_stock_prop_types_cv', 0)
-   );
+    );
 
-   $form['set_cv']['stock_relationship_cv'] = array(
+    $form['set_cv']['stock_relationship_cv'] = array(
      '#type' => 'select',
      '#title' => t('Controlled Vocabulary governing Types of Relationsips between Stocks'),
      '#options' => $cv_options,
      '#default_value' => variable_get('chado_stock_relationship_cv', 0)
-   );
+    );
 
-   $form['set_cv']['button'] = array(
+    $form['set_cv']['button'] = array(
       '#type' => 'submit',
       '#value' => t('Set Controlled Vacabularies')
-   );
+    );
 
-   // SYNC STOCKS-----------------------------------------------------------------------------------------------
-   $form['sync'] = array(
+    // SYNC STOCKS-----------------------------------------------------------------------------------------------
+    $form['sync'] = array(
       '#type' => 'fieldset',
       '#title' => t('Sync Stocks'),
       '#weight' => -10
-   );
+    );
 
-   $form['sync']['description'] = array(
+    $form['sync']['description'] = array(
       '#type' => 'item',
       '#value' => t("Click the 'Sync all Germplasm' button to create Drupal ".
          "content for stocks in chado. Depending on the ".
          "number of stocks in the chado database this may take a long ".
          "time to complete. ")
-   );
+    );
 
-   $form['sync']['organisms'] = array(
+    $form['sync']['organisms'] = array(
       '#type' => 'checkboxes',
       '#title' => t('Organisms for which Stocks should be sync\'d'),
       '#description' => t('Only sync\'d Organisms are listed. Leaving an organism unchecked does not delete already sync\'d Stocks.'),
@@ -239,13 +239,13 @@ function tripal_stock_admin() {
       '#required'    => FALSE,
       '#prefix'      => '<div id="lib_boxes">',
       '#suffix'      => '</div>'
-   );
+    );
 
-   $form['sync']['button'] = array(
+    $form['sync']['button'] = array(
       '#type' => 'submit',
       '#value' => t('Sync Stocks')
-   );
-}
+    );
+  }
 
   return system_settings_form($form);
 
@@ -262,31 +262,31 @@ function tripal_stock_admin() {
  * @ingroup tripal_stock
  */
 function tripal_stock_admin_validate($form, &$form_state) {
-   global $user;  // we need access to the user info
-   $job_args = array();
-
-   // Sync Stocks
-   if ($form_state['values']['op'] == t('Sync Stocks')) {
-      // Array organism_id => organims common_name
-      //  which only includes those organisms which the user wants to select stocks for
-      $organisms_2b_syncd = $form_state['values']['organisms'];
-
-      //for each organism selected submit job (handled by tripal_stock_sync_stock_set)
-      //  which syncs all stocks with an organism_id equal to the selelcted organism
-      foreach ( $organisms_2b_syncd as $organism_id ) {
-        if ($organism_id != 0) {
-          $job_args[0] = $organism_id;
-          tripal_add_job("Sync Stocks from Organism $organism_id", 'tripal_stock',
-            'tripal_stock_sync_stock_set', $job_args, $user->uid);
-        }
+  global $user;  // we need access to the user info
+  $job_args = array();
+
+  // Sync Stocks
+  if ($form_state['values']['op'] == t('Sync Stocks')) {
+    // Array organism_id => organims common_name
+    //  which only includes those organisms which the user wants to select stocks for
+    $organisms_2b_syncd = $form_state['values']['organisms'];
+
+    //for each organism selected submit job (handled by tripal_stock_sync_stock_set)
+    //  which syncs all stocks with an organism_id equal to the selelcted organism
+    foreach ( $organisms_2b_syncd as $organism_id ) {
+      if ($organism_id != 0) {
+        $job_args[0] = $organism_id;
+        tripal_add_job("Sync Stocks from Organism $organism_id", 'tripal_stock',
+          'tripal_stock_sync_stock_set', $job_args, $user->uid);
       }
     }
+  }
 
-    if ($form_state['values']['op'] == t('Set Controlled Vacabularies')) {
-      variable_set('chado_stock_types_cv', $form_state['values']['stock_types_cv']);
-      variable_set('chado_stock_prop_types_cv', $form_state['values']['stock_prop_types_cv']);
-      variable_set('chado_stock_relationship_cv', $form_state['values']['stock_relationship_cv']);
-    }
+  if ($form_state['values']['op'] == t('Set Controlled Vacabularies')) {
+    variable_set('chado_stock_types_cv', $form_state['values']['stock_types_cv']);
+    variable_set('chado_stock_prop_types_cv', $form_state['values']['stock_prop_types_cv']);
+    variable_set('chado_stock_relationship_cv', $form_state['values']['stock_relationship_cv']);
+  }
 }
 
 /**
@@ -304,7 +304,7 @@ function tripal_stock_admin_validate($form, &$form_state) {
  *
  * @ingroup tripal_stock
  */
- function tripal_stock_sync_stock_set($organism_id, $job_id) {
+function tripal_stock_sync_stock_set($organism_id, $job_id) {
   global $user;
 
   if (!$organism_id) {
@@ -312,86 +312,86 @@ function tripal_stock_admin_validate($form, &$form_state) {
   }
   else {
 
-    // Get list of stocks to sync
-    $previous_db = tripal_db_set_active('chado');
-    $result = db_query(
-       "SELECT stock_id, uniquename, type_id, organism_id FROM {stock} WHERE organism_id=%d",
-       $organism_id
+  // Get list of stocks to sync
+  $previous_db = tripal_db_set_active('chado');
+  $result = db_query(
+     "SELECT stock_id, uniquename, type_id, organism_id FROM {stock} WHERE organism_id=%d",
+      $organism_id
+  );
+  tripal_db_set_active($previous_db);
+
+  $stocks_created_count = 0; //keeps track of total number of stocks successfully created
+  $stocks_attempted = 0;
+  // foreach stock to be sync'd -> create node & add stock_id
+  while ( $r = db_fetch_object($result) ) {
+    // $r is the current stock to be sync'd
+    $stocks_attempted++;
+
+    print 'Processing ' . $r->uniquename . "... ";
+
+    // check not already in drupal
+    $in_drupal_query = db_query(
+      "SELECT * FROM {chado_stock} WHERE stock_id=%d",
+      $r->stock_id
     );
-    tripal_db_set_active($previous_db);
-
-    $stocks_created_count = 0; //keeps track of total number of stocks successfully created
-    $stocks_attempted = 0;
-    // foreach stock to be sync'd -> create node & add stock_id
-    while ( $r = db_fetch_object($result) ) {
-      // $r is the current stock to be sync'd
-      $stocks_attempted++;
-
-      print 'Processing ' . $r->uniquename . "... ";
-
-      // check not already in drupal
-      $in_drupal_query = db_query(
-        "SELECT * FROM {chado_stock} WHERE stock_id=%d",
-         $r->stock_id
-      );
-      if ( !db_fetch_object($in_drupal_query) ) {
-
-        //create new chado_stock node
-        $new_node = new stdClass();
-         $new_node->type = 'chado_stock';
-        $new_node->uid = $user->uid;
-         $new_node->title = $r->uniquename;
-         $new_node->type_id = $r->type_id;
-         $new_node->organism_id = $r->organism_id;
-         $new_node->stock_id = $r->stock_id;
-        $new_node->chado_stock_exists = TRUE;
-
-         //print 'New Node:';
-         //print_r($new_node);
-
-         node_validate($new_node);
-
-        if (!form_get_errors()) {
-          //print 'Try to Create Node ';
-          $node = node_submit($new_node);
-          node_save($node);
-          if ($node->nid) {
-            $stocks_created_count++;
-
-            //Add stock id to chado_stock table
-            /**
-             db_query(
-               "INSERT INTO chado_stock (stock_id, nid, vid) VALUES (%d, %d, %d)",
-               $r->stock_id,
-               $node->nid,
-               $node->vid
-             );
-             */
-          }
+    if ( !db_fetch_object($in_drupal_query) ) {
+
+      //create new chado_stock node
+      $new_node = new stdClass();
+      $new_node->type = 'chado_stock';
+      $new_node->uid = $user->uid;
+      $new_node->title = $r->uniquename;
+      $new_node->type_id = $r->type_id;
+      $new_node->organism_id = $r->organism_id;
+      $new_node->stock_id = $r->stock_id;
+      $new_node->chado_stock_exists = TRUE;
+
+      //print 'New Node:';
+      //print_r($new_node);
+
+      node_validate($new_node);
+
+      if (!form_get_errors()) {
+        //print 'Try to Create Node ';
+        $node = node_submit($new_node);
+        node_save($node);
+        if ($node->nid) {
+          $stocks_created_count++;
+
+          //Add stock id to chado_stock table
+          /**
+           db_query(
+             "INSERT INTO chado_stock (stock_id, nid, vid) VALUES (%d, %d, %d)",
+             $r->stock_id,
+             $node->nid,
+             $node->vid
+           );
+           */
         }
-        else {
-          print "Not completed due to errors:\nCreate Stock Form Errors: ";
-           print_r(form_get_errors());
-        }
-         print "Nid=" . $node->nid . "\n";
       }
       else {
-        print "Skipped $r->uniquename because it's already in drupal.\n";
-      } //end of if not already in drupal
-    } //end of while still stocks to be sync'd
+        print "Not completed due to errors:\nCreate Stock Form Errors: ";
+        print_r(form_get_errors());
+      }
+        print "Nid=" . $node->nid . "\n";
+    }
+    else {
+      print "Skipped $r->uniquename because it's already in drupal.\n";
+    } //end of if not already in drupal
+  } //end of while still stocks to be sync'd
   } //end of if organism_id not supplied
 
   if ($stocks_attempted == 0) {
-    print "No stocks retrieved for organism (" . $organism_id . ")\n";
+  print "No stocks retrieved for organism (" . $organism_id . ")\n";
+  return 1;
+  }
+  else {
+  if ($stocks_created_count > 0) {
+    print "$stocks_created_count Stocks Successfully Created\n";
     return 1;
   }
   else {
-    if ($stocks_created_count > 0) {
-      print "$stocks_created_count Stocks Successfully Created\n";
-      return 1;
-    }
-    else {
-      return 0;
-    }
+    return 0;
+  }
   }
 }

+ 25 - 25
tripal_stock/tripal_stock-db_references.inc

@@ -20,13 +20,13 @@
 function tripal_stock_add_ALL_dbreferences_page($node) {
   $output = '';
 
-  $output .= tripal_stock_add_chado_properties_progress('db_references') . '<br>';
-  $output .= '<b>All Database References should strictly pertain to THE CURRENT Individual</b><br>';
-  $output .= '<br>';
+  $output .= tripal_stock_add_chado_properties_progress('db_references') . '<br />';
+  $output .= '<b>All Database References should strictly pertain to THE CURRENT Individual</b><br />';
+  $output .= '<br />';
   $output .= theme('tripal_stock_references', $node);
-  $output .= '<br><br>';
+  $output .= '<br /><br />';
   $output .= drupal_get_form('tripal_stock_add_ONE_dbreference_form', $node);
-  $output .= '<br>';
+  $output .= '<br />';
   $output .= drupal_get_form('tripal_stock_add_chado_properties_navigate', 'db_references', $node->nid);
   return $output;
 }
@@ -182,10 +182,10 @@ function tripal_stock_add_ONE_dbreference_form_submit($form, &$form_state) {
       );
       tripal_db_set_active($previous_db);
 
-      drupal_set_message('Successfully Added Database Reference');
+      drupal_set_message(t('Successfully Added Database Reference'));
     }
     else {
-      drupal_set_message('Database reference NOT successfully created...', 'error');
+      drupal_set_message(t('Database reference NOT successfully created...'), 'error');
     } //end of if dbxref was created successfully
   } //end of if valid db reference
 
@@ -208,9 +208,9 @@ function tripal_stock_edit_ALL_dbreferences_page($node) {
   $output = '';
 
   $output .= drupal_get_form('tripal_stock_edit_ALL_db_references_form', $node);
-  $output .= '<br>';
+  $output .= '<br />';
   $output .= drupal_get_form('tripal_stock_add_ONE_dbreference_form', $node);
-  $output .= '<br>';
+  $output .= '<br />';
   $output .= drupal_get_form('tripal_stock_back_to_stock_button', $node->nid);
 
   return $output;
@@ -315,29 +315,29 @@ function tripal_stock_edit_ALL_db_references_form_submit($form, &$form_state) {
 
   if ($form_state['clicked_button']['#value'] == t('Update DB References') ) {
 
-     //Update all
-     for ($i=1; $i<=$form_state['values']['num_db_references']; $i++) {
-       tripal_stock_update_db_reference(
-          $form_state['values']["id-$i"],
-          $form_state['values']["database-$i"],
-          $form_state['values']["accession-$i"]
+       //Update all
+    for ($i=1; $i<=$form_state['values']['num_db_references']; $i++) {
+      tripal_stock_update_db_reference(
+        $form_state['values']["id-$i"],
+        $form_state['values']["database-$i"],
+        $form_state['values']["accession-$i"]
       );
-     }
-     drupal_set_message("Updated all Database References");
-     drupal_goto('node/' . $form_state['values']['nid']);
+    }
+      drupal_set_message(t("Updated all Database References"));
+      drupal_goto('node/' . $form_state['values']['nid']);
 
   }
   elseif ( preg_match('/Delete #(\d+)/', $form_state['clicked_button']['#value'], $matches) ) {
 
-     $i = $matches[1];
-     tripal_stock_delete_db_reference($form_state['values']["id-$i"]);
-     drupal_set_message("Deleted Database Reference");
+    $i = $matches[1];
+    tripal_stock_delete_db_reference($form_state['values']["id-$i"]);
+    drupal_set_message(t("Deleted Database Reference"));
 
   }
   else {
-    drupal_set_message("Unrecognized Button Pressed", 'error');
-  }
+    drupal_set_message(t("Unrecognized Button Pressed"), 'error');
 
+  }
 }
 
 /**
@@ -408,7 +408,7 @@ function tripal_stock_delete_db_reference($dbxref_id) {
 function theme_tripal_stock_edit_ALL_db_references_form($form) {
   $output = '';
 
-  $output .= '<br><fieldset>';
+  $output .= '<br /><fieldset>';
   $output .= '<legend>Edit Existing Database References<span class="form-optional" title="This field is optional">(optional)</span></legend>';
   $output .= '<p>Below is a list of already existing database references, one per line. When entering a database reference, the accession '
          .'is a unique identifier for this stock in the specified database.</p>';
@@ -422,7 +422,7 @@ function theme_tripal_stock_edit_ALL_db_references_form($form) {
          . drupal_render($form["submit-$i"]) . '</td></tr>';
   }
 
-  $output .= '</table><br>';
+  $output .= '</table><br />';
   $output .= drupal_render($form);
   $output .= '</fieldset>';
 

+ 20 - 20
tripal_stock/tripal_stock-properties.inc

@@ -12,13 +12,13 @@
 function tripal_stock_add_ALL_property_page($node) {
   $output = '';
 
-  $output .= tripal_stock_add_chado_properties_progress('properties') . '<br>';
-  $output .= '<b>All Properties should strictly pertain to THE CURRENT Individual</b><br>';
-  $output .= '<br>';
+  $output .= tripal_stock_add_chado_properties_progress('properties') . '<br />';
+  $output .= '<b>All Properties should strictly pertain to THE CURRENT Individual</b><br />';
+  $output .= '<br />';
   $output .= theme('tripal_stock_properties', $node);
-  $output .= '<br><br>';
+  $output .= '<br /><br />';
   $output .= drupal_get_form('tripal_stock_add_ONE_property_form', $node);
-  $output .= '<br>';
+  $output .= '<br />';
   $output .= drupal_get_form('tripal_stock_add_chado_properties_navigate', 'properties', $node->nid);
   return $output;
 }
@@ -147,7 +147,7 @@ function tripal_stock_add_ONE_property_form_submit($form, &$form_state) {
     );
     tripal_db_set_active($previous_db);
 
-    drupal_set_message("Successfully Added Property");
+    drupal_set_message(t("Successfully Added Property"));
 
     // Set Preferred Synonym
     if ($form_state['values']['preferred_synonym'] == 1) {
@@ -178,9 +178,9 @@ function tripal_stock_edit_ALL_properties_page($node) {
   $output = '';
 
   $output .= drupal_get_form('tripal_stock_edit_ALL_properties_form', $node);
-  $output .= '<br>';
+  $output .= '<br />';
   $output .= drupal_get_form('tripal_stock_add_ONE_property_form', $node);
-  $output .= '<br>';
+  $output .= '<br />';
   $output .= drupal_get_form('tripal_stock_back_to_stock_button', $node->nid);
 
   return $output;
@@ -265,20 +265,20 @@ function tripal_stock_edit_ALL_properties_form($form_state, $node) {
 function tripal_stock_edit_ALL_properties_form_submit($form, &$form_state) {
 
   if ($form_state['clicked_button']['#value'] == t('Update Properties') ) {
-     //Update all
-     for ($i=1; $i<=$form_state['values']['num_properties']; $i++) {
-       tripal_stock_update_property($form_state['values']["id-$i"], $form_state['values']["type-$i"], $form_state['values']["value-$i"], $form_state['values']["preferred-$i"], $form_state['values']["nid"]);
-     }
-     drupal_set_message("Updated all Properties");
-     drupal_goto('node/' . $form_state['values']['nid']);
+    //Update all
+    for ($i=1; $i<=$form_state['values']['num_properties']; $i++) {
+      tripal_stock_update_property($form_state['values']["id-$i"], $form_state['values']["type-$i"], $form_state['values']["value-$i"], $form_state['values']["preferred-$i"], $form_state['values']["nid"]);
+    }
+    drupal_set_message(t("Updated all Properties"));
+    drupal_goto('node/' . $form_state['values']['nid']);
   }
   elseif ( preg_match('/Delete #(\d+)/', $form_state['clicked_button']['#value'], $matches) ) {
-     $i = $matches[1];
-     tripal_stock_delete_property($form_state['values']["id-$i"], $form_state['values']["type-$i"], $form_state['values']["value-$i"]);
-     drupal_set_message("Deleted Property");
+    $i = $matches[1];
+    tripal_stock_delete_property($form_state['values']["id-$i"], $form_state['values']["type-$i"], $form_state['values']["value-$i"]);
+    drupal_set_message(t("Deleted Property"));
   }
   else {
-    drupal_set_message("Unrecognized Button Pressed", 'error');
+    drupal_set_message(t("Unrecognized Button Pressed"), 'error');
   }
 
 
@@ -367,7 +367,7 @@ function tripal_stock_delete_property($stockprop_id) {
 function theme_tripal_stock_edit_ALL_properties_form($form) {
   $output = '';
 
-  $output .= '<br><fieldset>';
+  $output .= '<br /><fieldset>';
   $output .= '<legend>Edit Already Existing Properties<span class="form-optional" title="This field is optional">(optional)</span></legend>';
   $output .= '<p>Below is a list of already existing properties for this stock, one property per line. The type refers to the type of '
          .'property and the value is the value for that property. For example, if this stock has a seed coat colour of green then '
@@ -380,7 +380,7 @@ function theme_tripal_stock_edit_ALL_properties_form($form) {
     $output .= '<tr><td>' . drupal_render($form["num-$i"]) . '</td><td>' . drupal_render($form["type-$i"]) . '</td><td>' . drupal_render($form["value-$i"]) . drupal_render($form["preferred-$i"]) . '</td><td>' . drupal_render($form["submit-$i"]) . '</td></tr>';
   }
 
-  $output .= '</table><br>';
+  $output .= '</table><br />';
   $output .= drupal_render($form);
   $output .= '</fieldset>';
 

+ 29 - 29
tripal_stock/tripal_stock-relationships.inc

@@ -12,13 +12,13 @@
 function tripal_stock_add_ALL_relationships_page($node) {
   $output = '';
 
-  $output .= tripal_stock_add_chado_properties_progress('relationships') . '<br>';
-  $output .= '<b>All Relationships should include the CURRENT Individual (' . $node->stock->uniquename . ')</b><br>';
-  $output .= '<br>';
+  $output .= tripal_stock_add_chado_properties_progress('relationships') . '<br />';
+  $output .= '<b>All Relationships should include the CURRENT Individual (' . $node->stock->uniquename . ')</b><br />';
+  $output .= '<br />';
   $output .= theme('tripal_stock_relationships', $node);
-  $output .= '<br><br>';
+  $output .= '<br /><br />';
   $output .= drupal_get_form('tripal_stock_add_ONE_relationship_form', $node);
-  $output .= '<br>';
+  $output .= '<br />';
   $output .= drupal_get_form('tripal_stock_add_chado_properties_navigate', 'relationships', $node->nid);
   return $output;
 }
@@ -115,13 +115,13 @@ function tripal_stock_add_ONE_relationship_form_validate($form, &$form_state) {
       for ($i=0; $i<sizeof($subject_results); $i++) {
       $links[] = l($i+1, "node/" . $subject_results[$i]->nid); }
       $message = "Too many stocks match '" . $form_state['values']['subject_id'] . "'! "
-                  . " Please refine your input to match ONLY ONE stock. <br>"
+                  . " Please refine your input to match ONLY ONE stock. <br />"
      . "To aid in this process, here are the stocks that match your initial input: "
      . join(', ', $links);
       form_set_error('subject_id', $message);
     }
     elseif (sizeof($subject_results) < 1) {
-      form_set_error('subject_id', "There are no stocks matching your input. Please check your input for typos and/or lookup the stock " . l('here', 'stocks'));
+      form_set_error('subject_id', t("There are no stocks matching your input. Please check your input for typos and/or lookup the stock %link", array('%link' => l(t('here'), 'stocks'))));
     }
     elseif (sizeof($subject_results) == 1) {
       $form_state['values']['subject_id'] = $subject_results[0]->stock->stock_id;
@@ -134,13 +134,13 @@ function tripal_stock_add_ONE_relationship_form_validate($form, &$form_state) {
       for ($i=0; $i<sizeof($object_results); $i++) {
       $links[] = l($i+1, "node/" . $object_results[$i]->nid); }
       $message = "Too many stocks match '" . $form_state['values']['object_id'] . "'! "
-                 . "Please refine your input to match ONLY ONE stock. <br>"
+                 . "Please refine your input to match ONLY ONE stock. <br />"
                  . "To aid in this process, here are the stocks that match your initial input: "
                  . join(', ', $links);
       form_set_error('object_id', $message);
     }
     elseif (sizeof($object_results) < 1) {
-      form_set_error('object_id', "There are no stocks matching your input. Please check your input for typos and/or lookup the stock " . l('here', 'stocks'));
+      form_set_error('object_id', t("There are no stocks matching your input. Please check your input for typos and/or lookup the stock %link", array('%link' => l(t('here'), 'stocks'))));
     }
     elseif (sizeof($object_results) == 1) {
       $form_state['values']['object_id'] = $object_results[0]->stock->stock_id;
@@ -187,7 +187,7 @@ function tripal_stock_add_ONE_relationship_form_submit($form, &$form_state) {
     );
     tripal_db_set_active($previous_db);
 
-    drupal_set_message('Successfully Added Relationship.');
+    drupal_set_message(t('Successfully Added Relationship.'));
   } //end of insert relationship
 
 }
@@ -201,9 +201,9 @@ function tripal_stock_edit_ALL_relationships_page($node) {
   $output = '';
 
   $output .= drupal_get_form('tripal_stock_edit_ALL_relationships_form', $node);
-  $output .= '<br>';
+  $output .= '<br />';
   $output .= drupal_get_form('tripal_stock_add_ONE_relationship_form', $node);
-  $output .= '<br>';
+  $output .= '<br />';
   $output .= drupal_get_form('tripal_stock_back_to_stock_button', $node->nid);
 
   return $output;
@@ -343,13 +343,13 @@ function tripal_stock_edit_ALL_relationships_form_validate($form, &$form_state)
         for ($j=0; $j<sizeof($subject_results); $j++) {
         $links[] = l($j+1, "node/" . $subject_results[$j]->nid); }
         $message = "Too many stocks match '" . $form_state['values']["subject_id-$i"] . "'! "
-                 . "Please refine your input to match ONLY ONE stock. <br>"
+                 . "Please refine your input to match ONLY ONE stock. <br />"
                  . "To aid in this process, here are the stocks that match your initial input: "
                  . join(', ', $links);
         form_set_error("subject_id-$i", $message);
       }
       elseif (sizeof($subject_results) < 1) {
-        form_set_error("subject_id-$i", "There are no stocks matching your input. Please check your input for typos and/or lookup the stock " . l('here', 'stocks'));
+        form_set_error("subject_id-$i", t("There are no stocks matching your input. Please check your input for typos and/or lookup the stock %link", array('%link' => l(t('here'), 'stocks'))));
       }
       elseif (sizeof($subject_results) == 1) {
         $form_state['values']["subject_id-$i"] = $subject_results[0]->stock->stock_id;
@@ -362,13 +362,13 @@ function tripal_stock_edit_ALL_relationships_form_validate($form, &$form_state)
         for ($j=0; $j<sizeof($object_results); $j++) {
         $links[] = l($j+1, "node/" . $object_results[$j]->nid); }
         $message = "Too many stocks match '" . $form_state['values']["object_id-$i"] . "'! "
-                 . "Please refine your input to match ONLY ONE stock. <br>"
+                 . "Please refine your input to match ONLY ONE stock. <br />"
                  . "To aid in this process, here are the stocks that match your initial input: "
                  . join(', ', $links);
         form_set_error("object_id-$i", $message);
       }
       elseif (sizeof($object_results) < 1) {
-        form_set_error("object_id-$i", "There are no stocks matching your input. Please check your input for typos and/or lookup the stock " . l('here', 'stocks'));
+        form_set_error("object_id-$i", t("There are no stocks matching your input. Please check your input for typos and/or lookup the stock %link", array('%link' => l(t('here'), 'stocks'))));
       }
       elseif (sizeof($object_results) == 1) {
         $form_state['values']["object_id-$i"] = $object_results[0]->stock->stock_id;
@@ -408,33 +408,33 @@ function tripal_stock_edit_ALL_relationships_form_validate($form, &$form_state)
 function tripal_stock_edit_ALL_relationships_form_submit($form, &$form_state) {
 
   if ($form_state['clicked_button']['#value'] == t('Update Relationships') ) {
-     //Update all
-     for ($i=1; $i<=$form_state['values']['num_relationships']; $i++) {
+    //Update all
+    for ($i=1; $i<=$form_state['values']['num_relationships']; $i++) {
 
-       //process stock textfields
-       tripal_stock_update_relationship(
+      //process stock textfields
+      tripal_stock_update_relationship(
         $form_state['values']["id-$i"],
         $form_state['values']["subject_id-$i"],
         $form_state['values']["type_id-$i"],
         $form_state['values']["object_id-$i"]
       );
-     }
-     drupal_set_message("Updated all Relationships");
-     drupal_goto('node/' . $form_state['values']['nid']);
+    }
+    drupal_set_message(t("Updated all Relationships"));
+    drupal_goto('node/' . $form_state['values']['nid']);
 
   }
   elseif ( preg_match('/Delete #(\d+)/', $form_state['clicked_button']['#value'], $matches) ) {
 
-     $i = $matches[1];
-     tripal_stock_delete_relationship($form_state['values']["id-$i"]);
-     drupal_set_message("Deleted Relationship");
+    $i = $matches[1];
+    tripal_stock_delete_relationship($form_state['values']["id-$i"]);
+    drupal_set_message(t("Deleted Relationship"));
 
   }
   elseif ($form_state['clicked_button']['#value'] == t('Back to Stock') ) {
     drupal_goto('node/' . $form_state['values']['nid']);
   }
   else {
-    drupal_set_message("Unrecognized Button Pressed", 'error');
+    drupal_set_message(t("Unrecognized Button Pressed"), 'error');
   }
 
 }
@@ -482,7 +482,7 @@ function tripal_stock_delete_relationship($stock_relationship_id) {
 function theme_tripal_stock_edit_ALL_relationships_form($form) {
   $output = '';
 
-  $output .= '<br><fieldset>';
+  $output .= '<br /><fieldset>';
   $output .= '<legend>Edit Already Existing Relationships<span class="form-optional" title="This field is optional">(optional)</span></legend>';
   $output .= '<p>Each relationship for this stock is listed below, one per line. The textboxes indicating '
         . 'the subject and object of the relationship can contain the uniquename, name, database '
@@ -498,7 +498,7 @@ function theme_tripal_stock_edit_ALL_relationships_form($form) {
          . drupal_render($form["submit-$i"]) . '</td></tr>';
   }
 
-  $output .= '</table><br>';
+  $output .= '</table><br />';
   $output .= drupal_render($form);
   $output .= '</fieldset>';
 

+ 10 - 3
tripal_stock/tripal_stock.install

@@ -6,12 +6,17 @@
  * @file
  */
 
-/** Implementation of hook_install() */
+/**
+  * Implementation of hook_install() .
+  */
 function tripal_stock_install() {
   drupal_install_schema('tripal_stock');
 }
 
-/** Implementation of hook_uninstall() */
+/**
+  * Implementation of hook_uninstall().
+  */
+
 function tripal_stock_uninstall() {
   drupal_uninstall_schema('tripal_stock');
 
@@ -28,7 +33,9 @@ function tripal_stock_uninstall() {
 
 }
 
-/** Implementation of hook_schema() */
+/**
+  * Implementation of hook_schema().
+  */
 function tripal_stock_schema() {
   $schema['chado_stock'] = array(
     'fields' => array(

+ 92 - 92
tripal_stock/tripal_stock.module

@@ -44,16 +44,16 @@ function tripal_stock_menu() {
 
   //Administrative settings menu-----------------
   $items['admin/tripal/tripal_stock'] = array(
-    'title' => t('Stocks'),
-    'description' => t('Basic Description of Tripal Stock Module Functionality'),
+    'title' => 'Stocks',
+    'description' => 'Basic Description of Tripal Stock Module Functionality',
     'page callback' => 'tripal_stock_module_description_page',
     'access arguments' => array('administer site configuration'),
     'type' => MENU_NORMAL_ITEM
   );
 
   $items['admin/tripal/tripal_stock/configuration'] = array(
-    'title' => t('Configuration'),
-    'description' => t('Settings for Chado Stocks'),
+    'title' => 'Configuration',
+    'description' => 'Settings for Chado Stocks',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_stock_admin'),
     'access arguments' => array('administer site configuration'),
@@ -63,7 +63,7 @@ function tripal_stock_menu() {
   //Displaying stocks----------------------------
   $items['stocks'] = array(
     'menu_name' => ('primary-links'),
-    'title' => t('Stocks'),
+    'title' => 'Stocks',
     'page callback' => 'tripal_stock_show_stocks',
     'access arguments' => array('access chado_stock content'),
     'type' => MENU_NORMAL_ITEM,
@@ -71,8 +71,8 @@ function tripal_stock_menu() {
 
   // Adding Secondary Properties-----------------
   $items['node/%cs_node/properties'] = array(
-    'title' => t('Add Properties & Synonyms'),
-    'description' => t('Settings for Chado Stocks'),
+    'title' => 'Add Properties & Synonyms',
+    'description' => 'Settings for Chado Stocks',
     'page callback' => 'tripal_stock_add_ALL_property_page',
     'page arguments' => array(1),
     'access arguments' => array('create chado_stock content'),
@@ -80,8 +80,8 @@ function tripal_stock_menu() {
   );
 
   $items['node/%cs_node/db_references'] = array(
-    'title' => t('Add Database References'),
-    'description' => t('Settings for Chado Stocks'),
+    'title' => 'Add Database References',
+    'description' => 'Settings for Chado Stocks',
     'page callback' => 'tripal_stock_add_ALL_dbreferences_page',
     'page arguments' => array(1),
     'access arguments' => array('create chado_stock content'),
@@ -89,8 +89,8 @@ function tripal_stock_menu() {
   );
 
   $items['node/%cs_node/relationships'] = array(
-    'title' => t('Add Relationships'),
-    'description' => t('Settings for Chado Stocks'),
+    'title' => 'Add Relationships',
+    'description' => 'Settings for Chado Stocks',
     'page callback' => 'tripal_stock_add_ALL_relationships_page',
     'page arguments' => array(1),
     'access arguments' => array('create chado_stock content'),
@@ -99,8 +99,8 @@ function tripal_stock_menu() {
 
   //Edit/Deleting Secondary Properties-------------
   $items['node/%cs_node/edit_properties'] = array(
-    'title' => t('Edit Properties'),
-    'description' => t('Settings for Chado Stocks'),
+    'title' => 'Edit Properties',
+    'description' => 'Settings for Chado Stocks',
     'page callback' => 'tripal_stock_edit_ALL_properties_page',
     'page arguments' => array(1),
     'access arguments' => array('edit chado_stock content'),
@@ -109,8 +109,8 @@ function tripal_stock_menu() {
   );
 
     $items['node/%cs_node/edit_relationships'] = array(
-    'title' => t('Edit Relationships'),
-    'description' => t('Settings for Chado Stocks'),
+    'title' => 'Edit Relationships',
+    'description' => 'Settings for Chado Stocks',
     'page callback' => 'tripal_stock_edit_ALL_relationships_page',
     'page arguments' => array(1),
     'access arguments' => array('edit chado_stock content'),
@@ -119,8 +119,8 @@ function tripal_stock_menu() {
   );
 
   $items['node/%cs_node/edit_db_references'] = array(
-    'title' => t('Edit DB References'),
-    'description' => t('Settings for Chado Stocks'),
+    'title' => 'Edit DB References',
+    'description' => 'Settings for Chado Stocks',
     'page callback' => 'tripal_stock_edit_ALL_dbreferences_page',
     'page arguments' => array(1),
     'access arguments' => array('edit chado_stock content'),
@@ -158,7 +158,7 @@ function cs_node_load($nid) {
 }
 
 /**
- * Implementation of hook_perm()
+ * Implementation of hook_perm().
  *
  * Purpose: Set the permission types that the chado stock module uses
  *
@@ -192,27 +192,27 @@ function tripal_stock_perm() {
  * @ingroup tripal_stock
  */
 function chado_stock_access($op, $node, $account) {
-   if ($op == 'create') {
-      if (!user_access('create chado_stock content', $account)) {
-        return FALSE;
-      }
-   }
-   if ($op == 'update') {
-      if (!user_access('edit chado_stock content', $account)) {
-         return FALSE;
-      }
-   }
-   if ($op == 'delete') {
-      if (!user_access('delete chado_stock content', $account)) {
-         return FALSE;
-      }
-   }
-   if ($op == 'view') {
-      if (!user_access('access chado_stock content', $account)) {
-         return FALSE;
-      }
-   }
-   return NULL;
+  if ($op == 'create') {
+    if (!user_access('create chado_stock content', $account)) {
+      return FALSE;
+    }
+  }
+  if ($op == 'update') {
+    if (!user_access('edit chado_stock content', $account)) {
+      return FALSE;
+    }
+  }
+  if ($op == 'delete') {
+    if (!user_access('delete chado_stock content', $account)) {
+      return FALSE;
+    }
+  }
+  if ($op == 'view') {
+    if (!user_access('access chado_stock content', $account)) {
+      return FALSE;
+    }
+  }
+  return NULL;
 }
 
 /**
@@ -228,9 +228,9 @@ function chado_stock_access($op, $node, $account) {
  * @ingroup tripal_stock
  */
 function tripal_stock_views_api() {
-   return array(
-      'api' => 2.0,
-   );
+  return array(
+    'api' => 2.0,
+  );
 }
 
 /**
@@ -297,18 +297,18 @@ function tripal_stock_theme() {
  */
 function tripal_stock_show_stocks() {
   $sql = "SELECT COUNT(stock_id) FROM {chado_stock}";
-   $no_stocks = db_result(db_query($sql));
-   if ($no_stocks != 0) {
-      $stocks = tripal_stock_get_all_stocks();
-      if ($no_stocks != count($stocks)) {
-         drupal_set_message("Synchronization needed.");
-      }
-      return theme('tripal_stock_stock_table', &$stocks);
-   }
-   else {
-      return t("No Stocks exists. Please contact administrators to " .
-               "synchronize stocks.");
-   }
+  $no_stocks = db_result(db_query($sql));
+  if ($no_stocks != 0) {
+    $stocks = tripal_stock_get_all_stocks();
+    if ($no_stocks != count($stocks)) {
+      drupal_set_message(t("Synchronization needed."));
+    }
+    return theme('tripal_stock_stock_table', &$stocks);
+  }
+  else {
+    return t("No Stocks exists. Please contact administrators to " .
+             "synchronize stocks.");
+  }
 }
 
 /**
@@ -345,7 +345,7 @@ function theme_tripal_stock_stock_table(&$stocks) {
   $output .= "</table>";
   $output .= "</div>";
 
-   return $output;
+  return $output;
 }
 
 /**
@@ -677,7 +677,7 @@ function chado_stock_insert($node) {
         $values['version'] = '1';
         $dbxref_status = tripal_core_chado_insert('dbxref', $values);
         if (!$dbxref_status) {
-          drupal_set_message('Unable to add database reference to this stock.', 'warning');
+          drupal_set_message(t('Unable to add database reference to this stock.'), 'warning');
           watchdog('tripal_stock',
             'Insert Stock: Unable to create dbxref where values:%values',
             array('%values' => print_r($values, TRUE)),
@@ -739,7 +739,7 @@ function chado_stock_insert($node) {
       }
     }
     else {
-      drupal_set_message('Error during stock creation.', 'error');
+      drupal_set_message(t('Error during stock creation.'), 'error');
       watchdog('tripal_stock',
         'Insert Stock: Unable to find newly created stock where values:%values',
         array('%values' => print_r($values, TRUE)),
@@ -749,7 +749,7 @@ function chado_stock_insert($node) {
     }
   }
   else {
-    drupal_set_message('Error during stock creation.', 'error');
+    drupal_set_message(t('Error during stock creation.'), 'error');
     watchdog('tripal_stock',
       'Insert Stock: Unable to create stock where values:%values',
       array('%values' => print_r($values, TRUE)),
@@ -820,7 +820,7 @@ function chado_stock_update($node) {
             $dbxref_mode = 'Create';
           }
           else {
-            drupal_set_message('Unable to find stock to Update', 'error');
+            drupal_set_message(t('Unable to find stock to Update'), 'error');
             watchdog(
               'tripal_stock',
               'Stock Update: Unable to find stock to update using values: %values',
@@ -863,7 +863,7 @@ function chado_stock_update($node) {
     );
 
     if (!$status) {
-      drupal_set_message('Unable to update stock', 'error');
+      drupal_set_message(t('Unable to update stock'), 'error');
       watchdog(
         'tripal_stock',
         'Stock Update: Unable to update stock using match values: %mvalues and update values: %uvalues',
@@ -943,39 +943,39 @@ function tripal_stock_block($op = 'list', $delta = 0, $edit=array()) {
 
       return $blocks;
 
-     case 'view':
-       if (user_access('access chado_stock content') and arg(0) == 'node' and is_numeric(arg(1))) {
-        $nid = arg(1);
-        $node = node_load($nid);
-
-        $block = array();
-        switch ($delta) {
-          case 'base':
-            $block['subject'] = t('Stock Details');
-            $block['content'] = theme('tripal_stock_base', $node);
-            break;
-
-          case 'properties':
-            $block['subject'] = t('Properties');
-            $block['content'] = theme('tripal_stock_properties', $node);
-            break;
-
-          case 'references':
-            $block['subject'] = t('References');
-            $block['content'] = theme('tripal_stock_references', $node);
-            break;
-
-          case 'relationships':
-            $block['subject'] = t('Relationships');
-            $block['content'] = theme('tripal_stock_relationships', $node);
-            break;
-
-          case 'synonyms':
-            $block['subject'] = t('Synonyms');
-            $block['content'] = theme('tripal_stock_synonyms', $node);
-            break;
+    case 'view':
+      if (user_access('access chado_stock content') and arg(0) == 'node' and is_numeric(arg(1))) {
+      $nid = arg(1);
+      $node = node_load($nid);
+
+      $block = array();
+      switch ($delta) {
+        case 'base':
+          $block['subject'] = t('Stock Details');
+          $block['content'] = theme('tripal_stock_base', $node);
+          break;
+
+        case 'properties':
+          $block['subject'] = t('Properties');
+          $block['content'] = theme('tripal_stock_properties', $node);
+          break;
+
+        case 'references':
+          $block['subject'] = t('References');
+          $block['content'] = theme('tripal_stock_references', $node);
+          break;
+
+        case 'relationships':
+          $block['subject'] = t('Relationships');
+          $block['content'] = theme('tripal_stock_relationships', $node);
+          break;
+
+        case 'synonyms':
+          $block['subject'] = t('Synonyms');
+          $block['content'] = theme('tripal_stock_synonyms', $node);
+          break;
 
-        }
+      }
         return $block;
       }
   }

+ 45 - 45
tripal_stock/tripal_stock.views.inc

@@ -38,7 +38,7 @@ function tripal_stock_views_data()  {
     );
     foreach ($tables as $tablename) {
       if (!tripal_views_is_integrated($tablename, 10)) {
-        $table_integration_array = tripal_views_get_integration_array_for_chado_table($tablename,TRUE);
+        $table_integration_array = tripal_views_get_integration_array_for_chado_table($tablename, TRUE);
         tripal_views_integration_add_entry($table_integration_array);
       }
     }
@@ -57,7 +57,7 @@ function tripal_stock_views_data()  {
     );
     foreach ($tables as $tablename) {
       if (!tripal_views_is_integrated($tablename, 10)) {
-        $table_integration_array = tripal_views_get_integration_array_for_chado_table($tablename,FALSE);
+        $table_integration_array = tripal_views_get_integration_array_for_chado_table($tablename, FALSE);
         tripal_views_integration_add_entry($table_integration_array);
       }
     }
@@ -79,46 +79,46 @@ function tripal_stock_views_data()  {
  * @ingroup tripal_stock_views
  */
 function tripal_stock_views_handlers() {
- return array(
-   'info' => array(
-     'path' => drupal_get_path('module', 'tripal_stock') . '/views/handlers',
-   ),
-   'handlers' => array(
-     'views_handler_field_computed_stock_nid' => array(
-       'parent' => 'views_handler_field_numeric',
-     ),
-     'views_handler_field_stockprop_by_type' => array(
-       'parent' => 'views_handler_field_prerender_list',
-     ),
-    'views_handler_field_stockprop_all' => array(
-       'parent' => 'views_handler_field_prerender_list',
-     ),
-    'views_handler_field_stockrel_by_type' => array(
-       'parent' => 'views_handler_field_prerender_list',
-     ),
-    'views_handler_field_stockrel_all' => array(
-       'parent' => 'views_handler_field_prerender_list',
-     ),
-    'views_handler_field_stock_dbxref_by_type' => array(
-       'parent' => 'views_handler_field_prerender_list',
-     ),
-    'views_handler_field_stock_dbxref_all' => array(
-       'parent' => 'views_handler_field_prerender_list',
-     ),
-     'views_handler_filter_stockprop_id' => array(
-       'parent' => 'views_handler_filter',
-     ),
-     'views_handler_filter_stock_dbxref_id' => array(
-       'parent' => 'views_handler_filter',
-     ),
-     'views_handler_filter_stock_relationship_id' => array(
-       'parent' => 'views_handler_filter',
-     ),
-     'views_handler_argument_stockprop_id' => array(
-       'parent' => 'views_handler_argument_string',
-     ),
-   ),
- );
+  return array(
+  'info' => array(
+    'path' => drupal_get_path('module', 'tripal_stock') . '/views/handlers',
+  ),
+  'handlers' => array(
+    'views_handler_field_computed_stock_nid' => array(
+      'parent' => 'views_handler_field_numeric',
+    ),
+  'views_handler_field_stockprop_by_type' => array(
+    'parent' => 'views_handler_field_prerender_list',
+    ),
+  'views_handler_field_stockprop_all' => array(
+    'parent' => 'views_handler_field_prerender_list',
+    ),
+  'views_handler_field_stockrel_by_type' => array(
+    'parent' => 'views_handler_field_prerender_list',
+    ),
+  'views_handler_field_stockrel_all' => array(
+    'parent' => 'views_handler_field_prerender_list',
+    ),
+  'views_handler_field_stock_dbxref_by_type' => array(
+    'parent' => 'views_handler_field_prerender_list',
+    ),
+  'views_handler_field_stock_dbxref_all' => array(
+    'parent' => 'views_handler_field_prerender_list',
+    ),
+  'views_handler_filter_stockprop_id' => array(
+    'parent' => 'views_handler_filter',
+    ),
+  'views_handler_filter_stock_dbxref_id' => array(
+    'parent' => 'views_handler_filter',
+    ),
+  'views_handler_filter_stock_relationship_id' => array(
+    'parent' => 'views_handler_filter',
+    ),
+  'views_handler_argument_stockprop_id' => array(
+    'parent' => 'views_handler_argument_string',
+    ),
+  ),
+  );
 }
 
 /**
@@ -183,7 +183,7 @@ function tripal_stock_views_pre_render  (&$view) {
           ."WHERE stockprop.stock_id IN (" . implode(',', $stock_ids) . ")";
         $previous_db = tripal_db_set_active('chado');
         $resource = db_query($sql);
-       tripal_db_set_active($previous_db);
+        tripal_db_set_active($previous_db);
 
         $view->result[$key]->properties = array();
         while ($r = db_fetch_object($resource)) {
@@ -206,7 +206,7 @@ function tripal_stock_views_pre_render  (&$view) {
           ."OR stock_relationship.object_id IN (" . implode(',', $stock_ids) . ") ";
         $previous_db = tripal_db_set_active('chado');
         $resource = db_query($sql);
-       tripal_db_set_active($previous_db);
+        tripal_db_set_active($previous_db);
 
         while ($r = db_fetch_object($resource)) {
           if (in_array($r->subject_id, $stock_ids)) {
@@ -234,7 +234,7 @@ function tripal_stock_views_pre_render  (&$view) {
           ."WHERE stock_dbxref.stock_id IN (" . implode(',', $stock_ids) . ")";
         $previous_db = tripal_db_set_active('chado');
         $resource = db_query($sql);
-       tripal_db_set_active($previous_db);
+        tripal_db_set_active($previous_db);
 
         $view->result[$key]->dbxref = array();
         while ($r = db_fetch_object($resource)) {