View source
<?php
declare (strict_types=1);
use Drupal\Core\Render\Element;
use Drupal\date_recur\DateRecurCachedHooks;
use Drupal\date_recur\DateRecurViewsHooks;
use Drupal\field\FieldStorageConfigInterface;
function date_recur_theme(array $existing, string $type, string $theme, string $path) : array {
$cachedHooks = \Drupal::classResolver(DateRecurCachedHooks::class);
return $cachedHooks
->hookTheme($existing, $type, $theme, $path);
}
function date_recur_field_info_alter(array &$info) : void {
$cachedHooks = \Drupal::classResolver(DateRecurCachedHooks::class);
$cachedHooks
->fieldInfoAlter($info);
}
function date_recur_field_views_data(FieldStorageConfigInterface $fieldDefinition) : array {
$viewsHooks = \Drupal::classResolver(DateRecurViewsHooks::class);
return $viewsHooks
->fieldViewsData($fieldDefinition);
}
function date_recur_views_data() : array {
$viewsHooks = \Drupal::classResolver(DateRecurViewsHooks::class);
return $viewsHooks
->viewsData();
}
function date_recur_views_data_alter(array &$data) : void {
$viewsHooks = \Drupal::classResolver(DateRecurViewsHooks::class);
$viewsHooks
->viewsDataAlter($data);
}
function template_preprocess_date_recur_settings_frequency_table(array &$variables) : void {
$partTitles = [];
$variables['table'] = [];
foreach (Element::children($variables['element']) as $key) {
$variables['table'][$key] = $variables['element'][$key];
$row =& $variables['table'][$key];
foreach (Element::children($row['parts']) as $rowKey) {
$row['parts']['parts'][$rowKey] = $row['parts'][$rowKey];
unset($row['parts'][$rowKey]);
foreach ($row['parts']['parts'] as $part) {
$partTitles[] = $part['#title'];
}
}
unset($variables['element'][$key]);
}
$variables['all_parts'] = array_unique($partTitles);
}