class data__sequence_formatter

Hierarchy

Expanded class hierarchy of data__sequence_formatter

2 string references to 'data__sequence_formatter'
data__sequence.inc in tripal_chado/includes/TripalFields/data__sequence/data__sequence.inc
tripal_chado_bundle_instances_info_custom in tripal_chado/includes/tripal_chado.fields.inc
Helper function for the hook_create_tripalfield_instance().

File

tripal_chado/includes/TripalFields/data__sequence/data__sequence_formatter.inc, line 3

View source
class data__sequence_formatter extends ChadoFieldFormatter {
  // The default lable for this field.
  public static $default_label = 'Sequence';

  // The list of field types for which this formatter is appropriate.
  public static $field_types = array('data__sequence');

  /**
   * @see TripalFieldFormatter::view()
   */
  public function view(&$element, $entity_type, $entity, $langcode, $items, $display) {

    $content = 'There is no sequence.';
    if (count($items) > 0 and $items[0]['value']) {
      $num_bases = 50;
      $content = '<pre class="residues-formatter">';
      $content .= wordwrap($items[0]['value'], $num_bases, "<br>", TRUE);
      $content .= '</pre>';
    }
    $element[0] = array(
      // We create a render array to produce the desired markup,
      '#type' => 'markup',
      '#markup' => $content,
    );
  }
}

Members

Contains filters are case sensitive
Namesort descending Modifiers Type Description
data__sequence_formatter::$default_label public static property The default lable for this field. Overrides TripalFieldFormatter::$default_label
data__sequence_formatter::$field_types public static property The list of field types for which this formatter is appropriate. Overrides TripalFieldFormatter::$field_types
data__sequence_formatter::view public function Overrides TripalFieldFormatter::view
TripalFieldFormatter::$default_settings public static property The list of default settings for this formatter.
TripalFieldFormatter::ajaxifyPager protected function Updates a pager generated by theme('pager') for use with AJAX.
TripalFieldFormatter::getPagerElementID protected function When constructing a pager for use by a field, all pagers must have a unique ID
TripalFieldFormatter::info public static function Provides information about the formatter for this field.
TripalFieldFormatter::settingsForm public function Provides the field's setting form.
TripalFieldFormatter::settingsSummary public function Provides a summary of the formatter settings.
TripalFieldFormatter::__construct public function Instantiates a new TripalFieldFormatter object.