Loading src/Plugin/Field/FieldFormatter/GeolocationGoogleMapFormatter.php +7 −0 Changes for src/Plugin/Field/FieldFormatter/GeolocationGoogleMapFormatter.php: 7 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace Drupal\geolocation\Plugin\Field\FieldFormatter; use Drupal\Component\Render\PlainTextOutput; use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Field\FormatterBase; use Drupal\Core\Form\FormStateInterface; Loading Loading @@ -207,14 +208,20 @@ class GeolocationGoogleMapFormatter extends FormatterBase { 'callback' => [$this, 'geolocationItemTokens'], 'clear' => TRUE, ]); $title = PlainTextOutput::renderFromHtml($title); if (empty($title)) { $title = $item->lat . ', ' . $item->lng; } $content = \Drupal::token()->replace($settings['info_text'], $token_context, [ 'callback' => [$this, 'geolocationItemTokens'], 'clear' => TRUE, ]); $content = PlainTextOutput::renderFromHtml($content); $location = [ '#theme' => 'geolocation_common_map_location', '#content' => $content, Loading src/Plugin/views/style/CommonMap.php +2 −0 Changes for src/Plugin/views/style/CommonMap.php: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace Drupal\geolocation\Plugin\views\style; use Drupal\Component\Render\PlainTextOutput; use Drupal\views\Plugin\views\style\StylePluginBase; use Drupal\Core\Form\FormStateInterface; use Drupal\geolocation\Plugin\views\field\GeolocationField; Loading Loading @@ -151,6 +152,7 @@ class CommonMap extends StylePluginBase { */ if (!empty($this->options['context_popup_content'])) { $context_popup_content = \Drupal::token()->replace($this->options['context_popup_content']); $context_popup_content = PlainTextOutput::renderFromHtml($context_popup_content); $build['#attached']['drupalSettings']['geolocation']['commonMap'][$map_id]['contextPopupContent'] = []; $build['#attached']['drupalSettings']['geolocation']['commonMap'][$map_id]['contextPopupContent']['enable'] = TRUE; $build['#attached']['drupalSettings']['geolocation']['commonMap'][$map_id]['contextPopupContent']['content'] = $context_popup_content; Loading Loading
src/Plugin/Field/FieldFormatter/GeolocationGoogleMapFormatter.php +7 −0 Changes for src/Plugin/Field/FieldFormatter/GeolocationGoogleMapFormatter.php: 7 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace Drupal\geolocation\Plugin\Field\FieldFormatter; use Drupal\Component\Render\PlainTextOutput; use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Field\FormatterBase; use Drupal\Core\Form\FormStateInterface; Loading Loading @@ -207,14 +208,20 @@ class GeolocationGoogleMapFormatter extends FormatterBase { 'callback' => [$this, 'geolocationItemTokens'], 'clear' => TRUE, ]); $title = PlainTextOutput::renderFromHtml($title); if (empty($title)) { $title = $item->lat . ', ' . $item->lng; } $content = \Drupal::token()->replace($settings['info_text'], $token_context, [ 'callback' => [$this, 'geolocationItemTokens'], 'clear' => TRUE, ]); $content = PlainTextOutput::renderFromHtml($content); $location = [ '#theme' => 'geolocation_common_map_location', '#content' => $content, Loading
src/Plugin/views/style/CommonMap.php +2 −0 Changes for src/Plugin/views/style/CommonMap.php: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace Drupal\geolocation\Plugin\views\style; use Drupal\Component\Render\PlainTextOutput; use Drupal\views\Plugin\views\style\StylePluginBase; use Drupal\Core\Form\FormStateInterface; use Drupal\geolocation\Plugin\views\field\GeolocationField; Loading Loading @@ -151,6 +152,7 @@ class CommonMap extends StylePluginBase { */ if (!empty($this->options['context_popup_content'])) { $context_popup_content = \Drupal::token()->replace($this->options['context_popup_content']); $context_popup_content = PlainTextOutput::renderFromHtml($context_popup_content); $build['#attached']['drupalSettings']['geolocation']['commonMap'][$map_id]['contextPopupContent'] = []; $build['#attached']['drupalSettings']['geolocation']['commonMap'][$map_id]['contextPopupContent']['enable'] = TRUE; $build['#attached']['drupalSettings']['geolocation']['commonMap'][$map_id]['contextPopupContent']['content'] = $context_popup_content; Loading