views.views_execution.inc 992 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * @file
  4. * Provides views runtime hooks for views.module.
  5. */
  6. use Drupal\views\ViewExecutable;
  7. use Drupal\views\Plugin\views\PluginBase;
  8. /**
  9. * Implements hook_views_query_substitutions().
  10. *
  11. * Makes the following substitutions:
  12. * - Current time.
  13. * - Drupal version.
  14. * - Special language codes; see
  15. * \Drupal\views\Plugin\views\PluginBase::listLanguages().
  16. */
  17. function views_views_query_substitutions(ViewExecutable $view) {
  18. $substitutions = [
  19. '***CURRENT_VERSION***' => \Drupal::VERSION,
  20. '***CURRENT_TIME***' => REQUEST_TIME,
  21. ] + PluginBase::queryLanguageSubstitutions();
  22. return $substitutions;
  23. }
  24. /**
  25. * Implements hook_views_form_substitutions().
  26. */
  27. function views_views_form_substitutions() {
  28. $select_all = [
  29. '#type' => 'checkbox',
  30. '#default_value' => FALSE,
  31. '#attributes' => ['class' => ['action-table-select-all']],
  32. ];
  33. return [
  34. '<!--action-bulk-form-select-all-->' => \Drupal::service('renderer')->render($select_all),
  35. ];
  36. }