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

Contains views_handler_field_residues field handler

File

tripal_feature/views_handlers/views_handler_field_residues.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Contains views_handler_field_residues field handler
  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. /**
  14. * {@inheritdoc}
  15. */
  16. function construct() {
  17. parent::construct();
  18. $this->additional_fields['residues'] = array('table' => 'feature', 'field' => 'residues');
  19. }
  20. /**
  21. * {@inheritdoc}
  22. */
  23. function query() {
  24. $this->ensure_my_table();
  25. $this->add_additional_fields();
  26. }
  27. /**
  28. * {@inheritdoc}
  29. */
  30. function render($values) {
  31. // add a <br> every 100 bp
  32. return ereg_replace("(.{100})", "\\1<br />", $values->feature_residues);
  33. }
  34. }