diff core/modules/views/views.views_execution.inc @ 0:c75dbcec494b

Initial commit from drush-created site
author Chris Cannam
date Thu, 05 Jul 2018 14:24:15 +0000
parents
children 12f9dff5fda9
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/modules/views/views.views_execution.inc	Thu Jul 05 14:24:15 2018 +0000
@@ -0,0 +1,27 @@
+<?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;
+}