You are here

function template_preprocess_patchinfo_excluded_modules in PatchInfo 8.2

Same name and namespace in other branches
  1. 8 patchinfo.module \template_preprocess_patchinfo_excluded_modules()

Prepares variables for patchinfo excluded modules templates.

Default template: patchinfo-excluded-modules.html.twig.

Parameters

array $variables: An associative array containing:

  • excluded_modules: List of modules excluded from update check.

File

./patchinfo.module, line 393
Patch Info primary module file.

Code

function template_preprocess_patchinfo_excluded_modules(array &$variables) {
  if (count($variables['excluded_modules']) > 0) {

    // Prepare excluded modules for use in template.
    $variables['excluded_modules'] = [
      '#theme' => 'item_list',
      '#items' => $variables['excluded_modules'],
    ];

    // Provide URL to settings page of update module.
    $variables['settings_url'] = Url::fromRoute('update.settings', [], [
      'query' => \Drupal::destination()
        ->getAsArray(),
    ]);
  }
}