Pārlūkot izejas kodu

Tripal Organism now adhere to Drupal coding standards

Pubudu Basnayaka 12 gadi atpakaļ
vecāks
revīzija
e6e051e53d

+ 36 - 30
tripal_organism/tripal_organism.api.inc

@@ -1,10 +1,15 @@
 <?php
- 
-/*************************************************************************
+
+/**
+ * @file
+ * Provides an API to tripal organisms
+ */
+
+/**
  * Purpose: Create an options array to be used in a form element
  *   which provides a list of all chado organisms
  *
- * @return an array(organism_id => common_name) 
+ * @return an array(organism_id => common_name)
  *   for each organism in the chado organism table
  *
  * @ingroup tripal_organism_api
@@ -13,7 +18,7 @@ function tripal_organism_get_organism_options() {
 
   $previous_db = tripal_db_set_active('chado');
   $result = db_query(
-    "SELECT organism_id, common_name FROM organism"
+    "SELECT organism_id, common_name FROM {organism}"
   );
   tripal_db_set_active($previous_db);
 
@@ -26,41 +31,42 @@ function tripal_organism_get_organism_options() {
 
 }
 
-/*************************************************************************
+/**
  * Purpose: Return a given organism object using the nid
  *
  * @return organism object created by node load
  *
  * @ingroup tripal_organism_api
  */
