You are here

private function IpGeoLocPluginStyleLeaflet::addMarkerTooltips in IP Geolocation Views & Maps 8

Form part definition.

1 call to IpGeoLocPluginStyleLeaflet::addMarkerTooltips()
IpGeoLocPluginStyleLeaflet::buildOptionsForm in src/Plugin/views/style/IpGeoLocPluginStyleLeaflet.php
Provide a form to edit options for this plugin.

File

src/Plugin/views/style/IpGeoLocPluginStyleLeaflet.php, line 466

Class

IpGeoLocPluginStyleLeaflet
Views Style plugin extension for Leaflet (if enabled).

Namespace

Drupal\ip_geoloc\Plugin\views\style

Code

private function addMarkerTooltips(&$form, $fields, &$weight) {
  $form['tooltips'] = [
    '#title' => $this
      ->t('Marker tooltips'),
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
    '#collapsed' => empty($this->options['tooltips']['marker_tooltip']),
    '#description' => $this
      ->t('In addition to balloons, which pop up when markers are <em>clicked</em>, you can have tooltips. A tooltip is a short text that appears when you <em>hover</em> over a marker.'),
    '#weight' => $weight++,
  ];
  $note_polygons = $this
    ->t('Applies to markers. If you want tooltips for lines and polygons too, please use this selector in combination with <a href="@url_leaflet_label">Leaflet Label</a>.', [
    '@url_leaflet_label' => 'http://drupal.org/project/leaflet_label',
  ]);
  $form['tooltips']['marker_tooltip'] = [
    '#title' => $this
      ->t('Views field to populate tooltips'),
    '#type' => 'select',
    // '#multiple' => TRUE,
    // '#size' => 6,.
    '#default_value' => $this->options['tooltips']['marker_tooltip'],
    '#options' => $fields,
    '#description' => $this
      ->t('Example: "Content: Title"') . '<br/>' . $note_polygons,
  ];
}