/** * {@inheritdoc} */ public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); $form['format_username'] = array('#title' => t('Use formatted username'), '#type' => 'checkbox', '#default_value' => !empty($this->options['format_username']), '#description' => t('If checked, the username will be formatted by the system. If unchecked, it will be displayed raw.')); $form['overwrite_anonymous'] = array('#title' => t('Overwrite the value to display for anonymous users'), '#type' => 'checkbox', '#default_value' => !empty($this->options['overwrite_anonymous']), '#description' => t('Enable to display different text for anonymous users.')); $form['anonymous_text'] = array('#title' => t('Text to display for anonymous users'), '#type' => 'textfield', '#default_value' => $this->options['anonymous_text'], '#states' => array('visible' => array(':input[name="options[overwrite_anonymous]"]' => array('checked' => TRUE)))); }
/** * {@inheritdoc} */ protected function renderLink($data, ResultRow $values) { parent::renderLink($data, $values); if ($this->options['link_to_user'] == 'mailto') { $this->options['alter']['make_link'] = TRUE; $this->options['alter']['path'] = "mailto:" . $data; } return $data; }