-function tripal_organism_get_organism_by_nid ($nid) {
+function tripal_organism_get_organism_by_nid($nid) {
+
+  return node_load($nid);
 
-	return node_load($nid);
-	
 }
 
-/*************************************************************************
+/**
  * Purpose: Return a given organism object using the organism id
  *
  * @return organism object created by node load
  *
  * @ingroup tripal_organism_api
  */
-function tripal_organism_get_organism_by_organism_id ($organism_id) {
-
-	$sql = "SELECT nid FROM {chado_organism} WHERE organism_id=%d";
-	$r = db_fetch_object(db_query($sql, $organism_id));
-	if (!empty($r->nid)) {
-		return node_load($r->nid);
-	} else {
-		drupal_set_message("Function: tripal_organism_get_organism_by_organism_id() -no organism with that organism id sync'd with drupal", 'error');
-	}
-	
-	return 0;
-	
+function tripal_organism_get_organism_by_organism_id($organism_id) {
+
+  $sql = "SELECT nid FROM {chado_organism} WHERE organism_id=%d";
+  $r = db_fetch_object(db_query($sql, $organism_id));
+  if (!empty($r->nid)) {
+    return node_load($r->nid);
+  }
+  else {
+    drupal_set_message("Function: tripal_organism_get_organism_by_organism_id() -no organism with that organism id sync'd with drupal", 'error');
+  }
+
+  return 0;
+
 }
 
-/****************************************************************************
+/*****
  * @section Chado Table Descriptions
  * There should be a default table description for all chado tables included
  * in core.
@@ -79,7 +85,7 @@ function tripal_organism_get_organism_by_organism_id ($organism_id) {
  */
 function tripal_organism_chado_organism_schema() {
   $description = array();
-  
+
   $referring_tables = array(
     'biomaterial',
     'feature',
@@ -91,7 +97,7 @@ function tripal_organism_chado_organism_schema() {
     'wwwuser_organism'
   );
   $description['referring_tables'] = $referring_tables;
-  
+
   return $description;
 }
 
@@ -108,21 +114,21 @@ function tripal_organism_chado_organism_schema() {
  */
 function tripal_organism_chado_organismprop_schema() {
   $description = array();
-  
+
   $description['foreign keys']['cvterm'] = array(
         'table' => 'cvterm',
         'columns' => array(
           'type_id' => 'cvterm_id',
         ),
   );
-  
+
   $description['foreign keys']['organism'] = array(
         'table' => 'organism',
         'columns' => array(
           'organism_id' => 'organism_id',
         ),
   );
-  
+
   return $description;
 }
 /**
@@ -142,11 +148,11 @@ function tripal_organism_get_synced() {
    $org_list = array();
 
    // iterate through the organisms and build an array of those that are synced
-   while($org = db_fetch_object($orgs)){
+   while ($org = db_fetch_object($orgs)) {
       $previous_db = tripal_db_set_active('chado');  // use chado database
-      $info = db_fetch_object(db_query($csql,$org->organism_id));
+      $info = db_fetch_object(db_query($csql, $org->organism_id));
       tripal_db_set_active($previous_db);  // now use drupal database
       $org_list[] = $info;
-   }  
+   }
    return $org_list;
 }

+ 15 - 10
tripal_organism/tripal_organism.install

@@ -1,22 +1,27 @@
 <?php
 
+/**
+ * @file
+ * Functions pertaining to the install/uninstall of this module
+ */
+
 /**
 *  Implementation of hook_install();
 *
 * @ingroup tripal_organism
 */
-function tripal_organism_install(){
+function tripal_organism_install() {
 
    // create the module's data directory
    tripal_create_moddir('tripal_organism');
 
-   // create the directory where image files will be stored.  We create this 
+   // create the directory where image files will be stored.  We create this
    // here otherwise it will get created when the first organism is synced.
-   // The user that performs the syncing will receive ownership of the 
+   // The user that performs the syncing will receive ownership of the
    // images directory which may not allow for write access by the web server
    // user.  So, we create it here
    $dest = file_directory_path() . "/tripal/tripal_organism/images";
-   file_check_directory($dest,FILE_CREATE_DIRECTORY);
+   file_check_directory($dest, FILE_CREATE_DIRECTORY);
 
    // create the tables that correlate drupal nodes with chado
    // features, organisms, etc....
@@ -31,7 +36,7 @@ function tripal_organism_install(){
 */
 function tripal_organism_schema() {
    $schema = tripal_organism_get_schemas();
-	return $schema;
+  return $schema;
 }
 
 /**
@@ -39,7 +44,7 @@ function tripal_organism_schema() {
 *
 * @ingroup tripal_organism
 */
-function tripal_organism_uninstall(){
+function tripal_organism_uninstall() {
    drupal_uninstall_schema('tripal_organism');
 
    // Get the list of nodes to remove
@@ -52,11 +57,11 @@ function tripal_organism_uninstall(){
    }
 
    // remove the materialized views
-   
+
    // Remove the custom view if exists
    if (db_table_exists('tripal_organism_views_common_name')) {
       $sql = "DROP TABLE {tripal_organism_views_common_name}";
-      db_query ($sql);
+      db_query($sql);
    }
 }
 
@@ -68,7 +73,7 @@ function tripal_organism_uninstall(){
 *
 * @ingroup tripal_organism
 */
-function tripal_organism_get_schemas (){
+function tripal_organism_get_schemas() {
   $schema = array();
 
   $schema['chado_organism'] = array(
@@ -95,7 +100,7 @@ function tripal_organism_get_schemas (){
          'organism_id' => array('organism_id')
       ),
       'unique keys' => array(
-         'nid_vid' => array('nid','vid'),
+         'nid_vid' => array('nid', 'vid'),
          'vid' => array('vid')
       ),
       'primary key' => array('nid'),

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 230 - 222
tripal_organism/tripal_organism.module


+ 11 - 11
tripal_organism/tripal_organism.views.inc

@@ -6,7 +6,7 @@
  *  chado/tripal organism tables. Supplementary functions can be found in
  *  ./views/
  *
- *  Documentation on views integration can be found at 
+ *  Documentation on views integration can be found at
  *  http://views2.logrus.com/doc/html/index.html.
  */
 
@@ -17,13 +17,13 @@
  */
 
 require_once('views/organism.views.inc');
-require_once('views/chado_organism.views.inc'); 
+require_once('views/chado_organism.views.inc');
 /**
  * Implements hook_views_data()
  * Purpose: Describe chado/tripal tables & fields to views
  * @return: a data array which follows the structure outlined in the
  *   views2 documentation for this hook. Essentially, it's an array of table
- *   definitions keyed by chado/tripal table name. Each table definition 
+ *   definitions keyed by chado/tripal table name. Each table definition
  *   includes basic details about the table, fields in that table and
  *   relationships between that table and others (joins)
  *
@@ -31,17 +31,17 @@ require_once('views/chado_organism.views.inc');
  */
 function tripal_organism_views_data()  {
   $data = array();
-  
+
   $data = array_merge($data, retrieve_organism_views_data());
   $data = array_merge($data, retrieve_chado_organism_views_data());
-  
+
   return $data;
 }
 
 /**
  * Implements hook_views_handlers()
  * Purpose: Register all custom handlers with views
- *   where a handler describes either "the type of field", 
+ *   where a handler describes either "the type of field",
  *   "how a field should be filtered", "how a field should be sorted"
  * @return: An array of handler definitions
  *
@@ -68,7 +68,7 @@ function tripal_organism_views_handlers() {
  */
 function tripal_organism_views_data_alter(&$data) {
 
-  if( !(is_array($db_url) and array_key_exists('chado',$db_url)) ){
+  if ( !(is_array($db_url) and array_key_exists('chado', $db_url)) ) {
 
     // Add featuer relationship to node
     $data['node']['organism_chado_nid'] = array(
@@ -86,16 +86,16 @@ function tripal_organism_views_data_alter(&$data) {
       ),
     );
   }
-  
+
 }
 
 /**
  *
  * @ingroup tripal_organism_views
  */
-function tripal_organism_views_default_views () {
+function tripal_organism_views_default_views() {
   $views = array();
-  
+
   // Main default view
   // List all cvterms based on cv
   $view = new view;
@@ -375,6 +375,6 @@ function tripal_organism_views_default_views () {
     'name' => 'navigation',
   ));
   $views[$view->name] = $view;
-  
+
   return $views;
 }

+ 24 - 23
tripal_organism/views/chado_organism.views.inc

@@ -1,7 +1,8 @@
 <?php
 
 /**
- * Purpose: this function returns the portion of the data array 
+ * @file
+ * Purpose: this function returns the portion of the data array
  *   which describes the chado_organism drupal table, it's fields and any joins between it and other tables
  * @see tripal_organism_views_data() --in tripal_organism.views.inc
  *
@@ -9,14 +10,14 @@
  *
  * @ingroup tripal_organism_views
  */
-function retrieve_chado_organism_views_data () {
-	global $db_url;
+function retrieve_chado_organism_views_data() {
+  global $db_url;
   $data = array();
-  
+
   // if the chado database is not local to the drupal database
   // then we need to set the database name.  This should always
   // be 'chado'.
-  if(is_array($db_url) and array_key_exists('chado',$db_url)){
+  if (is_array($db_url) and array_key_exists('chado', $db_url)) {
      // return empty data array b/c if chado is external then no join to the nodetable can be made
      return $data;
   }
@@ -26,42 +27,42 @@ function retrieve_chado_organism_views_data () {
     'field' => 'nid',
     'group' => 'Chado Organism'
   );
-  
+
   $data['chado_organism']['nid'] = array(
     'title' => t('Organism Node ID'),
     'help' => t('The node ID for this organism'),
     'field' => array(
-     	'handler' => 'views_handler_field_numeric',
- 		  'click sortable' => TRUE,
+       'handler' => 'views_handler_field_numeric',
+       'click sortable' => TRUE,
     ),
     'filter' => array(
-     	'handler' => 'views_handler_filter_numeric',
+       'handler' => 'views_handler_filter_numeric',
     ),
     'sort' => array(
-     	'handler' => 'views_handler_sort',
+       'handler' => 'views_handler_sort',
     ),
   );
 
   // Note: No joins need to be made from $data['organism']['table']
-  
+
   // Join the chado organism table to organism
   $data['chado_organism']['table']['join']['organism'] = array(
-  	'left_field' => 'organism_id',
-  	'field' => 'organism_id',
+    'left_field' => 'organism_id',
+    'field' => 'organism_id',
   );
-  
+
   // Join the node table to chado organism
   $data['node']['table']['join']['chado_organism'] = array(
-  	'left_field' => 'nid',
-  	'field' => 'nid',
+    'left_field' => 'nid',
+    'field' => 'nid',
   );
-  
+
   // Join the node table to organism
   $data['node']['table']['join']['organism'] = array(
-  	'left_table' => 'chado_organism',
-  	'left_field' => 'nid',
-  	'field' => 'nid',
-  );  
+    'left_table' => 'chado_organism',
+    'left_field' => 'nid',
+    'field' => 'nid',
+  );
 
   // Add relationship between chado_organism and organism
   $data['chado_organism']['organism_id'] = array(
@@ -94,6 +95,6 @@ function retrieve_chado_organism_views_data () {
       'base field' => 'nid'
     ),
   );
-*/  
-	return $data;
+*/
+  return $data;
 }

+ 12 - 12
tripal_organism/views/handlers/views_handler_field_computed_organism_nid.inc

@@ -1,17 +1,17 @@
 <?php
 
 class views_handler_field_computed_organism_nid extends views_handler_field_numeric {
-	function construct() {
-		parent::construct();
-		$this->additional_fields['organism_id'] = array('table' => 'organism', 'field' => 'organism_id');
-	}
+  function construct() {
+    parent::construct();
+    $this->additional_fields['organism_id'] = array('table' => 'organism', 'field' => 'organism_id');
+  }
 
-	function query() { 
-		$this->ensure_my_table();
-		$this->add_additional_fields(); 
-	}
+  function query() {
+    $this->ensure_my_table();
+    $this->add_additional_fields();
+  }
 
-	function render($values) { 
-		return $values->organism_nid;
-	}
-} 
+  function rend) {er($values) {
+    return $values->organism_nid;
+  }
+}

+ 26 - 24
tripal_organism/views/organism.views.inc

@@ -1,7 +1,8 @@
 <?php
 
 /**
- * Purpose: this function returns the portion of the data array 
+ * @file
+ * Purpose: this function returns the portion of the data array
  *   which describes the organism table, it's fields and any joins between it and other tables
  * @see tripal_organism_views_data() --in tripal_organism.views.inc
  *
@@ -25,25 +26,25 @@
  * @ingroup tripal_organism_views
  */
 function retrieve_organism_views_data() {
-	global $db_url;
-	$data = array();
-	
-	// if the chado database is not local to the drupal database
+  global $db_url;
+  $data = array();
+
+  // if the chado database is not local to the drupal database
   // then we need to set the database name.  This should always
   // be 'chado'.
-  if(is_array($db_url) and array_key_exists('chado',$db_url)){
+  if (is_array($db_url) and array_key_exists('chado', $db_url)) {
      $database = 'chado';
   }
 
-	
+
   // Basic table definition
   $data['organism']['table']['group'] = 'Chado Organism';
   $data['organism']['table']['base'] = array(
     'field' => 'organism_id',
     'title' => 'Chado Organism',
-    'help' => 'Organisms existing in the Chado Database',                                                                                                                                                                          
+    'help' => 'Organisms existing in the Chado Database',
   );
-  if($database){
+  if ($database) {
      $data['organism']['table']['base']['database'] = $database;
   }
 
@@ -61,7 +62,7 @@ function retrieve_organism_views_data() {
       'left_field' => 'organism_id',
       'field' => 'organism_id',
     ),
-  ); 
+  );
 
   // Table Field Definitions----------------------
   // Field: organism_id (primary key)
@@ -79,22 +80,23 @@ function retrieve_organism_views_data() {
        'handler' => 'views_handler_sort',
      ),
      'argument' => array(
-     	 'handler' => 'views_handler_argument',
+        'handler' => 'views_handler_argument',
      ),
   );
 
   // Calculated Field: Node ID
   //  use custom field handler to query drupal for the node ID
   //  this is only needed if chado is in a separate database from drupal
-  if($database && module_exists('tripal_views')){
-	  $data['organism']['organism_nid'] = array(
-  	  'title' => 'Node ID',
-    	'help' => 'This is the node ID of this organism. It can be used as a link to the node.',
-    	'field' => array(
-      	'handler' => 'views_handler_field_computed_organism_nid',
-    	),    
-  	);
-  } else {
+  if ($database && module_exists('tripal_views')) {
+    $data['organism']['organism_nid'] = array(
+      'title' => 'Node ID',
+      'help' => 'This is the node ID of this organism. It can be used as a link to the node.',
+      'field' => array(
+        'handler' => 'views_handler_field_computed_organism_nid',
+      ),
+    );
+  }
+  else {
     // Add relationship between chado_organism and organism
     $data['organism']['organism_id'] = array(
       'group' => 'Organism',
@@ -112,7 +114,7 @@ function retrieve_organism_views_data() {
     );
 
   }
-	
+
   // Field: abbreviation (varchar 255)
   $data['organism']['abbreviation'] = array(
     'title' => 'Abbreviation',
@@ -131,7 +133,7 @@ function retrieve_organism_views_data() {
        'handler' => 'views_handler_argument_string',
      ),
   );
-  // if joined to the node table add a "Link to Node" option for the field  
+  // if joined to the node table add a "Link to Node" option for the field
   if (!$database && module_exists('tripal_views')) {
     $data['organism']['abbreviation']['field']['handler'] = 'views_handler_field_node_optional';
   }
@@ -192,7 +194,7 @@ function retrieve_organism_views_data() {
        'handler' => 'views_handler_argument_string',
      ),
   );
-  // if joined to the node table add a "Link to Node" option for the field  
+  // if joined to the node table add a "Link to Node" option for the field
   if (!$database && module_exists('tripal_views')) {
     $data['organism']['common_name']['field']['handler'] = 'views_handler_field_node_optional';
   }
@@ -212,7 +214,7 @@ function retrieve_organism_views_data() {
        'handler' => 'views_handler_argument_string',
      ),
   );
-  
+
   //Calculated Field: Count (Int)
   // Provides the number of features for a given organism
   // @see tripal_feature/views/misc_tables.views.inc

+ 28 - 28
tripal_organism/views/template.node_join.views.inc

@@ -5,18 +5,18 @@
  *
  *  - simply replace all XXX with the original chado table you want to join to it's drupal nodes.
  *    (ie: If you want to join features to their drupal nodes then XXX=feature)
- * 
- *  NOTE: Creating the table definition file is not enough. You also need to call the 
+ *
+ *  NOTE: Creating the table definition file is not enough. You also need to call the
  *        retrieve_XXX_views_data() function from ../tripal_organism.views.inc:tripal_organism_views_data()
  *        by adding the following line:
  *           $data = array_merge($data, retrieve_XXX_views_data());
- *        to the function and including the file directly above the function (blow the function 
+ *        to the function and including the file directly above the function (blow the function
  *        header by adding:
  *           require_once('views/XXX.views.inc');
  *
  *  REMOVE THIS COMMENT IN THE COPY!
- */ 
- 
+ */
+
 /**
  *  @file
  *  This file defines the data array for a given chado table. This array
@@ -24,31 +24,31 @@
  *  with this module in:
  *  @see tripal_organism.views.inc --in tripal_organism_views_data()
  *
- *  Note: All chado tables are joined to their drupal nodes through the chado_XXX linking table. 
+ *  Note: All chado tables are joined to their drupal nodes through the chado_XXX linking table.
  *        This file simply defines this linking table and joins the three tables together.
  *        No modification of XXX.views.inc is needed.
  *
- *  Documentation on views integration can be found at 
+ *  Documentation on views integration can be found at
  *  http://views2.logrus.com/doc/html/index.html.
  */
- 
+
 /**
- * Purpose: this function returns the portion of the data array 
- *   which describes the chado_XXX drupal table, it's fields and any joins between it 
+ * Purpose: this function returns the portion of the data array
+ *   which describes the chado_XXX drupal table, it's fields and any joins between it
  *   and other tables
  * @see tripal_organism_views_data() --in tripal_organism.views.inc
  *
  * The main need for description of this table to views is to join chado data with drupal nodes
  *
  */
-function retrieve_chado_XXX_views_data () {
-	global $db_url;
+function retrieve_chado_XXX_views_data() {
+  global $db_url;
   $data = array();
-  
+
   // if the chado database is not local to the drupal database
   // then we need to set the database name.  This should always
   // be 'chado'.
-  if(is_array($db_url) and array_key_exists('chado',$db_url)){
+  if (is_array($db_url) and array_key_exists('chado', $db_url)) {
      // return empty data array b/c if chado is external then no join to the nodetable can be made
      return $data;
   }
@@ -57,28 +57,28 @@ function retrieve_chado_XXX_views_data () {
   $data['chado_XXX']['table'] = array(
     'field' => 'nid',
   );
-  
+
   //Relationship Definitions---------------------------------
   // Note: No joins need to be made from $data['XXX']['table']
-  
+
   // Join the chado_XXX table to XXX
   $data['chado_XXX']['table']['join']['XXX'] = array(
-  	'left_field' => 'XXX_id',
-  	'field' => 'XXX_id',
+    'left_field' => 'XXX_id',
+    'field' => 'XXX_id',
   );
-  
+
   // Join the node table to chado_XXX
   $data['node']['table']['join']['chado_XXX'] = array(
-  	'left_field' => 'nid',
-  	'field' => 'nid',
+    'left_field' => 'nid',
+    'field' => 'nid',
   );
-  
+
   // Join the node table to XXX
   $data['node']['table']['join']['XXX'] = array(
-  	'left_table' => 'chado_XXX',
-  	'left_field' => 'nid',
-  	'field' => 'nid',
-  );  
+    'left_table' => 'chado_XXX',
+    'left_field' => 'nid',
+    'field' => 'nid',
+  );
 
-	return $data;
-}
+  return $data;
+}

+ 27 - 27
tripal_organism/views/template.table_defn.views.inc

@@ -5,7 +5,7 @@
  *
  *   - Every instance of XXX should be replaced with the name of your table
  *   - If this is a base table (you want a view where every row is a row from this table)
- *     then change $data['XXX']['table'] to $data['XXX']['table']['base'] 
+ *     then change $data['XXX']['table'] to $data['XXX']['table']['base']
  *     and $data['XXX']['table']['database'] to $data['XXX']['table']['base']['database']
  *   - Relationships between this table and others: YYY is the table you are trying to join to this
  *     one. You want to join a table to this one if this table contains a foreign key to the other
@@ -15,18 +15,18 @@
  *   - Create a field definition for each field in this table using the example fields already
  *     listed. Match the type of the database field to the field definition listed below.
  *     (ie: for a text/varchar field from the database use plain_text_field below)
- * 
- *  NOTE: Creating the table definition file is not enough. You also need to call the 
+ *
+ *  NOTE: Creating the table definition file is not enough. You also need to call the
  *        retrieve_XXX_views_data() function from ../tripal_organism.views.inc:tripal_organism_views_data()
  *        by adding the following line:
  *           $data = array_merge($data, retrieve_XXX_views_data());
- *        to the function and including the file directly above the function (blow the function 
+ *        to the function and including the file directly above the function (blow the function
  *        header by adding:
  *           require_once('views/XXX.views.inc');
  *
  *  REMOVE THIS COMMENT IN THE COPY!
- */ 
- 
+ */
+
 /**
  *  @file
  *  This file defines the data array for a given chado table. This array
@@ -34,12 +34,12 @@
  *  with this module in:
  *  @see tripal_organism.views.inc --in tripal_organism_views_data()
  *
- *  Documentation on views integration can be found at 
+ *  Documentation on views integration can be found at
  *  http://views2.logrus.com/doc/html/index.html.
  */
 
 /*************************************************************************
- * Purpose: this function returns the portion of the data array 
+ * Purpose: this function returns the portion of the data array
  *   which describes the XXX table, it's fields and any joins between it and other tables
  * @see tripal_organism_views_data() --in tripal_organism.views.inc
  *
@@ -55,23 +55,23 @@
   // if the chado database is not local to the drupal database
   // then we need to set the database name.  This should always
   // be 'chado'.
-  if(is_array($db_url) and array_key_exists('chado',$db_url)){
+  if (is_array($db_url) and array_key_exists('chado', $db_url)) {
     $database = 'chado';
   }
-   
+
   //Basic table definition-----------------------------------
   $data['XXX']['table']['group'] = t('Chado XXX');
-  
+
   $data['XXX']['table'] = array(
     'field' => 'primary_id',
     'title' => t('Chado XXX'),
     'help' => t('Enter some user-friendly description of this tables purpose to the user.'),
   );
-  if($database){
+  if ($database) {
      $data['XXX']['table']['database'] = $database;
   }
 
-  
+
   //Relationship Definitions---------------------------------
   //Join: YYY => XXX
   // Notice that this relationship tells the primary table to show it's fields to the
@@ -80,16 +80,16 @@
   $data['XXX']['table']['join']['YYY'] = array(
     'left_field' => 'foreign key in YYY table',
     'field' => 'primary key in XXX table',
-  );  
-  
+  );
+
   //Join: XXX => XY => YYY
   // This relationship should be described in both directions
-  // in the appropriate files (ie: for feature => library 
+  // in the appropriate files (ie: for feature => library
   // describe in both feature.views.inc and library.views.inc)
   $data['XXX']['table']['join']['XY'] = array(
     'left_field' => 'matching XXX key in the XY table',
     'field' => 'primary key in XXX table',
-  );  
+  );
   $data['XXX']['table']['join']['YYY'] = array(
     'left_table' => 'XY',
     'left_field' => 'matching XXX key in the XY table',
@@ -99,9 +99,9 @@
     'left_field' => 'primary key in YYY table',
     'field' => 'matching YYY key in the XY table',
   );
-   
+
   //Table Field Definitions----------------------------------
-      
+
   //Field: XXX_id (primary key)
   $data['XXX']['field_name'] = array(
     'title' => t('XXX Primary Key'),
@@ -123,7 +123,7 @@
    * Remove this section when done
    */
 
-  //Field: plain_text_field (chado datatype)   
+  //Field: plain_text_field (chado datatype)
   $data['XXX']['plain_text_field'] = array(
     'title' => t('Human-Readable Name'),
     'help' => t('Description of this field.'),
@@ -142,7 +142,7 @@
     ),
   );
 
-  //Field: numeric_field (chado datatype)   
+  //Field: numeric_field (chado datatype)
   $data['XXX']['numeric_field'] = array(
     'title' => t('Human-Readable Name'),
     'help' => t('Description of this field.'),
@@ -158,7 +158,7 @@
     ),
   );
 
-  //Field: boolean_field (chado datatype)   
+  //Field: boolean_field (chado datatype)
   $data['XXX']['boolean_field'] = array(
     'title' => t('Human-Readable Name'),
     'help' => t('Description of this field.'),
@@ -174,7 +174,7 @@
     ),
   );
 
-  //Field: unix_timestamp (chado datatype)   
+  //Field: unix_timestamp (chado datatype)
   $data['XXX']['unix_timestamp'] = array(
     'title' => t('Human-Readable Name'),
     'help' => t('Description of this field.'),
@@ -190,7 +190,7 @@
     ),
   );
 
-  //Field: human_readable_date (chado datatype)   
+  //Field: human_readable_date (chado datatype)
   $data['XXX']['human_readable_date'] = array(
     'title' => t('Human-Readable Name'),
     'help' => t('Description of this field.'),
@@ -202,10 +202,10 @@
       'handler' => 'views_handler_sort_date',
     ),
   );
-   
+
    /*
     * End of Example Field definitions
     */
-    
+
   return $data;
-}
+}

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels