Ver Fonte

Tripal Stock adheres to Drupal coding standards

Pubudu Basnayaka há 12 anos atrás
pai
commit
229ac4b4b1

+ 4 - 0
tripal_stock/other_module_api_functions.inc

@@ -1,4 +1,8 @@
 <?php
+/**
+ * @file
+ * @todo Add file header description
+ */
 
 ///////////////////////////////////////////////////////////////////////////
 // Module: tripal_core

+ 4 - 1
tripal_stock/tripal_stock-administration.inc

@@ -1,5 +1,8 @@
 <?php
-
+/**
+ * @file
+ * @todo Add file header description
+ */
 
 /**
  * Purpose: Provide Guidance to new Tripal Admin

+ 4 - 1
tripal_stock/tripal_stock-db_references.inc

@@ -1,5 +1,8 @@
 <?php
-
+/**
+ * @file
+ * @todo Add file header description
+ */
 
 /**
  * Display the ADD Database References to Stock Page

+ 4 - 0
tripal_stock/tripal_stock-properties.inc

@@ -1,4 +1,8 @@
 <?php
+/**
+ * @file
+ * @todo Add file header description
+ */
 
 /**
  *

+ 5 - 1
tripal_stock/tripal_stock-relationships.inc

@@ -1,4 +1,8 @@
 <?php
+/**
+ * @file
+ * @todo Add file header description
+ */
 
 /**
  *
@@ -273,7 +277,7 @@ function tripal_stock_edit_ALL_relationships_form($form_state, $node) {
       '#required'   => TRUE,
       '#size' => 30,
       '#default_value' => $default,
-      '#description' => $description,
+      '#description' => t('%description', array('%description' => $description)),
     );
 
     $type_options = tripal_cv_get_cvterm_options( variable_get('chado_stock_relationship_cv', 'null') );

+ 5 - 1
tripal_stock/tripal_stock-secondary_tables.inc

@@ -1,4 +1,8 @@
 <?php
+/**
+ * @file
+ * @todo Add file header description
+ */
 
 /**
  *
@@ -161,7 +165,7 @@ function tripal_stock_add_chado_properties_navigate_submit($form, $form_state) {
 
   if (strcmp($current_index, 'EMPTY') == 0) {
     // No Matching Step
-    drupal_set_message('Could not determine next step -' . $form_state['values']['current_step'] . ', please contact the administrator', 'error');
+    drupal_set_message(t('Could not determine next step - %currentstep, please contact the administrator', array('%currentstep' => $form_state['values']['current_step'])), 'error');
   }
   elseif ($current_index == 0) {
     $next_goto = $steps[$current_index+1][1];

+ 4 - 0
tripal_stock/tripal_stock.api.inc

@@ -1,4 +1,8 @@
 <?php
+/**
+ * @file
+ * @todo Add file header description
+ */
 
 /**
  * @defgroup tripal_stock_api Stock Module API

+ 12 - 2
tripal_stock/views/handlers/views_handler_filter_stock_relationship_id.inc

@@ -1,4 +1,8 @@
 <?php
+/**
+ * @file
+ * @todo Add file header description
+ */
 
 class views_handler_filter_stock_relationship_id extends views_handler_filter {
 
@@ -78,7 +82,7 @@ class views_handler_filter_stock_relationship_id extends views_handler_filter {
           $this->query->add_where($this->options['group'], $where);
         }
         else {
-          drupal_set_message('No stock with the name or uniquename ' . $this->value . ' was found -No filtering done.', 'error');
+          drupal_set_message(t('No stock with the name or uniquename %value was found -No filtering done.',  array('%value' => $this->value ), 'error'));
         }
       } //end of not just checking presence
     }
@@ -135,9 +139,15 @@ class views_handler_filter_stock_relationship_id extends views_handler_filter {
   function value_form(&$form, &$form_state) {
     parent::value_form($form, $form_state);
 
+    if ($this->options['label']) {
+      $label = $this->options['label'];
+    }
+    else {
+      $label = 'Stock Name';
+    }
     $form['value'] = array(
       '#type' => 'textfield',
-      '#title' => ($this->options['label']) ? $this->options['label'] : t('Stock Name'),
+      '#title' => t('%label', array('%label' => $label)),
       '#default_value' => $this->value,
       '#size' => 40,
     );

+ 2 - 2
tripal_stock/views/handlers/views_handler_filter_stockprop_id.inc

@@ -40,7 +40,7 @@ class views_handler_filter_stockprop_id extends views_handler_filter {
     if (preg_match('/NULL/', $form_state['values']['options']['operator'])) {
       $value = $form_state['values']['options']['value'];
       if (!empty($value)) {
-        drupal_set_message('The Value (' . $value . ') will be IGNORED when the Operator is set to "Is Present" or Is Absent".', 'warning');
+        drupal_set_message(t('The Value %value will be IGNORED when the Operator is set to "Is Present" or Is Absent". ', array('%value' => $value), 'warning'));
       }
     }
     else {
@@ -107,7 +107,7 @@ class views_handler_filter_stockprop_id extends views_handler_filter {
       }
       $form['value'] = array(
         '#type' => 'select',
-        '#title' => $this->options['label'],
+        '#title' => t('%label', array('%title' => $this->options['label'])),
         '#options' => $options,
         '#default_value' => $this->value,
       );