Example #1
0
 /**
  * Override init function to provide generic option to link to shipment.
  */
 public function init(&$view, &$data)
 {
     parent::init($view, $data);
     if (!empty($this->options['link_to_shipment'])) {
         $this->additional_fields['order_id'] = array('table' => $this->table_alias, 'field' => 'order_id');
     }
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     if (!empty($options['link_to_file'])) {
         $this->additional_fields['uri'] = 'uri';
     }
 }
Example #3
0
 /**
  * {@inheritdoc}
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     if ($this->options['replace_variables']) {
         $this->additional_fields['variables'] = 'variables';
     }
 }
Example #4
0
 /**
  * Override init function to provide generic option to link to user.
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     if (!empty($this->options['link_to_user'])) {
         $this->additional_fields['uid'] = array('table' => 'uc_orders', 'field' => 'uid');
     }
 }
Example #5
0
 /**
  * {@inheritdoc}
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     $default_formats = array('yes-no' => array(t('Yes'), $this->t('No')), 'true-false' => array(t('True'), $this->t('False')), 'on-off' => array(t('On'), $this->t('Off')), 'enabled-disabled' => array(t('Enabled'), $this->t('Disabled')), 'boolean' => array(1, 0), 'unicode-yes-no' => array('✔', '✖'));
     $output_formats = isset($this->definition['output formats']) ? $this->definition['output formats'] : array();
     $custom_format = array('custom' => array(t('Custom')));
     $this->formats = array_merge($default_formats, $output_formats, $custom_format);
 }
Example #6
0
 /**
  * {@inheritdoc}
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     // Don't add the additional fields to groupby
     if (!empty($this->options['link_to_node'])) {
         $this->additional_fields['nid'] = array('table' => 'node_field_data', 'field' => 'nid');
     }
 }
Example #7
0
 /**
  * {@inheritdoc}
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     $this->format = $this->definition['format'];
     $this->additional_fields = array();
     if (is_array($this->format)) {
         $this->additional_fields['format'] = $this->format;
     }
 }
Example #8
0
 /**
  * {@inheritdoc}
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     $entity_type = $this->getEntityType();
     // Filter the actions to only include those for this entity type.
     $this->actions = array_filter($this->actionStorage->loadMultiple(), function ($action) use($entity_type) {
         return $action->getType() == $entity_type;
     });
 }
Example #9
0
 /**
  * Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::init().
  *
  * Provide generic option to link to comment.
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     if (!empty($this->options['link_to_comment'])) {
         $this->additional_fields['cid'] = 'cid';
         $this->additional_fields['entity_id'] = array('table' => 'comment_field_data', 'field' => 'entity_id');
         $this->additional_fields['entity_type'] = array('table' => 'comment_field_data', 'field' => 'entity_type');
     }
 }
Example #10
0
 /**
  * {@inheritdoc}
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     // Don't add the additional fields to groupby
     if (!empty($this->options['link_to_feed'])) {
         $this->additional_fields['fid'] = array('table' => 'feeds_feed', 'field' => 'fid');
         if (module_exists('translation')) {
             $this->additional_fields['langcode'] = array('table' => 'feeds_feed', 'field' => 'langcode');
         }
     }
 }
Example #11
0
 /**
  * {@inheritdoc}
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     $this->additional_fields[$this->definition['entity type field']] = $this->definition['entity type field'];
 }
 /**
  * Overrides Drupal\views\Plugin\views\field\FieldPluginBase::init().
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     $this->additional_fields['tid'] = 'tid';
     $this->additional_fields['vid'] = 'vid';
 }
Example #13
0
 /**
  * {@inheritdoc}
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     $this->multiple = FALSE;
     $this->limit_values = FALSE;
     $field_definition = $this->getFieldDefinition();
     $cardinality = $field_definition->getFieldStorageDefinition()->getCardinality();
     if ($field_definition->getFieldStorageDefinition()->isMultiple()) {
         $this->multiple = TRUE;
         // If "Display all values in the same row" is FALSE, then we always limit
         // in order to show a single unique value per row.
         if (!$this->options['group_rows']) {
             $this->limit_values = TRUE;
         }
         // If "First and last only" is chosen, limit the values
         if (!empty($this->options['delta_first_last'])) {
             $this->limit_values = TRUE;
         }
         // Otherwise, we only limit values if the user hasn't selected "all", 0, or
         // the value matching field cardinality.
         if ($this->options['delta_limit'] > 0 && $this->options['delta_limit'] != $cardinality || intval($this->options['delta_offset'])) {
             $this->limit_values = TRUE;
         }
     }
 }
Example #14
0
 /**
  * {@inheritdoc}
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
 }