Example #1
0
  /**
   * Provide the options form.
   */
  public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    // Link options.
    $form['link_photo'] = array(
      '#title' => t("Link image"),
      '#description' => t("Link the image to the album page or image page."),
      '#type' => 'radios',
      '#options' => array(
        '' => $this->t('None'),
        'album' => $this->t('Album page'),
        'image' => $this->t('Image page')
      ),
      '#default_value' => $this->options['link_photo']
    );

    // Get image styles.
    $style_options = image_style_options();
    $form['image_style'] = array(
      '#title' => $this->t('Image style'),
      '#type' => 'select',
      '#default_value' => $this->options['image_style'],
      '#options' => $style_options,
    );

    parent::buildOptionsForm($form, $form_state);
  }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     $options = array('' => t('- All -'));
     $options += JobItem::getStates();
     $form['state'] = array('#title' => t('Job item state'), '#description' => t('Count only job items of a certain state.'), '#type' => 'select', '#options' => $options, '#default_value' => $this->options['state']);
 }
Example #3
0
 /**
  * {@inheritdoc}
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     if (!empty($this->definition['float'])) {
         $form['set_precision'] = array('#type' => 'checkbox', '#title' => $this->t('Round'), '#description' => $this->t('If checked, the number will be rounded.'), '#default_value' => $this->options['set_precision']);
         $form['precision'] = array('#type' => 'textfield', '#title' => $this->t('Precision'), '#default_value' => $this->options['precision'], '#description' => $this->t('Specify how many digits to print after the decimal point.'), '#states' => array('visible' => array(':input[name="options[set_precision]"]' => array('checked' => TRUE))), '#size' => 2);
         $form['decimal'] = array('#type' => 'textfield', '#title' => $this->t('Decimal point'), '#default_value' => $this->options['decimal'], '#description' => $this->t('What single character to use as a decimal point.'), '#size' => 2);
     }
     $form['separator'] = array('#type' => 'select', '#title' => $this->t('Thousands marker'), '#options' => array('' => $this->t('- None -'), ',' => $this->t('Comma'), ' ' => $this->t('Space'), '.' => $this->t('Decimal'), '\'' => $this->t('Apostrophe')), '#default_value' => $this->options['separator'], '#description' => $this->t('What single character to use as the thousands separator.'), '#size' => 2);
     $form['format_plural'] = array('#type' => 'checkbox', '#title' => $this->t('Format plural'), '#description' => $this->t('If checked, special handling will be used for plurality.'), '#default_value' => $this->options['format_plural']);
     $form['format_plural_string'] = array('#type' => 'value', '#default_value' => $this->options['format_plural_string']);
     $plural_array = explode(LOCALE_PLURAL_DELIMITER, $this->options['format_plural_string']);
     $plurals = $this->getNumberOfPlurals($this->view->storage->get('langcode'));
     for ($i = 0; $i < $plurals; $i++) {
         $form['format_plural_values'][$i] = array('#type' => 'textfield', '#title' => $i == 0 ? $this->t('Singular form') : $this->formatPlural($i, 'First plural form', '@count. plural form'), '#default_value' => isset($plural_array[$i]) ? $plural_array[$i] : '', '#description' => $this->t('Text to use for this variant, @count will be replaced with the value.'), '#states' => array('visible' => array(':input[name="options[format_plural]"]' => array('checked' => TRUE))));
     }
     if ($plurals == 2) {
         // Simplify user interface text for the most common case.
         $form['format_plural_values'][0]['#description'] = $this->t('Text to use for the singular form, @count will be replaced with the value.');
         $form['format_plural_values'][1]['#title'] = $this->t('Plural form');
         $form['format_plural_values'][1]['#description'] = $this->t('Text to use for the plural form, @count will be replaced with the value.');
     }
     $form['prefix'] = array('#type' => 'textfield', '#title' => $this->t('Prefix'), '#default_value' => $this->options['prefix'], '#description' => $this->t('Text to put before the number, such as currency symbol.'));
     $form['suffix'] = array('#type' => 'textfield', '#title' => $this->t('Suffix'), '#default_value' => $this->options['suffix'], '#description' => $this->t('Text to put after the number, such as currency symbol.'));
     parent::buildOptionsForm($form, $form_state);
 }
Example #4
0
 /**
  * {@inheritdoc}
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     $form['range'] = array('#type' => 'textfield', '#title' => t('Range'), '#description' => t('The range of weights available to select. For
     example, a range of 20 will allow you to select a weight between -20
     and 20.'), '#default_value' => $this->options['range'], '#size' => 5);
 }
Example #5
0
 /**
  * {@inheritdoc}
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     // Only show fields that precede this one.
     $field_options = $this->getPreviousFieldLabels();
     $form['fields'] = array('#type' => 'checkboxes', '#title' => $this->t('Fields'), '#description' => $this->t('Fields to be included as links.'), '#options' => $field_options, '#default_value' => $this->options['fields']);
     $form['destination'] = array('#type' => 'checkbox', '#title' => $this->t('Include destination'), '#description' => $this->t('Include a "destination" parameter in the link to return the user to the original view upon completing the link action.'), '#default_value' => $this->options['destination']);
 }
Example #6
0
 /**
  * {@inheritdoc}
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     $form['text'] = array('#type' => 'textfield', '#title' => $this->t('Text to display'), '#default_value' => $this->options['text']);
     parent::buildOptionsForm($form, $form_state);
     // The path is set by renderLink function so don't allow to set it.
     $form['alter']['path'] = array('#access' => FALSE);
     $form['alter']['external'] = array('#access' => FALSE);
 }
Example #7
0
 public function buildOptionsForm(&$form, &$form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     // Remove the checkbox
     unset($form['alter']['alter_text']);
     unset($form['alter']['text']['#states']);
     unset($form['alter']['help']['#states']);
     $form['#pre_render'][] = array($this, 'preRenderCustomForm');
 }
Example #8
0
 /**
  * {@inheritdoc}
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     $form['text'] = ['#type' => 'textfield', '#title' => $this->t('Text to display'), '#default_value' => $this->options['text']];
     parent::buildOptionsForm($form, $form_state);
     // The path is set by ::renderLink() so we do not allow to set it.
     $form['alter'] += ['path' => [], 'query' => [], 'external' => []];
     $form['alter']['path'] += ['#access' => FALSE];
     $form['alter']['query'] += ['#access' => FALSE];
     $form['alter']['external'] += ['#access' => FALSE];
 }
Example #9
0
 /**
  * {@inheritdoc}
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     foreach ($this->formats as $key => $item) {
         $options[$key] = implode('/', $item);
     }
     $form['type'] = array('#type' => 'select', '#title' => $this->t('Output format'), '#options' => $options, '#default_value' => $this->options['type']);
     $form['type_custom_true'] = array('#type' => 'textfield', '#title' => $this->t('Custom output for TRUE'), '#default_value' => $this->options['type_custom_true'], '#states' => array('visible' => array('select[name="options[type]"]' => array('value' => 'custom'))));
     $form['type_custom_false'] = array('#type' => 'textfield', '#title' => $this->t('Custom output for FALSE'), '#default_value' => $this->options['type_custom_false'], '#states' => array('visible' => array('select[name="options[type]"]' => array('value' => 'custom'))));
     $form['not'] = array('#type' => 'checkbox', '#title' => $this->t('Reverse'), '#description' => $this->t('If checked, true will be displayed as false.'), '#default_value' => $this->options['not']);
     parent::buildOptionsForm($form, $form_state);
 }
 /**
  * Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::defineOptions().
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     $modules = system_get_info('module');
     $names = array();
     foreach ($modules as $name => $module) {
         $names[$name] = $module['name'];
     }
     $form['data_module'] = array('#title' => $this->t('Module name'), '#type' => 'select', '#description' => $this->t('The module which sets this user data.'), '#default_value' => $this->options['data_module'], '#options' => $names);
     $form['data_name'] = array('#title' => $this->t('Name'), '#type' => 'textfield', '#description' => $this->t('The name of the data key.'), '#default_value' => $this->options['data_name']);
 }
Example #11
0
 /**
  * {@inheritdoc}
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     $modules = $this->moduleHandler->getModuleList();
     $names = array();
     foreach (array_keys($modules) as $name) {
         $names[$name] = $this->moduleHandler->getName($name);
     }
     $form['data_module'] = array('#title' => $this->t('Module name'), '#type' => 'select', '#description' => $this->t('The module which sets this user data.'), '#default_value' => $this->options['data_module'], '#options' => $names);
     $form['data_name'] = array('#title' => $this->t('Name'), '#type' => 'textfield', '#description' => $this->t('The name of the data key.'), '#default_value' => $this->options['data_name']);
 }
Example #12
0
 /**
  * {@inheritdoc}
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     if (!empty($this->definition['float'])) {
         $form['set_precision'] = array('#type' => 'checkbox', '#title' => $this->t('Round'), '#description' => $this->t('If checked, the number will be rounded.'), '#default_value' => $this->options['set_precision']);
         $form['precision'] = array('#type' => 'textfield', '#title' => $this->t('Precision'), '#default_value' => $this->options['precision'], '#description' => $this->t('Specify how many digits to print after the decimal point.'), '#states' => array('visible' => array(':input[name="options[set_precision]"]' => array('checked' => TRUE))), '#size' => 2);
         $form['decimal'] = array('#type' => 'textfield', '#title' => $this->t('Decimal point'), '#default_value' => $this->options['decimal'], '#description' => $this->t('What single character to use as a decimal point.'), '#size' => 2);
     }
     $form['separator'] = array('#type' => 'select', '#title' => $this->t('Thousands marker'), '#options' => array('' => $this->t('- None -'), ',' => $this->t('Comma'), ' ' => $this->t('Space'), '.' => $this->t('Decimal'), '\'' => $this->t('Apostrophe')), '#default_value' => $this->options['separator'], '#description' => $this->t('What single character to use as the thousands separator.'), '#size' => 2);
     $form['format_plural'] = array('#type' => 'checkbox', '#title' => $this->t('Format plural'), '#description' => $this->t('If checked, special handling will be used for plurality.'), '#default_value' => $this->options['format_plural']);
     $form['format_plural_singular'] = array('#type' => 'textfield', '#title' => $this->t('Singular form'), '#default_value' => $this->options['format_plural_singular'], '#description' => $this->t('Text to use for the singular form.'), '#states' => array('visible' => array(':input[name="options[format_plural]"]' => array('checked' => TRUE))));
     $form['format_plural_plural'] = array('#type' => 'textfield', '#title' => $this->t('Plural form'), '#default_value' => $this->options['format_plural_plural'], '#description' => $this->t('Text to use for the plural form, @count will be replaced with the value.'), '#states' => array('visible' => array(':input[name="options[format_plural]"]' => array('checked' => TRUE))));
     $form['prefix'] = array('#type' => 'textfield', '#title' => $this->t('Prefix'), '#default_value' => $this->options['prefix'], '#description' => $this->t('Text to put before the number, such as currency symbol.'));
     $form['suffix'] = array('#type' => 'textfield', '#title' => $this->t('Suffix'), '#default_value' => $this->options['suffix'], '#description' => $this->t('Text to put after the number, such as currency symbol.'));
     parent::buildOptionsForm($form, $form_state);
 }
Example #13
0
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     $date_formats = array();
     foreach ($this->dateFormatStorage->loadMultiple() as $machine_name => $value) {
         $date_formats[$machine_name] = $this->t('@name format: @date', array('@name' => $value->label(), '@date' => $this->dateFormatter->format(REQUEST_TIME, $machine_name)));
     }
     $form['date_format'] = array('#type' => 'select', '#title' => $this->t('Date format'), '#options' => $date_formats + array('custom' => $this->t('Custom'), 'raw time ago' => $this->t('Time ago'), 'time ago' => $this->t('Time ago (with "ago" appended)'), 'raw time hence' => $this->t('Time hence'), 'time hence' => $this->t('Time hence (with "hence" appended)'), 'raw time span' => $this->t('Time span (future dates have "-" prepended)'), 'inverse time span' => $this->t('Time span (past dates have "-" prepended)'), 'time span' => $this->t('Time span (with "ago/hence" appended)')), '#default_value' => isset($this->options['date_format']) ? $this->options['date_format'] : 'small');
     $form['custom_date_format'] = array('#type' => 'textfield', '#title' => $this->t('Custom date format'), '#description' => $this->t('If "Custom", see <a href="http://us.php.net/manual/en/function.date.php" target="_blank">the PHP docs</a> for date formats. Otherwise, enter the number of different time units to display, which defaults to 2.'), '#default_value' => isset($this->options['custom_date_format']) ? $this->options['custom_date_format'] : '');
     // Setup #states for all possible date_formats on the custom_date_format form element.
     foreach (array('custom', 'raw time ago', 'time ago', 'raw time hence', 'time hence', 'raw time span', 'time span', 'raw time span', 'inverse time span', 'time span') as $custom_date_possible) {
         $form['custom_date_format']['#states']['visible'][] = array(':input[name="options[date_format]"]' => array('value' => $custom_date_possible));
     }
     $form['timezone'] = array('#type' => 'select', '#title' => $this->t('Timezone'), '#description' => $this->t('Timezone to be used for date output.'), '#options' => array('' => $this->t('- Default site/user timezone -')) + system_time_zones(FALSE), '#default_value' => $this->options['timezone']);
     foreach (array_merge(array('custom'), array_keys($date_formats)) as $timezone_date_formats) {
         $form['timezone']['#states']['visible'][] = array(':input[name="options[date_format]"]' => array('value' => $timezone_date_formats));
     }
     parent::buildOptionsForm($form, $form_state);
 }
 /**
  * Provide the options form.
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     parent::buildOptionsForm($form, $form_state);
 }
Example #15
0
 /**
  * {@inheritdoc}
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     $form['action_title'] = array('#type' => 'textfield', '#title' => $this->t('Action title'), '#default_value' => $this->options['action_title'], '#description' => $this->t('The title shown above the actions dropdown.'));
     $form['include_exclude'] = array('#type' => 'radios', '#title' => $this->t('Available actions'), '#options' => array('exclude' => $this->t('All actions, except selected'), 'include' => $this->t('Only selected actions')), '#default_value' => $this->options['include_exclude']);
     $form['selected_actions'] = array('#type' => 'checkboxes', '#title' => $this->t('Selected actions'), '#options' => $this->getBulkOptions(FALSE), '#default_value' => $this->options['selected_actions']);
     parent::buildOptionsForm($form, $form_state);
 }
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     $form['text'] = array('#type' => 'textfield', '#title' => $this->t('Text to display'), '#default_value' => $this->options['text']);
     parent::buildOptionsForm($form, $form_state);
 }
Example #17
0
 /**
  * {@inheritdoc}
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     $form['extension_detect_tar'] = array('#type' => 'checkbox', '#title' => t('Detect if tar is part of the extension'), '#description' => t("See if the previous extension is '.tar' and if so, add that, so we see 'tar.gz' or 'tar.bz2' instead of just 'gz'."), '#default_value' => $this->options['extension_detect_tar']);
 }
Example #18
0
 /**
  * {@inheritdoc}
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     $form['native_language'] = array('#title' => $this->t('Display in native language'), '#type' => 'checkbox', '#default_value' => $this->options['native_language']);
 }
Example #19
0
 /**
  * Provide link to taxonomy option
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     $form['link_to_taxonomy'] = array('#title' => t('Link this field to its taxonomy term page'), '#description' => t("Enable to override this field's links."), '#type' => 'checkbox', '#default_value' => !empty($this->options['link_to_taxonomy']));
     $form['convert_spaces'] = array('#title' => t('Convert spaces in term names to hyphens'), '#description' => t('This allows links to work with Views taxonomy term arguments.'), '#type' => 'checkbox', '#default_value' => !empty($this->options['convert_spaces']));
     parent::buildOptionsForm($form, $form_state);
 }
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     $form['format'] = array('#type' => 'select', '#title' => $this->t('Display format'), '#description' => $this->t('How should the serialized data be displayed. You can choose a custom array/object key or a print_r on the full output.'), '#options' => array('unserialized' => $this->t('Full data (unserialized)'), 'serialized' => $this->t('Full data (serialized)'), 'key' => $this->t('A certain key')), '#default_value' => $this->options['format']);
     $form['key'] = array('#type' => 'textfield', '#title' => $this->t('Which key should be displayed'), '#default_value' => $this->options['key'], '#states' => array('visible' => array(':input[name="options[format]"]' => array('value' => 'key'))));
 }
Example #21
0
 /**
  * Provide link to file option
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     $form['link_to_file'] = array('#title' => $this->t('Link this field to download the file'), '#description' => $this->t("Enable to override this field's links."), '#type' => 'checkbox', '#default_value' => !empty($this->options['link_to_file']));
     parent::buildOptionsForm($form, $form_state);
 }
Example #22
0
 /**
  * {@inheritdoc}
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     $view_options = Views::getViewsAsOptions(TRUE, 'all', NULL, FALSE, TRUE);
     $form['views_field_view'] = ['#type' => 'details', '#title' => $this->t("View settings"), '#open' => TRUE];
     $form['view'] = ['#type' => 'select', '#title' => $this->t('View'), '#description' => $this->t('Select a view to embed.'), '#default_value' => $this->options['view'], '#options' => $view_options, '#ajax' => ['path' => views_ui_build_form_url($form_state)], '#submit' => [[$this, 'submitTemporaryForm']], '#executes_submit_callback' => TRUE, '#fieldset' => 'views_field_view'];
     // If there is no view set, use the first one for now.
     if (count($view_options) && empty($this->options['view'])) {
         $new_options = array_keys($view_options);
         $this->options['view'] = reset($new_options);
     }
     if ($this->options['view']) {
         $view = Views::getView($this->options['view']);
         $display_options = [];
         foreach ($view->storage->get('display') as $name => $display) {
             // Allow to embed a different display as the current one.
             if ($this->options['view'] != $this->view->storage->id() || $this->view->current_display != $name) {
                 $display_options[$name] = $display['display_title'];
             }
         }
         $form['display'] = ['#type' => 'select', '#title' => $this->t('Display'), '#description' => $this->t('Select a view display to use.'), '#default_value' => $this->options['display'], '#options' => $display_options, '#ajax' => ['path' => views_ui_build_form_url($form_state)], '#submit' => [[$this, 'submitTemporaryForm']], '#executes_submit_callback' => TRUE, '#fieldset' => 'views_field_view'];
         // Provide a way to directly access the views edit link of the child view.
         // Don't show this link if the current view is the selected child view.
         if (!empty($this->options['view']) && !empty($this->options['display']) && $this->view->storage->id() != $this->options['view']) {
             // use t() here, and set HTML on #link options.
             $link_text = $this->t('Edit "%view (@display)" view', ['%view' => $view_options[$this->options['view']], '@display' => $this->options['display']]);
             $form['view_edit'] = ['#type' => 'container', '#fieldset' => 'views_field_view'];
             $form['view_edit']['view_edit_link'] = ['#type' => 'link', '#title' => $link_text, '#url' => Url::fromRoute('entity.view.edit_display_form', ['view' => $this->options['view'], 'display_id' => $this->options['display']], ['attributes' => ['target' => '_blank', 'class' => ['views-field-view-child-view-edit']], 'html' => TRUE]), '#attached' => ['library' => ['views_field_view/drupal.views_field_view']], '#prefix' => '<span>[</span>', '#suffix' => '<span>]</span>'];
             $form['view_edit']['description'] = ['#markup' => $this->t('Use this link to open the current child view\'s edit page in a new window.'), '#prefix' => '<div class="description">', '#suffix' => '</div>'];
         }
         $form['arguments'] = ['#title' => $this->t('Contextual filters'), '#description' => $this->t('Use a comma (,) or forwardslash (/) separated list of each contextual filter which should be forwared to the view.
       See below list of available replacement tokens. Static values are also be passed to child views if they do not match a token format.
       You could pass static ID\'s or taxonomy terms in this way. E.g. 123 or "my taxonomy term".'), '#type' => 'textfield', '#default_value' => $this->options['arguments'], '#fieldset' => 'views_field_view'];
         $form['available_tokens'] = ['#type' => 'details', '#title' => $this->t('Replacement patterns'), '#value' => $this->getTokenInfo(), '#fieldset' => 'views_field_view'];
     }
     $form['alter']['#access'] = FALSE;
 }
Example #23
0
 public function buildOptionsForm(&$form, &$form_state)
 {
     $form['counter_start'] = array('#type' => 'textfield', '#title' => t('Starting value'), '#default_value' => $this->options['counter_start'], '#description' => t('Specify the number the counter should start at.'), '#size' => 2);
     parent::buildOptionsForm($form, $form_state);
 }
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     $form['native_language'] = array('#title' => $this->t('Native language'), '#type' => 'checkbox', '#default_value' => $this->options['native_language'], '#description' => $this->t('If enabled, the native name of the language will be displayed'));
 }
Example #25
0
 /**
  * {@inheritdoc}
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     $field = $this->getFieldDefinition();
     $formatters = $this->formatterPluginManager->getOptions($field->getType());
     $column_names = array_keys($field->getColumns());
     // If this is a multiple value field, add its options.
     if ($this->multiple) {
         $this->multiple_options_form($form, $form_state);
     }
     // No need to ask the user anything if the field has only one column.
     if (count($field->getColumns()) == 1) {
         $form['click_sort_column'] = array('#type' => 'value', '#value' => isset($column_names[0]) ? $column_names[0] : '');
     } else {
         $form['click_sort_column'] = array('#type' => 'select', '#title' => $this->t('Column used for click sorting'), '#options' => array_combine($column_names, $column_names), '#default_value' => $this->options['click_sort_column'], '#description' => $this->t('Used by Style: Table to determine the actual column to click sort the field on. The default is usually fine.'));
     }
     $form['type'] = array('#type' => 'select', '#title' => $this->t('Formatter'), '#options' => $formatters, '#default_value' => $this->options['type'], '#ajax' => array('url' => views_ui_build_form_url($form_state)), '#submit' => array(array($this, 'submitTemporaryForm')), '#executes_submit_callback' => TRUE);
     $form['field_api_classes'] = array('#title' => $this->t('Use field template'), '#type' => 'checkbox', '#default_value' => $this->options['field_api_classes'], '#description' => $this->t('If checked, field api classes will be added by field templates. This is not recommended unless your CSS depends upon these classes. If not checked, template will not be used.'), '#fieldset' => 'style_settings', '#weight' => 20);
     if ($this->multiple) {
         $form['field_api_classes']['#description'] .= ' ' . $this->t('Checking this option will cause the group Display Type and Separator values to be ignored.');
     }
     // Get the settings form.
     $settings_form = array('#value' => array());
     $format = isset($form_state->getUserInput()['options']['type']) ? $form_state->getUserInput()['options']['type'] : $this->options['type'];
     if ($formatter = $this->getFormatterInstance($format)) {
         $settings_form = $formatter->settingsForm($form, $form_state);
         // Convert field UI selector states to work in the Views field form.
         FormHelper::rewriteStatesSelector($settings_form, "fields[{$field->getName()}][settings_edit_form]", 'options');
     }
     $form['settings'] = $settings_form;
 }
Example #26
0
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     $form['text'] = array('#type' => 'textfield', '#title' => t('Text to display'), '#default_value' => $this->options['text']);
     $form['link_to_entity'] = array('#title' => $this->t('Link field to the entity if there is no comment'), '#type' => 'checkbox', '#default_value' => $this->options['link_to_entity']);
     parent::buildOptionsForm($form, $form_state);
 }
Example #27
0
 /**
  * {@inheritdoc}
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     $form['display_name'] = ['#type' => 'checkbox', '#title' => $this->t('Display the localized country name instead of the two character country code'), '#default_value' => !empty($this->options['display_name'])];
     parent::buildOptionsForm($form, $form_state);
 }
Example #28
0
 /**
  * {@inheritdoc}
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     $form['file_size_display'] = array('#title' => $this->t('File size display'), '#type' => 'select', '#options' => array('formatted' => $this->t('Formatted (in KB or MB)'), 'bytes' => $this->t('Raw bytes')));
 }
Example #29
0
 /**
  * {@inheritdoc}
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     $form['link_to_entity'] = array('#title' => t('Link to entity'), '#description' => t('Make entity label a link to entity page.'), '#type' => 'checkbox', '#default_value' => !empty($this->options['link_to_entity']));
     parent::buildOptionsForm($form, $form_state);
 }
 /**
  * {@inheritdoc}
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     $form['display_as_link'] = array('#title' => $this->t('Display as link'), '#type' => 'checkbox', '#default_value' => !empty($this->options['display_as_link']));
     parent::buildOptionsForm($form, $form_state);
 }