2013-04-10 20:12:01 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* Provides views runtime hooks for views.module.
|
|
|
|
*/
|
|
|
|
|
|
|
|
use Drupal\views\ViewExecutable;
|
2014-08-30 05:17:55 +00:00
|
|
|
use Drupal\views\Plugin\views\PluginBase;
|
2013-04-10 20:12:01 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements hook_views_query_substitutions().
|
|
|
|
*
|
2014-08-30 05:17:55 +00:00
|
|
|
* Makes the following substitutions:
|
|
|
|
* - Current time.
|
|
|
|
* - Drupal version.
|
|
|
|
* - Special language codes; see
|
|
|
|
* \Drupal\views\Plugin\views\PluginBase::listLanguages().
|
2013-04-10 20:12:01 +00:00
|
|
|
*/
|
|
|
|
function views_views_query_substitutions(ViewExecutable $view) {
|
2017-03-04 01:20:24 +00:00
|
|
|
$substitutions = [
|
2013-09-16 03:58:06 +00:00
|
|
|
'***CURRENT_VERSION***' => \Drupal::VERSION,
|
2013-04-10 20:12:01 +00:00
|
|
|
'***CURRENT_TIME***' => REQUEST_TIME,
|
2017-03-04 01:20:24 +00:00
|
|
|
] + PluginBase::queryLanguageSubstitutions();
|
2014-08-30 05:17:55 +00:00
|
|
|
|
|
|
|
return $substitutions;
|
2013-04-10 20:12:01 +00:00
|
|
|
}
|