/** * {@inheritdoc} */ public function settingsForm(array $form, FormStateInterface $form_state) { $form = parent::settingsForm($form, $form_state); $form['animation'] = array('#type' => 'select', '#title' => $this->t('Animation'), '#options' => $this->animationOptions(), '#default_value' => $this->getSetting('animation')); $form['speed'] = array('#type' => 'textfield', '#title' => $this->t('Speed'), '#default_value' => $this->getSetting('speed')); $form['theme'] = array('#type' => 'select', '#title' => $this->t('Theme'), '#options' => $this->themeOptions(), '#default_value' => $this->getSetting('theme')); $form['background'] = array('#type' => 'textfield', '#title' => $this->t('Background'), '#default_value' => $this->getSetting('background'), '#description' => $this->t("Data from this field will be added to css property 'background'.")); $form['reflection'] = array('#type' => 'checkbox', '#title' => $this->t('Add reflection'), '#default_value' => $this->getSetting('reflection'), '#attributes' => array('class' => array('field-timer-county-reflection'))); $form['reflectionOpacity'] = array('#type' => 'textfield', '#title' => $this->t('Reflection opacity'), '#default_value' => $this->getSetting('reflectionOpacity'), '#description' => $this->t('Float value between 0 and 1.'), '#states' => array('invisible' => array('input.field-timer-county-reflection' => array('checked' => FALSE)))); return $form; }
/** * {@inheritdoc} */ public function settingsForm(array $form, FormStateInterface $form_state) { $form = parent::settingsForm($form, $form_state); $form['type'] = array('#type' => 'select', '#title' => $this->t('Type'), '#options' => $this->typeOptions(), '#default_value' => $this->getSetting('type')); return $form; }