views_handler_field_residues.inc

  1. 2.x tripal_feature/views_handlers/views_handler_field_residues.inc
  2. 3.x legacy/tripal_feature/views_handlers/views_handler_field_residues.inc
  3. 1.x tripal_feature/views_handlers/views_handler_field_residues.inc

@todo Add file header description

File

tripal_feature/views_handlers/views_handler_field_residues.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * @todo Add file header description
  5. */
  6. /**
  7. * A handler to provide proper displays for sequence residues.
  8. *
  9. * @ingroup tripal_feature
  10. * @ingroup views_field_handlers
  11. */
  12. class views_handler_field_residues extends views_handler_field {
  13. function construct() {
  14. parent::construct();
  15. $this->additional_fields['residues'] = array('table' => 'feature', 'field' => 'residues');
  16. }
  17. function query() {
  18. $this->ensure_my_table();
  19. $this->add_additional_fields();
  20. }
  21. function render($values) {
  22. // add a <br> every 100 bp
  23. return ereg_replace("(.{100})", "\\1<br />", $values->feature_residues);
  24. }
  25. }