Przeglądaj źródła

Issue #72: Updating API to include 2.1 improvements: eca6739

Stephen Ficklin 7 lat temu
rodzic
commit
a9bcbcd4c8

+ 6 - 6
legacy/tripal_core/api/tripal_core.DEPRECATED.inc

@@ -794,7 +794,7 @@ function tripal_job_set_progress($job_id, $percentage) {
 /**
  * @deprecated Restructured API to make naming more readable and consistent.
  * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
- * This function has been replaced by tripal_refresh_mview(),  and 
+ * This function has been replaced by tripal_refresh_mview(),  and
  * tripal_delete_mview().
  *
  * @see tripal_refresh_mview() or tripal_delete_mview().
@@ -897,7 +897,7 @@ function tripal_mviews_get_mview_id($view_name) {
       '%new_function' => 'tripal_get_mview_id'
     )
   );
-  
+
   //New API Function
   return tripal_get_mview_id($view_name);
 }
@@ -915,7 +915,7 @@ function tripal_core_delete_property_by_id($basetable, $property_id) {
     'tripal_deprecated',
     TRIPAL_NOTICE,
     "DEPRECATED: %old_function has been replaced with %new_function. This requires manual
-      intervention since the arguements for the two functions are different.
+      intervention since the arguments for the two functions are different.
       Please update your code.",
     array(
       '%old_function'=>'tripal_core_delete_property_by_id',
@@ -958,7 +958,7 @@ function tripal_core_delete_property($basetable, $record_id, $property, $cv_name
     'type_name' => $property,
     'cv_name' => $cv_name,
   );
-  
+
   //New API Function
   return chado_delete_property($record, $property);
 }
@@ -980,7 +980,7 @@ function tripal_core_get_property($basetable, $record_id, $property, $cv_name) {
       '%new_function' => 'chado_get_property'
     )
   );
-  
+
   $record = array(
     'table' => $basetable,
     'id' => $record_id
@@ -1101,7 +1101,7 @@ function tripal_core_update_property_by_id($basetable, $record_id, $property,
     'cv_name' => $cv_name,
     'value' => $value,
   );
-  
+
   // New API Function.
   return chado_update_property($record, $property);
 }

+ 1 - 1
legacy/tripal_core/api/tripal_core.chado_nodes.api.inc

@@ -1245,7 +1245,7 @@ function hook_chado_node_sync_form($form, &$form_state) {
  *
  * Allows you to use this function as your own submit.
  *
- * This might be necessary if you want to add additional arguements to the
+ * This might be necessary if you want to add additional arguments to the
  * tripal job or to call your own sync'ing function if the generic
  * chado_node_sync_records() is not sufficient.
  *

+ 1 - 1
tripal/tripal.views.inc

@@ -326,7 +326,7 @@ function tripal_views_data_jobs(&$data) {
   // Arguments
   $data['tripal_jobs']['arguments'] = array(
     'title' => t('Arguements'),
-    'help' => t('Any arguements passed to the callback.'),
+    'help' => t('Any arguments passed to the callback.'),
     'field' => array(
       'handler' => 'views_handler_field',
       'click sortable' => TRUE, // This is use by the table display plugin.

+ 2 - 2
tripal/views_handlers/tripal_views_handler_filter_select_string.inc

@@ -88,7 +88,7 @@ class tripal_views_handler_filter_string_selectbox extends views_handler_filter_
 
     $return = $this->get_select_option_where();
     $where_clauses = $return['where_clauses'];
-    $arguements = $return['arguements'];
+    $arguments = $return['arguments'];
     $where = '';
     if (!empty($where_clauses)) {
       $where = ' WHERE ' . implode(' AND ', $where_clauses);
@@ -96,7 +96,7 @@ class tripal_views_handler_filter_string_selectbox extends views_handler_filter_
 
     // get the values from the table
     $sql = 'SELECT ' . $this->real_field . ' FROM {' . $this->table . '} ' . $where . ' ORDER BY ' . $this->field . ' ASC';
-    $results = db_query($sql, $arguements);
+    $results = db_query($sql, arguments);
 
     // Build the select box options
     $max_length = (isset($this->options['max_length'])) ? $this->options['max_length'] : 40;

+ 1 - 1
tripal_bulk_loader/tripal_bulk_loader.module

@@ -460,7 +460,7 @@ function tripal_bulk_loader_progess_file_get_progress($job_id, $update_progress
  * @params $callback
  *   The callback passed into tripal_add_job()
  * @param $args
- *   The arguements passed into tripal_add_job()
+ *   The arguments passed into tripal_add_job()
  * @return
  *   An array where keys are the human readable headers describing each arguement
  *   and the value is the aguement passed in after formatting

+ 1 - 1
tripal_chado/api/tripal_chado.query.api.inc

@@ -1706,7 +1706,7 @@ function chado_query($sql, $args = array()) {
  *    indicated by :tokens with values being in the $args array and all tables should
  *    be prefixed with the schema name described in tripal_get_schema_name().
  * @param $args
- *    An array of arguements where the key is the token used in $sql (for example, :value)
+ *    An array of arguments where the key is the token used in $sql (for example, :value)
  *    and the value is the value you would like substituted in.
  */
 function hook_chado_query_alter(&$sql, &$args) {

+ 1 - 1
tripal_chado/tripal_chado.module

@@ -867,7 +867,7 @@ function tripal_chado_exclude_type_by_default() {
 /**
  * Implements hook_job_describe_args().
  *
- * Describes the arguements for the tripal_populate_mview job to allow for
+ * Describes the arguments for the tripal_populate_mview job to allow for
  * greater readability in the jobs details pages.
  *
  * @param $callback

+ 16 - 15
tripal_chado_views/views/handlers/tripal_views_handler_filter_select_cvterm.inc

@@ -7,19 +7,20 @@
 /**
  * This Handler provides a select list for the type field
  *
- *  NOTE: This handler only works when applied to the type_id field in the base_table of
- *  this view.
+ *  NOTE: This handler only works when applied to the type_id field in the
+ *  base_table of this view.
  *
  * @ingroup tripal_views
  */
-class tripal_views_handler_filter_select_cvterm extends tripal_views_handler_filter_select_string {
+class tripal_views_handler_filter_select_cvterm extends views_handler_filter_string {
 
   /**
    * Provide the options used in the select list.
    * Override this function in extended handlers to easily change option list.
    *
    * @return
-   *   An array of options where the key is the value of this field in the database
+   *   An array of options where the key is the value of this field in the
+   *   database
    */
   function get_select_options() {
 
@@ -36,7 +37,7 @@ class tripal_views_handler_filter_select_cvterm extends tripal_views_handler_fil
 
         $return = $this->get_select_option_where($this->table);
         $where_clauses = $return['where_clauses'];
-        $arguements = $return['arguements'];
+        $arguments = $return['arguments'];
         $base_where = '';
         if (!empty($where_clauses)) {
           $base_where = implode(' AND ', $where_clauses);
@@ -69,7 +70,7 @@ class tripal_views_handler_filter_select_cvterm extends tripal_views_handler_fil
         // show these exact types.
         $return = $this->get_select_option_where('cvterm');
         $where_clauses = $return['where_clauses'];
-        $cvterm_args = $return['arguements'];
+        $cvterm_args = $return['arguments'];
         $cvterm_where = '';
         if (!empty($where_clauses)) {
           $cvterm_where = implode(' AND ', $where_clauses);
@@ -78,13 +79,13 @@ class tripal_views_handler_filter_select_cvterm extends tripal_views_handler_fil
         // have been used.
         $return = $this->get_select_option_where($this->table);
         $where_clauses = $return['where_clauses'];
-        $base_args = $return['arguements'];
+        $base_args = $return['arguments'];
         $base_where = '';
         if (!empty($where_clauses)) {
           $base_where = implode(' AND ', $where_clauses);
         }
-        // We only supply one set or arguements those so merge the two.
-        $arguements = array_merge($cvterm_args, $base_args);
+        // We only supply one set or arguments those so merge the two.
+        $arguments = array_merge($cvterm_args, $base_args);
 
         // Using a "Loose Index Scan" to get a list of all the cvs used
         // in the table the drop-down filter is from.
@@ -110,7 +111,7 @@ class tripal_views_handler_filter_select_cvterm extends tripal_views_handler_fil
             ORDER BY cvterm.name ASC";
         $sql = format_string($sql, array('!table' => $this->table, '!field' => $this->field));
       }
-      $resource = chado_query($sql, $arguements);
+      $resource = chado_query($sql, $arguments);
 
       // Now actually gerenate the select list
       // based on the results from the above query.
@@ -130,7 +131,7 @@ class tripal_views_handler_filter_select_cvterm extends tripal_views_handler_fil
       // show these exact types.
       $return = $this->get_select_option_where('cvterm');
       $where_clauses = $return['where_clauses'];
-      $cvterm_args = $return['arguements'];
+      $cvterm_args = $return['arguments'];
       $cvterm_where = '';
       if (!empty($where_clauses)) {
         $cvterm_where = implode(' AND ', $where_clauses);
@@ -139,13 +140,13 @@ class tripal_views_handler_filter_select_cvterm extends tripal_views_handler_fil
       // have been used.
       $return = $this->get_select_option_where($this->table);
       $where_clauses = $return['where_clauses'];
-      $base_args = $return['arguements'];
+      $base_args = $return['arguments'];
       $base_where = '';
       if (!empty($where_clauses)) {
         $base_where = implode(' AND ', $where_clauses);
       }
-      // We only supply one set or arguements those so merge the two.
-      $arguements = array_merge($cvterm_args, $base_args);
+      // We only supply one set or arguments those so merge the two.
+      $arguments = array_merge($cvterm_args, $base_args);
 
       // Using a "Loose Index Scan" to get a list of all the cvterms used
       // in the base table. See https://wiki.postgresql.org/wiki/Loose_indexscan
@@ -167,7 +168,7 @@ class tripal_views_handler_filter_select_cvterm extends tripal_views_handler_fil
           ORDER BY cvterm.name ASC";
       $sql = format_string($sql, array('!table' => $this->table, '!field' => $this->field));
 
-      $resource = chado_query($sql, $arguements);
+      $resource = chado_query($sql, $arguments);
       $cvterms = array();
 
       // Add an "- Any - " option to allow a type to not be set by default.

+ 5 - 5
tripal_chado_views/views/handlers/tripal_views_handler_filter_select_id.inc

@@ -1,7 +1,7 @@
 <?php
 /**
  * @file
- * Contains tripal_views_handler_filter_select_cvterm
+ * Contains tripal_views_handler_filter_select_id
  */
 
 /**
@@ -48,10 +48,10 @@ class tripal_views_handler_filter_select_id extends tripal_views_handler_filter_
     if (isset($this->options['show_all']) AND $this->options['show_all'] == TRUE) {
 
       // We still want to use any hidden fitlers on the parent table
-      // but the arguements will need to be field names rather than
+      // but the arguments will need to be field names rather than
       // generic placeholders so we need to tell get_select_option_where() that.
       $return = $this->get_select_option_where($this->parent_table, FALSE);
-      $args = $return['arguements'];
+      $args = $return['arguments'];
 
       // Simply grab all the values from the table referenced by
       // the foreign key constraint. Since we use the id as the key of
@@ -67,7 +67,7 @@ class tripal_views_handler_filter_select_id extends tripal_views_handler_filter_
 
       $return = $this->get_select_option_where($this->parent_table);
       $where_clauses = $return['where_clauses'];
-      $arguements = $return['arguements'];
+      $arguments = $return['arguments'];
       $where = '';
       if (!empty($where_clauses)) {
         $where = implode(' AND ', $where_clauses);
@@ -102,7 +102,7 @@ class tripal_views_handler_filter_select_id extends tripal_views_handler_filter_
         '!name_field' => $name_field
       ));
 
-      $resource = chado_query($sql, $arguements);
+      $resource = chado_query($sql, $arguments);
       $options = array();
 
       if ($this->options['select_optional']) {

+ 3 - 3
tripal_chado_views/views/handlers/tripal_views_handler_filter_select_string.inc

@@ -88,7 +88,7 @@ class tripal_views_handler_filter_select_string extends views_handler_filter_str
 
     $return = $this->get_select_option_where();
     $where_clauses = $return['where_clauses'];
-    $arguements = $return['arguements'];
+    $arguments = $return['arguments'];
     $where = '';
     if (!empty($where_clauses)) {
       $where = ' WHERE ' . implode(' AND ', $where_clauses);
@@ -96,7 +96,7 @@ class tripal_views_handler_filter_select_string extends views_handler_filter_str
 
     // get the values from the table
     $sql = 'SELECT ' . $this->real_field . ' FROM {' . $this->table . '} ' . $where . ' ORDER BY ' . $this->field . ' ASC';
-    $results = chado_query($sql, $arguements);
+    $results = chado_query($sql, $arguments);
 
     // Build the select box options
     $max_length = (isset($this->options['max_length'])) ? $this->options['max_length'] : 40;
@@ -177,7 +177,7 @@ class tripal_views_handler_filter_select_string extends views_handler_filter_str
 
     return array(
       'where_clauses' => $where,
-      'arguements' => $values
+      'arguments' => $values
     );
   }
 

+ 1 - 1
tripal_daemon/TripalDaemon.inc

@@ -204,7 +204,7 @@ class TripalDaemon extends DrushDaemon {
     drush_invoke_process(
       '@self',                               // Obviously run on the current site.
       'trp-run-jobs',                        // Run the tripal job launcher.
-      array(),                               // No arguements (only options below).
+      array(),                               // No arguments (only options below).
       array(
         'job_id' => $job_id,                 // The job to be run.
         'username' => $username,             // The user to run it as.