You are here

class GeofieldGoogleMapViewStyle in Geofield Map 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/views/style/GeofieldGoogleMapViewStyle.php \Drupal\geofield_map\Plugin\views\style\GeofieldGoogleMapViewStyle

Style plugin to render a View output as a Leaflet map.

Attributes set below end up in the $this->definition[] array.

Plugin annotation


@ViewsStyle(
  id = "geofield_google_map",
  title = @Translation("Geofield Google Map"),
  help = @Translation("Displays a View as a Geofield Google Map."),
  display_types = {"normal"},
  theme = "geofield-google-map"
)

Hierarchy

Expanded class hierarchy of GeofieldGoogleMapViewStyle

File

src/Plugin/views/style/GeofieldGoogleMapViewStyle.php, line 37

Namespace

Drupal\geofield_map\Plugin\views\style
View source
class GeofieldGoogleMapViewStyle extends DefaultStyle implements ContainerFactoryPluginInterface {
  use GeofieldMapFieldTrait;

  /**
   * Empty Map Options.
   *
   * @var array
   */
  protected $emptyMapOptions = [
    '0' => 'View No Results Behaviour',
    '1' => 'Empty Map Centered at the Default Center',
  ];

  /**
   * The config factory service.
   *
   * @var \Drupal\Core\Config\ConfigFactoryInterface
   */
  protected $config;

  /**
   * The Entity type property.
   *
   * @var string
   */
  protected $entityType;

  /**
   * The Entity Info service property.
   *
   * @var string
   */
  protected $entityInfo;

  /**
   * The Entity type manager service.
   *
   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
   */
  protected $entityManager;

  /**
   * The Entity Field manager service property.
   *
   * @var \Drupal\Core\Entity\EntityFieldManagerInterface
   */
  protected $entityFieldManager;

  /**
   * The Entity Display Repository service property.
   *
   * @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface
   */
  protected $entityDisplay;

  /**
   * The Link generator Service.
   *
   * @var \Drupal\Core\Utility\LinkGeneratorInterface
   */
  protected $link;

  /**
   * The geoPhpWrapper service.
   *
   * @var \Drupal\geofield\GeoPHP\GeoPHPInterface
   */
  protected $geoPhpWrapper;

  /**
   * Current user service.
   *
   * @var \Drupal\Core\Session\AccountInterface
   */
  protected $currentUser;

  /**
   * The Renderer service property.
   *
   * @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface
   */
  protected $renderer;

  /**
   * Constructs a GeofieldGoogleMapView style instance.
   *
   * @param array $configuration
   *   A configuration array containing information about the plugin instance.
   * @param string $plugin_id
   *   The plugin_id for the plugin instance.
   * @param mixed $plugin_definition
   *   The plugin implementation definition.
   * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
   *   A config factory for retrieving required config objects.
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_manager
   *   The entity manager.
   * @param \Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager
   *   The entity field manager.
   * @param \Drupal\Core\Entity\EntityDisplayRepositoryInterface $entity_display
   *   The entity display manager.
   * @param \Drupal\Core\Utility\LinkGeneratorInterface $link_generator
   *   The Link Generator service.
   * @param \Drupal\geofield\GeoPHP\GeoPHPInterface $geophp_wrapper
   *   The The geoPhpWrapper.
   * @param \Drupal\Core\Session\AccountInterface $current_user
   *   Current user service.
   * @param \Drupal\Core\Render\RendererInterface $renderer
   *   The Renderer service.
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition, ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_manager, EntityFieldManagerInterface $entity_field_manager, EntityDisplayRepositoryInterface $entity_display, LinkGeneratorInterface $link_generator, GeoPHPInterface $geophp_wrapper, AccountInterface $current_user, RendererInterface $renderer) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->entityManager = $entity_manager;
    $this->entityFieldManager = $entity_field_manager;
    $this->entityDisplay = $entity_display;
    $this->config = $config_factory;
    $this->link = $link_generator;
    $this->geoPhpWrapper = $geophp_wrapper;
    $this->currentUser = $current_user;
    $this->renderer = $renderer;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    return new static($configuration, $plugin_id, $plugin_definition, $container
      ->get('config.factory'), $container
      ->get('entity_type.manager'), $container
      ->get('entity_field.manager'), $container
      ->get('entity_display.repository'), $container
      ->get('link_generator'), $container
      ->get('geofield.geophp'), $container
      ->get('current_user'), $container
      ->get('renderer'));
  }

  /**
   * {@inheritdoc}
   */
  public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
    parent::init($view, $display, $options);

