|
@@ -53,12 +53,12 @@ discard block |
|
|
block discarded – undo |
|
53
|
53
|
$hero_callout_width = $entity->get('field_callout_width')->getString(); |
|
54
|
54
|
|
|
55
|
55
|
$wrapper = [ |
|
56
|
|
- '#prefix' => '<div class="content"><div class="fields-container ' . $hero_alignment . '">', |
|
|
56
|
+ '#prefix' => '<div class="content"><div class="fields-container '.$hero_alignment.'">', |
|
57
|
57
|
'#suffix' => '</div></div>', |
|
58
|
58
|
'#type' => 'container', |
|
59
|
59
|
'#weight' => -1, |
|
60
|
60
|
'#attributes' => [ |
|
61
|
|
- 'class' => ['fields', 'col-' . $hero_callout_width, $text_alignment ], |
|
|
61
|
+ 'class' => ['fields', 'col-'.$hero_callout_width, $text_alignment], |
|
62
|
62
|
], |
|
63
|
63
|
'#children' => [], |
|
64
|
64
|
]; |
|
@@ -67,7 +67,7 @@ discard block |
|
|
block discarded – undo |
|
67
|
67
|
$icon = $build[$field_name]['#object']->field_icon->getString(); |
|
68
|
68
|
if (!empty($icon)) { |
|
69
|
69
|
$wrapper['#children'][$field_name] = [ |
|
70
|
|
- '#markup' => '<i class="fa ' . $icon . ' hero-icon"></i>', |
|
|
70
|
+ '#markup' => '<i class="fa '.$icon.' hero-icon"></i>', |
|
71
|
71
|
'#allowed_tags' => ['i'], |
|
72
|
72
|
]; |
|
73
|
73
|
} |
|
@@ -80,15 +80,15 @@ discard block |
|
|
block discarded – undo |
|
80
|
80
|
} |
|
81
|
81
|
|
|
82
|
82
|
$hero_first_line_size = $entity->get('field_first_line_size')->getString(); |
|
83
|
|
- $wrapper['#children']['field_first_line']['#attributes']['class'][] = 'size-' . $hero_first_line_size; |
|
|
83
|
+ $wrapper['#children']['field_first_line']['#attributes']['class'][] = 'size-'.$hero_first_line_size; |
|
84
|
84
|
|
|
85
|
85
|
$hero_second_line_size = $entity->get('field_second_line_size')->getString(); |
|
86
|
|
- $wrapper['#children']['field_second_line']['#attributes']['class'][] = 'size-' . $hero_second_line_size; |
|
|
86
|
+ $wrapper['#children']['field_second_line']['#attributes']['class'][] = 'size-'.$hero_second_line_size; |
|
87
|
87
|
|
|
88
|
88
|
// Attach styles. |
|
89
|
89
|
$alignment = $entity->get('field_hero_alignment')->getString(); |
|
90
|
90
|
if (preg_match('/^[a-z_]+$/i', $alignment)) { |
|
91
|
|
- $wrapper['#attributes']['class'][] = Html::cleanCssIdentifier('text-align-' . $text_alignment); |
|
|
91
|
+ $wrapper['#attributes']['class'][] = Html::cleanCssIdentifier('text-align-'.$text_alignment); |
|
92
|
92
|
} |
|
93
|
93
|
$color_regex = '/^#[0-9a-f]{6}$/i'; |
|
94
|
94
|
$callout_background_color = $entity->get('field_callout_background_color')->getString(); |
|
@@ -101,8 +101,8 @@ discard block |
|
|
block discarded – undo |
|
101
|
101
|
$wrapper['#attributes']['style'] = $callout_background_color; |
|
102
|
102
|
$text_color = $entity->get('field_text_color')->getString(); |
|
103
|
103
|
if (preg_match($color_regex, $text_color)) { |
|
104
|
|
- $wrapper['#children']['field_first_line']['#attributes']['style'] = 'color: ' . $text_color; |
|
105
|
|
- $wrapper['#children']['field_second_line']['#attributes']['style'] = 'color: ' . $text_color; |
|
|
104
|
+ $wrapper['#children']['field_first_line']['#attributes']['style'] = 'color: '.$text_color; |
|
|
105
|
+ $wrapper['#children']['field_second_line']['#attributes']['style'] = 'color: '.$text_color; |
|
106
|
106
|
} |
|
107
|
107
|
if ($entity->get('field_gradient')->getString()) { |
|
108
|
108
|
$gradient_color = $entity->get('field_gradient_color')->getString(); |
|
@@ -125,7 +125,7 @@ discard block |
|
|
block discarded – undo |
|
125
|
125
|
} |
|
126
|
126
|
$callout_color = $entity->get('field_callout_color')->getString(); |
|
127
|
127
|
if (preg_match($color_regex, $callout_color)) { |
|
128
|
|
- $style = 'background-color: ' . $callout_color . ';'; |
|
|
128
|
+ $style = 'background-color: '.$callout_color.';'; |
|
129
|
129
|
$hex = trim($callout_color, '#'); |
|
130
|
130
|
$r = hexdec(substr($hex, 0, 2)); |
|
131
|
131
|
$g = hexdec(substr($hex, 2, 2)); |
|
@@ -178,7 +178,7 @@ discard block |
|
|
block discarded – undo |
|
178
|
178
|
if (isset($variables['elements']['content']) && isset($variables['elements']['content']['#block_content'])) { |
|
179
|
179
|
/** @var \Drupal\block_content\Entity\BlockContent $entity */ |
|
180
|
180
|
$entity = $variables['elements']['content']['#block_content']; |
|
181
|
|
- $suggestions[] = 'block__block_content__' . $entity->bundle(); |
|
|
181
|
+ $suggestions[] = 'block__block_content__'.$entity->bundle(); |
|
182
|
182
|
} |
|
183
|
183
|
} |
|
184
|
184
|
|
|
@@ -465,7 +465,7 @@ discard block |
|
|
block discarded – undo |
|
465
|
465
|
// 'Current @Entity_Type' category. If the block is not a field on the |
|
466
|
466
|
// current entity, allow its category to be remapped. |
|
467
|
467
|
if ($category === '@entity') { |
|
468
|
|
- $block_info[$key]['category'] = $info['category']->render() . ' Fields'; |
|
|
468
|
+ $block_info[$key]['category'] = $info['category']->render().' Fields'; |
|
469
|
469
|
} |
|
470
|
470
|
// Place Block Content entities into categories based on their type. |
|
471
|
471
|
elseif ($category === 'Custom') { |