public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); // allow + for or, , for and $form['break_phrase'] = array('#type' => 'checkbox', '#title' => $this->t('Allow multiple values'), '#description' => $this->t('If selected, users can enter multiple values in the form of 1+2+3 (for OR) or 1,2,3 (for AND).'), '#default_value' => !empty($this->options['break_phrase']), '#fieldset' => 'more'); $form['not'] = array('#type' => 'checkbox', '#title' => $this->t('Exclude'), '#description' => $this->t('If selected, the numbers entered for the filter will be excluded rather than limiting the view.'), '#default_value' => !empty($this->options['not']), '#fieldset' => 'more'); }
public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); // allow + for or, , for and $form['break_phrase'] = array('#type' => 'checkbox', '#title' => $this->t('Allow multiple values'), '#description' => $this->t('If selected, users can enter multiple values in the form of 1+2+3 (for OR) or 1,2,3 (for AND).'), '#default_value' => !empty($this->options['break_phrase']), '#group' => 'options][more'); $form['add_table'] = array('#type' => 'checkbox', '#title' => $this->t('Allow multiple filter values to work together'), '#description' => $this->t('If selected, multiple instances of this filter can work together, as though multiple values were supplied to the same filter. This setting is not compatible with the "Reduce duplicates" setting.'), '#default_value' => !empty($this->options['add_table']), '#group' => 'options][more'); $form['require_value'] = array('#type' => 'checkbox', '#title' => $this->t('Do not display items with no value in summary'), '#default_value' => !empty($this->options['require_value']), '#group' => 'options][more'); $this->helper->buildOptionsForm($form, $form_state); }
public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); $form['glossary'] = array('#type' => 'checkbox', '#title' => $this->t('Glossary mode'), '#description' => $this->t('Glossary mode applies a limit to the number of characters used in the filter value, which allows the summary view to act as a glossary.'), '#default_value' => $this->options['glossary'], '#fieldset' => 'more'); $form['limit'] = array('#type' => 'textfield', '#title' => $this->t('Character limit'), '#description' => $this->t('How many characters of the filter value to filter against. If set to 1, all fields starting with the first letter in the filter value would be matched.'), '#default_value' => $this->options['limit'], '#states' => array('visible' => array(':input[name="options[glossary]"]' => array('checked' => TRUE))), '#fieldset' => 'more'); $form['case'] = array('#type' => 'select', '#title' => $this->t('Case'), '#description' => $this->t('When printing the title and summary, how to transform the case of the filter value.'), '#options' => array('none' => $this->t('No transform'), 'upper' => $this->t('Upper case'), 'lower' => $this->t('Lower case'), 'ucfirst' => $this->t('Capitalize first letter'), 'ucwords' => $this->t('Capitalize each word')), '#default_value' => $this->options['case'], '#fieldset' => 'more'); $form['path_case'] = array('#type' => 'select', '#title' => $this->t('Case in path'), '#description' => $this->t('When printing url paths, how to transform the case of the filter value. Do not use this unless with Postgres as it uses case sensitive comparisons.'), '#options' => array('none' => $this->t('No transform'), 'upper' => $this->t('Upper case'), 'lower' => $this->t('Lower case'), 'ucfirst' => $this->t('Capitalize first letter'), 'ucwords' => $this->t('Capitalize each word')), '#default_value' => $this->options['path_case'], '#fieldset' => 'more'); $form['transform_dash'] = array('#type' => 'checkbox', '#title' => $this->t('Transform spaces to dashes in URL'), '#default_value' => $this->options['transform_dash'], '#fieldset' => 'more'); if (!empty($this->definition['many to one'])) { $form['add_table'] = array('#type' => 'checkbox', '#title' => $this->t('Allow multiple filter values to work together'), '#description' => $this->t('If selected, multiple instances of this filter can work together, as though multiple values were supplied to the same filter. This setting is not compatible with the "Reduce duplicates" setting.'), '#default_value' => !empty($this->options['add_table']), '#fieldset' => 'more'); $form['require_value'] = array('#type' => 'checkbox', '#title' => $this->t('Do not display items with no value in summary'), '#default_value' => !empty($this->options['require_value']), '#fieldset' => 'more'); } // allow + for or, , for and $form['break_phrase'] = array('#type' => 'checkbox', '#title' => $this->t('Allow multiple values'), '#description' => $this->t('If selected, users can enter multiple values in the form of 1+2+3 (for OR) or 1,2,3 (for AND).'), '#default_value' => !empty($this->options['break_phrase']), '#fieldset' => 'more'); }
public function buildOptionsForm(&$form, FormStateInterface $form_state) { $form['depth'] = array('#type' => 'weight', '#title' => $this->t('Depth'), '#default_value' => $this->options['depth'], '#description' => $this->t('The depth will match nodes tagged with terms in the hierarchy. For example, if you have the term "fruit" and a child term "apple", with a depth of 1 (or higher) then filtering for the term "fruit" will get nodes that are tagged with "apple" as well as "fruit". If negative, the reverse is true; searching for "apple" will also pick up nodes tagged with "fruit" if depth is -1 (or lower).')); $form['break_phrase'] = array('#type' => 'checkbox', '#title' => $this->t('Allow multiple values'), '#description' => $this->t('If selected, users can enter multiple values in the form of 1+2+3. Due to the number of JOINs it would require, AND will be treated as OR with this filter.'), '#default_value' => !empty($this->options['break_phrase'])); parent::buildOptionsForm($form, $form_state); }
/** * Override buildOptionsForm() so that only the relevant options * are displayed to the user. */ public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); $form['must_not_be'] = array('#type' => 'checkbox', '#title' => t('Fail basic validation if any argument is given'), '#default_value' => !empty($this->options['must_not_be']), '#description' => t('By checking this field, you can use this to make sure views with more arguments than necessary fail validation.'), '#fieldset' => 'more'); unset($form['exception']); }
/** * Provide a form to edit options for this plugin. */ public function buildOptionsForm(&$form, FormStateInterface $form_state) { $form['contextlevel'] = array('#type' => 'textfield', '#title' => t('The context level'), '#default_value' => $this->options['contextlevel'], '#size' => 5, '#maxlength' => 10); parent::buildOptionsForm($form, $form_state); }