    // For later use, set entity info related to the View's base table.
    $base_tables = array_keys($view
      ->getBaseTables());
    $base_table = reset($base_tables);
    foreach ($this->entityManager
      ->getDefinitions() as $key => $info) {
      if ($info
        ->getDataTable() == $base_table) {
        $this->entityType = $key;
        $this->entityInfo = $info;
        return;
      }
    }
  }

  /**
   * {@inheritdoc}
   */
  protected $usesRowPlugin = FALSE;

  /**
   * Does the style plugin support custom css class for the rows.
   *
   * @var bool
   */
  protected $usesRowClass = FALSE;

  /**
   * Does the style plugin support grouping of rows.
   *
   * @var bool
   */
  protected $usesGrouping = FALSE;

  /**
   * Does the style plugin for itself support to add fields to it's output.
   *
   * @var bool
   */
  protected $usesFields = TRUE;

  /**
   * Should field labels be enabled by default.
   *
   * @var bool
   */
  protected $defaultFieldLabels = TRUE;

  /**
   * {@inheritdoc}
   */
  public function evenEmpty() {

    // Render map even if there is no data.
    return TRUE;
  }

  /**
   * {@inheritdoc}
   */
  public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    parent::buildOptionsForm($form, $form_state);
    $default_settings = self::defineOptions();

    // Get a list of fields and a sublist of geo data fields in this view.
    $fields = [];
    $fields_geo_data = [];

    /* @var \Drupal\views\Plugin\views\ViewsHandlerInterface $handler) */
    foreach ($this->displayHandler
      ->getHandlers('field') as $field_id => $handler) {
      $label = $handler
        ->adminLabel() ?: $field_id;
      $fields[$field_id] = $label;
      if (is_a($handler, '\\Drupal\\views\\Plugin\\views\\field\\EntityField')) {

        /* @var \Drupal\views\Plugin\views\field\EntityField $handler */
        $field_storage_definitions = $this->entityFieldManager
          ->getFieldStorageDefinitions($handler
          ->getEntityType());
        $field_storage_definition = $field_storage_definitions[$handler->definition['field_name']];
        if ($field_storage_definition
          ->getType() == 'geofield') {
          $fields_geo_data[$field_id] = $label;
        }
      }
    }

    // Check whether we have a geo data field we can work with.
    if (empty($fields_geo_data)) {
      $form['error'] = [
        '#type' => 'html_tag',
        '#tag' => 'div',
        '#value' => $this
          ->t('Please add at least one Geofield to the View and come back here to set it as Data Source.'),
        '#attributes' => [
          'class' => [
            'geofield-map-warning',
          ],
        ],
        '#attached' => [
          'library' => [
            'geofield_map/geofield_map_general',
          ],
        ],
      ];
      return;
    }

    // Map data source.
    $form['data_source'] = [
      '#type' => 'select',
      '#title' => $this
        ->t('Data Source'),
      '#description' => $this
        ->t('Which field contains geodata?'),
      '#options' => $fields_geo_data,
      '#default_value' => $this->options['data_source'],
      '#required' => TRUE,
    ];
    $desc_options = array_merge([
      '0' => $this
        ->t('- Any - No Infowindow'),
    ], $fields);

    // Add an option to render the entire entity using a view mode.
    if ($this->entityType) {
      $desc_options += [
        '#rendered_entity' => $this
          ->t('- Rendered @entity entity -', [
          '@entity' => $this->entityType,
        ]),
      ];
    }
    $this->options['infowindow_content_options'] = $desc_options;
    if ($this->entityType) {

      // Get the human readable labels for the entity view modes.
      $view_mode_options = [];
      foreach ($this->entityDisplay
        ->getViewModes($this->entityType) as $key => $view_mode) {
        $view_mode_options[$key] = $view_mode['label'];
      }

      // The View Mode drop-down is visible conditional on "#rendered_entity"
      // being selected in the Description drop-down above.
      $form['view_mode'] = [
        '#fieldset' => 'map_marker_and_infowindow',
        '#type' => 'select',
        '#title' => $this
          ->t('View mode'),
        '#description' => $this
          ->t('View mode the entity will be displayed in the Infowindow.'),
        '#options' => $view_mode_options,
        '#default_value' => !empty($this->options['view_mode']) ? $this->options['view_mode'] : 'full',
        '#states' => [
          'visible' => [
            ':input[name="style_options[map_marker_and_infowindow][infowindow_field]"]' => [
              'value' => '#rendered_entity',
            ],
          ],
        ],
      ];
    }
    $form = $form + $this
      ->generateGmapSettingsForm($form, $form_state, $this->options, $default_settings);
  }

  /**
   * Renders the View.
   */
  public function render() {
    $map_settings = $this->options;
    $element = [];

    // Performs some preprocess on the maps settings before sending to js.
    $this
      ->preProcessMapSettings($map_settings);
    $js_settings = [
      'mapid' => Html::getUniqueId("geofield_map_view_" . $this->view
        ->id() . '_' . $this->view->current_display),
      'map_settings' => $map_settings,
      'data' => [],
    ];
    $data = [];

    // Get the Geofield field.
    $geofield_name = $map_settings['data_source'];

    // If the Geofield field is null, output a warning
    // to the Geofield Map administrator.
    if (empty($geofield_name) && $this->currentUser
      ->hasPermission('configure geofield_map')) {
      $element = [
        '#markup' => '<div class="geofield-map-warning">' . $this
          ->t("The Geofield field hasn't not been correctly set for this View. <br>Add at least one Geofield to the View and set it as Data Source in the Geofield Google Map View Display Settings.") . "</div>",
        '#attached' => [
          'library' => [
            'geofield_map/geofield_map_general',
          ],
        ],
      ];
    }

    // It the Geofield field is not null, and there are results or a not null
    // empty behaviour has been set, render the results.
    if (!empty($geofield_name) && (!empty($this->view->result) || $map_settings['map_empty']['empty_behaviour'] == '1')) {
      $this
        ->renderFields($this->view->result);

      /* @var \Drupal\views\ResultRow  $result */
      foreach ($this->view->result as $id => $result) {
        $geofield_value = $this
          ->getFieldValue($id, $geofield_name);

        // In case the result is not among the raw results, get it from the
        // rendered results.
        if (empty($geofield_value)) {
          $geofield_value = $this->rendered_fields[$id][$geofield_name];
        }

        // In case the result is not null.
        if (!empty($geofield_value)) {

          // If it is a single value field, transform into an array.
          $geofield_value = is_array($geofield_value) ? $geofield_value : [
            $geofield_value,
          ];
          $description_field = isset($map_settings['map_marker_and_infowindow']['infowindow_field']) ? $map_settings['map_marker_and_infowindow']['infowindow_field'] : NULL;
          $description = [];
          $entity = $result->_entity;

          // Render the entity with the selected view mode.
          if (isset($description_field) && $description_field === '#rendered_entity' && is_object($result)) {
            $build = $this->entityManager
              ->getViewBuilder($entity
              ->getEntityTypeId())
              ->view($entity, $map_settings['view_mode'], $entity
              ->language()
              ->getId());
            $description[] = $this->renderer
              ->renderPlain($build);
          }
          elseif (isset($description_field)) {
            $description_field_name = strtolower($map_settings['map_marker_and_infowindow']['infowindow_field']);
            if (isset($entity->{$description_field_name})) {

              // Check if the entity has a $description_field_name field.
              foreach ($entity->{$description_field_name}
                ->getValue() as $value) {
                if ($map_settings['map_marker_and_infowindow']['multivalue_split'] == FALSE) {
                  $description[] = $this->rendered_fields[$id][$description_field];
                  break;
                }
                $description[] = isset($value['value']) ? $value['value'] : '';
              }
            }
            elseif (isset($this->rendered_fields[$id][$description_field])) {
              $description[] = $this->rendered_fields[$id][$description_field];
            }
          }

          // Add Views fields to the Json output as additional_data property.
          $view_data = [];
          foreach ($this->rendered_fields[$id] as $field_name => $rendered_field) {
            if (!empty($rendered_field) && !$this->view->field[$field_name]->options['exclude']) {

              /* @var \Drupal\Core\Render\Markup $rendered_field */
              $view_data[$field_name] = $rendered_field
                ->__toString();
            }
          }
          $data = array_merge($data, $this
            ->getGeoJsonData($geofield_value, $description, $view_data));
        }
      }
      $js_settings['data'] = [
        'type' => 'FeatureCollection',
        'features' => $data,
      ];
      $element = geofield_map_googlemap_render($js_settings);
    }
    return $element;
  }

  /**
   * Set default options.
   */
  protected function defineOptions() {
    $options = parent::defineOptions();
    $options['data_source'] = [
      'default' => '',
    ];
    $options['name_field'] = [
      'default' => '',
    ];
    $options['description_field'] = [
      'default' => '',
    ];
    $options['view_mode'] = [
      'default' => 'full',
    ];
    $geofield_google_map_default_settings = [];
    foreach (self::getDefaultSettings() as $k => $setting) {
      $geofield_google_map_default_settings[$k] = [
        'default' => $setting,
      ];
    }
    return $options + $geofield_google_map_default_settings;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
GeofieldGoogleMapViewStyle::$config protected property The config factory service.
GeofieldGoogleMapViewStyle::$currentUser protected property Current user service.
GeofieldGoogleMapViewStyle::$defaultFieldLabels protected property Should field labels be enabled by default. Overrides StylePluginBase::$defaultFieldLabels
GeofieldGoogleMapViewStyle::$emptyMapOptions protected property Empty Map Options.
GeofieldGoogleMapViewStyle::$entityDisplay protected property The Entity Display Repository service property.
GeofieldGoogleMapViewStyle::$entityFieldManager protected property The Entity Field manager service property.
GeofieldGoogleMapViewStyle::$entityInfo protected property The Entity Info service property.
GeofieldGoogleMapViewStyle::$entityManager protected property The Entity type manager service.
GeofieldGoogleMapViewStyle::$entityType protected property The Entity type property.
GeofieldGoogleMapViewStyle::$geoPhpWrapper protected property The geoPhpWrapper service.
GeofieldGoogleMapViewStyle::$link protected property The Link generator Service.
GeofieldGoogleMapViewStyle::$renderer protected property The Renderer service property. Overrides PluginBase::$renderer
GeofieldGoogleMapViewStyle::$usesFields protected property Does the style plugin for itself support to add fields to it's output. Overrides StylePluginBase::$usesFields
GeofieldGoogleMapViewStyle::$usesGrouping protected property Does the style plugin support grouping of rows. Overrides StylePluginBase::$usesGrouping
GeofieldGoogleMapViewStyle::$usesRowClass protected property Does the style plugin support custom css class for the rows. Overrides DefaultStyle::$usesRowClass
GeofieldGoogleMapViewStyle::$usesRowPlugin protected property Whether or not this style uses a row plugin. Overrides DefaultStyle::$usesRowPlugin
GeofieldGoogleMapViewStyle::buildOptionsForm public function Provide a form to edit options for this plugin. Overrides StylePluginBase::buildOptionsForm
GeofieldGoogleMapViewStyle::create public static function Creates an instance of the plugin. Overrides PluginBase::create
GeofieldGoogleMapViewStyle::defineOptions protected function Set default options. Overrides StylePluginBase::defineOptions
GeofieldGoogleMapViewStyle::evenEmpty public function Should the output of the style plugin be rendered even if it's a empty view. Overrides StylePluginBase::evenEmpty
GeofieldGoogleMapViewStyle::init public function Overrides \Drupal\views\Plugin\views\PluginBase::init(). Overrides StylePluginBase::init
GeofieldGoogleMapViewStyle::render public function Renders the View. Overrides StylePluginBase::render
GeofieldGoogleMapViewStyle::__construct public function Constructs a GeofieldGoogleMapView style instance. Overrides PluginBase::__construct
GeofieldMapFieldTrait::$customMapStylePlaceholder protected property
GeofieldMapFieldTrait::$gMapTypesOptions protected property Google Map Types Options.
GeofieldMapFieldTrait::$infowindowFieldTypesOptions protected property Google Map Types Options.
GeofieldMapFieldTrait::customMapStyleValidate public static function Form element validation handler for a Custom Map Style Name Required.
GeofieldMapFieldTrait::generateGmapSettingsForm public function Generate the Google Map Settings Form.
GeofieldMapFieldTrait::getDefaultSettings public static function Get the Default Settings.
GeofieldMapFieldTrait::getGeoJsonData protected function Transform Geofield data into Geojson features.
GeofieldMapFieldTrait::getGmapApiKey private function Get the GMap Api Key from the geofield_map settings/configuration.
GeofieldMapFieldTrait::jsonValidate public static function Form element json format validation handler.
GeofieldMapFieldTrait::maxZoomLevelValidate public static function Form element validation handler for the Map Max Zoom level.
GeofieldMapFieldTrait::preProcessMapSettings protected function Pre Process the MapSettings.
GeofieldMapFieldTrait::setCustomStyleMapElement private function Set Custom Map Style Element.
GeofieldMapFieldTrait::setMapAdditionalOptionsElement private function Set Map Additional Options Element.
GeofieldMapFieldTrait::setMapCenterElement private function Set Map Center Element.
GeofieldMapFieldTrait::setMapControlsElement private function Set Map Control Element.
GeofieldMapFieldTrait::setMapDimensionsElement private function Set Map Dimension Element.
GeofieldMapFieldTrait::setMapEmptyElement private function Set Map Empty Options Element.
GeofieldMapFieldTrait::setMapGoogleApiKeyElement private function Set Map Google Api Key Element.
GeofieldMapFieldTrait::setMapMarkerAndInfowindowElement private function Set Map Marker and Infowindow Element.
GeofieldMapFieldTrait::setMapMarkerclusterElement private function Set Map Marker Cluster Element.
GeofieldMapFieldTrait::setMapOmsElement private function Set Overlapping Marker Spiderfier Element.
GeofieldMapFieldTrait::setMapZoomAndPanElement private function Set Map Zoom and Pan Element.
GeofieldMapFieldTrait::urlValidate public static function Form element url format validation handler.
GeofieldMapFieldTrait::zoomLevelValidate public static function Form element validation handler for a Map Zoom level.
MessengerTrait::$messenger protected property The messenger. 29
MessengerTrait::messenger public function Gets the messenger. 29
MessengerTrait::setMessenger public function Sets the messenger.
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$definition public property Plugins's definition
PluginBase::$displayHandler public property The display object this plugin is for.
PluginBase::$options public property Options for this plugin will be held here.
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::$view public property The top object of a view. 1
PluginBase::calculateDependencies public function Calculates dependencies for the configured plugin. Overrides DependentPluginInterface::calculateDependencies 14
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::doFilterByDefinedOptions protected function Do the work to filter out stored options depending on the defined options.
PluginBase::filterByDefinedOptions public function Filter out stored options depending on the defined options. Overrides ViewsPluginInterface::filterByDefinedOptions
PluginBase::getAvailableGlobalTokens public function Returns an array of available token replacements. Overrides ViewsPluginInterface::getAvailableGlobalTokens
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 3
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::getProvider public function Returns the plugin provider. Overrides ViewsPluginInterface::getProvider
PluginBase::getRenderer protected function Returns the render API renderer. 1
PluginBase::globalTokenForm public function Adds elements for available core tokens to a form. Overrides ViewsPluginInterface::globalTokenForm
PluginBase::globalTokenReplace public function Returns a string with any core tokens replaced. Overrides ViewsPluginInterface::globalTokenReplace
PluginBase::INCLUDE_ENTITY constant Include entity row languages when listing languages.
PluginBase::INCLUDE_NEGOTIATED constant Include negotiated languages when listing languages.
PluginBase::isConfigurable public function Determines if the plugin is configurable.
PluginBase::listLanguages protected function Makes an array of languages, optionally including special languages.
PluginBase::pluginTitle public function Return the human readable name of the display. Overrides ViewsPluginInterface::pluginTitle
PluginBase::preRenderAddFieldsetMarkup public static function Moves form elements into fieldsets for presentation purposes. Overrides ViewsPluginInterface::preRenderAddFieldsetMarkup
PluginBase::preRenderFlattenData public static function Flattens the structure of form elements. Overrides ViewsPluginInterface::preRenderFlattenData
PluginBase::queryLanguageSubstitutions public static function Returns substitutions for Views queries for languages.
PluginBase::setOptionDefaults protected function Fills up the options of the plugin with defaults.
PluginBase::submitOptionsForm public function Handle any special handling on the validate form. Overrides ViewsPluginInterface::submitOptionsForm 16
PluginBase::summaryTitle public function Returns the summary of the settings in the display. Overrides ViewsPluginInterface::summaryTitle 6
PluginBase::themeFunctions public function Provide a full list of possible theme templates used by this style. Overrides ViewsPluginInterface::themeFunctions 1
PluginBase::unpackOptions public function Unpack options over our existing defaults, drilling down into arrays so that defaults don't get totally blown away. Overrides ViewsPluginInterface::unpackOptions
PluginBase::usesOptions public function Returns the usesOptions property. Overrides ViewsPluginInterface::usesOptions 8
PluginBase::viewsTokenReplace protected function Replaces Views' tokens in a given string. The resulting string will be sanitized with Xss::filterAdmin. 1
PluginBase::VIEWS_QUERY_LANGUAGE_SITE_DEFAULT constant Query string to indicate the site default language.
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.
StylePluginBase::$groupingTheme protected property The theme function used to render the grouping set.
StylePluginBase::$rendered_fields protected property Stores the rendered field values, keyed by the row index and field name.
StylePluginBase::$rowTokens protected property Store all available tokens row rows.
StylePluginBase::$usesOptions protected property Denotes whether the plugin has an additional options form. Overrides PluginBase::$usesOptions
StylePluginBase::buildSort public function Called by the view builder to see if this style handler wants to interfere with the sorts. If so it should build; if it returns any non-TRUE value, normal sorting will NOT be added to the query. 1
StylePluginBase::buildSortPost public function Called by the view builder to let the style build a second set of sorts that will come after any other sorts in the view. 1
StylePluginBase::defaultFieldLabels public function Return TRUE if this style enables field labels by default. 1
StylePluginBase::destroy public function Clears a plugin. Overrides PluginBase::destroy
StylePluginBase::elementPreRenderRow public function #pre_render callback for view row field rendering.
StylePluginBase::getField public function Gets a rendered field.
StylePluginBase::getFieldValue public function Get the raw field value.
StylePluginBase::getRowClass public function Return the token replaced row class for the specified row.
StylePluginBase::preRender public function Allow the style to do stuff before each row is rendered.
StylePluginBase::query public function Add anything to the query that we might need to. Overrides PluginBase::query 1
StylePluginBase::renderFields protected function Renders all of the fields for a given style and store them on the object.
StylePluginBase::renderGrouping public function Group records as needed for rendering.
StylePluginBase::renderGroupingSets public function Render the grouping sets.
StylePluginBase::renderRowGroup protected function Renders a group of rows of the grouped view.
StylePluginBase::tokenizeValue public function Take a value and apply token replacement logic to it.
StylePluginBase::trustedCallbacks public static function Lists the trusted callbacks provided by the implementing class. Overrides PluginBase::trustedCallbacks
StylePluginBase::usesFields public function Return TRUE if this style also uses fields. 3
StylePluginBase::usesGrouping public function Returns the usesGrouping property. 3
StylePluginBase::usesRowClass public function Returns the usesRowClass property. 3
StylePluginBase::usesRowPlugin public function Returns the usesRowPlugin property. 10
StylePluginBase::usesTokens public function Return TRUE if this style uses tokens.
StylePluginBase::validate public function Validate that the plugin is correct and can be saved. Overrides PluginBase::validate
StylePluginBase::validateOptionsForm public function Validate the options form. Overrides PluginBase::validateOptionsForm
StylePluginBase::wizardForm public function Provide a form in the views wizard if this style is selected.
StylePluginBase::wizardSubmit public function Alter the options of a display before they are added to the view. 1
TrustedCallbackInterface::THROW_EXCEPTION constant Untrusted callbacks throw exceptions.
TrustedCallbackInterface::TRIGGER_SILENCED_DEPRECATION constant Untrusted callbacks trigger silenced E_USER_DEPRECATION errors.
TrustedCallbackInterface::TRIGGER_WARNING constant Untrusted callbacks trigger E_USER_WARNING errors.