Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     $fields = $this->getFulltextFields();
     if (!empty($fields)) {
         $form['fields'] = array('#type' => 'select', '#title' => $this->t('Searched fields'), '#description' => $this->t('Select the fields that will be searched. If no fields are selected, all available fulltext fields will be searched.'), '#options' => $fields, '#size' => min(4, count($fields)), '#multiple' => TRUE, '#default_value' => $this->options['fields']);
     } else {
         $form['fields'] = array('#type' => 'value', '#value' => array());
     }
     if (isset($form['expose'])) {
         $form['expose']['#weight'] = -5;
     }
     $form['min_length'] = array('#title' => $this->t('Minimum keyword length'), '#description' => $this->t('Minimum length of each word in the search keys. Leave empty to allow all words.'), '#type' => 'number', '#min' => 1, '#default_value' => $this->options['min_length']);
 }
Пример #2
0
 /**
  * Overrides Drupal\views\Plugin\views\row\RowPluginBase::buildOptionsForm().
  *
  * @return array
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     $form['test_enable'] = array('#type' => 'checkbox', '#title' => $this->t('Controls whether the filter plugin should be active'), '#default_value' => $this->options['test_enable']);
 }