You are here

public function RoleExpireExpiryData::buildOptionsForm in Role Expire 8

Same name and namespace in other branches
  1. 2.x src/Plugin/views/field/RoleExpireExpiryData.php \Drupal\role_expire\Plugin\views\field\RoleExpireExpiryData::buildOptionsForm()

Provide the options form.

Overrides PrerenderList::buildOptionsForm

File

src/Plugin/views/field/RoleExpireExpiryData.php, line 102

Class

RoleExpireExpiryData
Field handler to display the role expire data.

Namespace

Drupal\role_expire\Plugin\views\field

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  $form['custom_date_format'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Custom date format'),
    '#description' => $this
      ->t('See <a href="http://us.php.net/manual/en/function.date.php" target="_blank">the PHP docs</a> for date formats.'),
    '#default_value' => isset($this->options['custom_date_format']) ? $this->options['custom_date_format'] : '',
  ];
  $form['timezone'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('Timezone'),
    '#description' => $this
      ->t('Timezone to be used for date output.'),
    '#options' => [
      '' => $this
        ->t('- Default site/user timezone -'),
    ] + system_time_zones(FALSE),
    '#default_value' => $this->options['timezone'],
  ];
  parent::buildOptionsForm($form, $form_state);
}