/** * {@inheritdoc} */ public function settingsForm(array $form, FormStateInterface $form_state) { $form = parent::settingsForm($form, $form_state); $form['countdown_theme'] = array('#type' => 'select', '#title' => $this->t('Theme'), '#options' => $this->themeOptions(), '#default_value' => $this->getSetting('countdown_theme')); $form['display_days'] = array('#type' => 'checkbox', '#title' => $this->t('Display days'), '#default_value' => $this->getSetting('display_days'), '#attributes' => array('class' => array('field-timer-display-days'))); $form['max_count_of_days'] = array('#type' => 'select', '#title' => $this->t('Max count of days'), '#options' => $this->dayOptions(), '#default_value' => $this->getSetting('max_count_of_days'), '#states' => array('invisible' => array('input.field-timer-display-days' => array('checked' => FALSE)))); $form['display_hours'] = array('#type' => 'checkbox', '#title' => $this->t('Display hours'), '#default_value' => $this->getSetting('display_hours')); $form['display_minutes'] = array('#type' => 'checkbox', '#title' => $this->t('Display minutes'), '#default_value' => $this->getSetting('display_minutes')); $form['display_seconds'] = array('#type' => 'checkbox', '#title' => $this->t('Display seconds'), '#default_value' => $this->getSetting('display_seconds')); return $form; }
/** * {@inheritdoc} */ public function settingsForm(array $form, FormStateInterface $form_state) { $form = parent::settingsForm($form, $form_state); $form['regional'] = array('#type' => 'select', '#title' => $this->t('Region'), '#default_value' => $this->getSetting('regional'), '#options' => $this->regionOptions()); $form['format'] = array('#type' => 'textfield', '#title' => $this->t('Format'), '#default_value' => $this->getSetting('format'), '#description' => $this->t('See <a href=":url" target="_blank">documentation</a> for this parameter.', array(':url' => $this->getDocumentationLink(array('fragment' => 'format'))))); $form['layout'] = array('#type' => 'textarea', '#rows' => 3, '#cols' => 60, '#title' => $this->t('Layout'), '#default_value' => $this->getSetting('layout'), '#description' => $this->t('See <a href=":url" target="_blank">documentation</a> for this parameter.', array(':url' => $this->getDocumentationLink(array('fragment' => 'layout'))))); $form['compact'] = array('#type' => 'checkbox', '#title' => $this->t('Display in compact format'), '#default_value' => $this->getSetting('compact')); $form['significant'] = array('#type' => 'select', '#title' => $this->t('Granularity'), '#options' => range(0, 7), '#default_value' => $this->getSetting('significant')); $form['timeSeparator'] = array('#type' => 'textfield', '#title' => $this->t('Time separator'), '#default_value' => $this->getSetting('timeSeparator')); $form['padZeroes'] = array('#type' => 'checkbox', '#title' => $this->t('Pad with zeroes'), '#default_value' => $this->getSetting('padZeroes')); return $form; }