123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- <?php
- class operation__phylotree_vis extends ChadoField {
-
- public static $default_label = 'Phylogenetic tree visualisation';
-
- public static $description = 'Rendering of a phylogenetic tree.';
-
-
-
-
-
-
-
- public static $default_instance_settings = array(
-
- 'term_vocabulary' => 'operation',
-
- 'term_name' => 'Phylogenetic tree visualisation',
-
- 'term_accession' => '0567',
-
-
-
- 'term_fixed' => FALSE,
- );
-
- public static $default_widget = 'operation__phylotree_vis_widget';
-
- public static $default_formatter = 'operation__phylotree_vis_formatter';
-
- public function validate($entity_type, $entity, $langcode, $items, &$errors) {
-
-
-
-
-
- if (!$entity) {
- return;
- }
- $settings = $this->field['settings'];
- $field_name = $this->field['field_name'];
- $field_type = $this->field['type'];
- $field_table = $this->instance['settings']['chado_table'];
- $field_column = $this->instance['settings']['chado_column'];
- }
-
- public function load($entity) {
- $record = $entity->chado_record;
- $settings = $this->instance['settings'];
- $field_name = $this->field['field_name'];
- $field_type = $this->field['type'];
- $field_table = $this->instance['settings']['chado_table'];
- $field_column = $this->instance['settings']['chado_column'];
-
- $label_term = 'operation:0567';
-
- $entity->{$field_name}['und'][0]['value'] = array();
- if ($record) {
- $entity->{$field_name}['und'][0]['value'] = array(
- 'schema:url' => url('bio_data/' . $entity->id, array('absolute' => TRUE)),
- );
- }
- }
-
- public function elementInfo() {
- $field_term = $this->getFieldTermID();
- return array(
- $field_term => array(
- 'operations' => array(),
- 'sortable' => FALSE,
- 'searchable' => FALSE,
- 'type' => 'string',
- 'type' => 'xs:complexType',
- 'readonly' => TRUE,
- 'elements' => array(
- 'schema:url' => array(
- 'searchabel' => FALSE,
- 'type' => 'xs:anyURI',
- 'readonly' => TRUE,
- 'required' => FALSE,
- ),
- ),
- )
- );
- }
- }
|