Backup of db before drupal security update
[yaffs-website] / web / core / modules / block_content / block_content.pages.inc
1 <?php
2
3 /**
4  * @file
5  * Provides page callbacks for custom blocks.
6  */
7
8 use Drupal\Core\Url;
9
10 /**
11  * Prepares variables for a custom block type creation list templates.
12  *
13  * Default template: block-content-add-list.html.twig.
14  *
15  * @param array $variables
16  *   An associative array containing:
17  *   - content: An array of block types.
18  *
19  * @see block_content_add_page()
20  */
21 function template_preprocess_block_content_add_list(&$variables) {
22   $variables['types'] = [];
23   $query = \Drupal::request()->query->all();
24   foreach ($variables['content'] as $type) {
25     $variables['types'][$type->id()] = [
26       'link' => \Drupal::l($type->label(), new Url('block_content.add_form', ['block_content_type' => $type->id()], ['query' => $query])),
27       'description' => [
28         '#markup' => $type->getDescription(),
29       ],
30       'title' => $type->label(),
31       'localized_options' => [
32         'query' => $query,
33       ],
34     ];
35   }
36 }