view core/modules/views/views.views_execution.inc @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents af1871eacc83
children
line wrap: on
line source
<?php

/**
 * @file
 * Provides views runtime hooks for views.module.
 */

use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\PluginBase;

/**
 * Implements hook_views_query_substitutions().
 *
 * Makes the following substitutions:
 * - Current time.
 * - Drupal version.
 * - Special language codes; see
 *   \Drupal\views\Plugin\views\PluginBase::listLanguages().
 */
function views_views_query_substitutions(ViewExecutable $view) {
  $substitutions = [
    '***CURRENT_VERSION***' => \Drupal::VERSION,
    '***CURRENT_TIME***' => REQUEST_TIME,
  ] + PluginBase::queryLanguageSubstitutions();

  return $substitutions;
}

/**
 * Implements hook_views_form_substitutions().
 */
function views_views_form_substitutions() {
  $select_all = [
    '#type' => 'checkbox',
    '#default_value' => FALSE,
    '#attributes' => ['class' => ['action-table-select-all']],
  ];
  return [
    '<!--action-bulk-form-select-all-->' => \Drupal::service('renderer')->render($select_all),
  ];
}