|
@@ -62,7 +62,7 @@ discard block |
|
|
block discarded – undo |
|
62
|
62
|
} |
|
63
|
63
|
|
|
64
|
64
|
$hero_callout_width = $entity->get('field_callout_width')->getString(); |
|
65
|
|
- switch($hero_callout_width) { |
|
|
65
|
+ switch ($hero_callout_width) { |
|
66
|
66
|
case '03': |
|
67
|
67
|
$hero_callout_width = 'col col-md-5 col-lg-3'; |
|
68
|
68
|
break; |
|
@@ -96,12 +96,12 @@ discard block |
|
|
block discarded – undo |
|
96
|
96
|
} |
|
97
|
97
|
|
|
98
|
98
|
$wrapper = [ |
|
99
|
|
- '#prefix' => '<div class="container"><div class="col-12"><div class="row ' . $hero_alignment . '">', |
|
|
99
|
+ '#prefix' => '<div class="container"><div class="col-12"><div class="row '.$hero_alignment.'">', |
|
100
|
100
|
'#suffix' => '</div></div></div>', |
|
101
|
101
|
'#type' => 'container', |
|
102
|
102
|
'#weight' => -1, |
|
103
|
103
|
'#attributes' => [ |
|
104
|
|
- 'class' => ['hero-block-fields', $hero_callout_width ], |
|
|
104
|
+ 'class' => ['hero-block-fields', $hero_callout_width], |
|
105
|
105
|
], |
|
106
|
106
|
'#children' => [], |
|
107
|
107
|
]; |
|
@@ -110,7 +110,7 @@ discard block |
|
|
block discarded – undo |
|
110
|
110
|
$icon = $build[$field_name]['#object']->field_icon->getString(); |
|
111
|
111
|
if (!empty($icon)) { |
|
112
|
112
|
$wrapper['#children'][$field_name] = [ |
|
113
|
|
- '#markup' => '<i class="fa ' . $icon . ' hero-icon"></i>', |
|
|
113
|
+ '#markup' => '<i class="fa '.$icon.' hero-icon"></i>', |
|
114
|
114
|
'#allowed_tags' => ['i'], |
|
115
|
115
|
]; |
|
116
|
116
|
} |
|
@@ -123,15 +123,15 @@ discard block |
|
|
block discarded – undo |
|
123
|
123
|
} |
|
124
|
124
|
|
|
125
|
125
|
$hero_first_line_size = $entity->get('field_first_line_size')->getString(); |
|
126
|
|
- $wrapper['#children']['field_first_line']['#attributes']['class'][] = 'size-' . $hero_first_line_size; |
|
|
126
|
+ $wrapper['#children']['field_first_line']['#attributes']['class'][] = 'size-'.$hero_first_line_size; |
|
127
|
127
|
|
|
128
|
128
|
$hero_second_line_size = $entity->get('field_second_line_size')->getString(); |
|
129
|
|
- $wrapper['#children']['field_second_line']['#attributes']['class'][] = 'size-' . $hero_second_line_size; |
|
|
129
|
+ $wrapper['#children']['field_second_line']['#attributes']['class'][] = 'size-'.$hero_second_line_size; |
|
130
|
130
|
|
|
131
|
131
|
// Attach styles. |
|
132
|
132
|
$alignment = $entity->get('field_hero_alignment')->getString(); |
|
133
|
133
|
if (preg_match('/^[a-z_]+$/i', $alignment)) { |
|
134
|
|
- $wrapper['#attributes']['class'][] = Html::cleanCssIdentifier('hero-block-align-' . $alignment); |
|
|
134
|
+ $wrapper['#attributes']['class'][] = Html::cleanCssIdentifier('hero-block-align-'.$alignment); |
|
135
|
135
|
} |
|
136
|
136
|
$color_regex = '/^#[0-9a-f]{6}$/i'; |
|
137
|
137
|
$callout_background_color = $entity->get('field_callout_background_color')->getString(); |
|
@@ -144,8 +144,8 @@ discard block |
|
|
block discarded – undo |
|
144
|
144
|
$wrapper['#attributes']['style'] = $callout_background_color; |
|
145
|
145
|
$text_color = $entity->get('field_text_color')->getString(); |
|
146
|
146
|
if (preg_match($color_regex, $text_color)) { |
|
147
|
|
- $wrapper['#children']['field_first_line']['#attributes']['style'] = 'color: ' . $text_color; |
|
148
|
|
- $wrapper['#children']['field_second_line']['#attributes']['style'] = 'color: ' . $text_color; |
|
|
147
|
+ $wrapper['#children']['field_first_line']['#attributes']['style'] = 'color: '.$text_color; |
|
|
148
|
+ $wrapper['#children']['field_second_line']['#attributes']['style'] = 'color: '.$text_color; |
|
149
|
149
|
} |
|
150
|
150
|
if ($entity->get('field_gradient')->getString()) { |
|
151
|
151
|
$gradient_color = $entity->get('field_gradient_color')->getString(); |
|
@@ -168,7 +168,7 @@ discard block |
|
|
block discarded – undo |
|
168
|
168
|
} |
|
169
|
169
|
$callout_color = $entity->get('field_callout_color')->getString(); |
|
170
|
170
|
if (preg_match($color_regex, $callout_color)) { |
|
171
|
|
- $style = 'background-color: ' . $callout_color . ';'; |
|
|
171
|
+ $style = 'background-color: '.$callout_color.';'; |
|
172
|
172
|
$hex = trim($callout_color, '#'); |
|
173
|
173
|
$r = hexdec(substr($hex, 0, 2)); |
|
174
|
174
|
$g = hexdec(substr($hex, 2, 2)); |
|
@@ -221,7 +221,7 @@ discard block |
|
|
block discarded – undo |
|
221
|
221
|
if (isset($variables['elements']['content']) && isset($variables['elements']['content']['#block_content'])) { |
|
222
|
222
|
/** @var \Drupal\block_content\Entity\BlockContent $entity */ |
|
223
|
223
|
$entity = $variables['elements']['content']['#block_content']; |
|
224
|
|
- $suggestions[] = 'block__block_content__' . $entity->bundle(); |
|
|
224
|
+ $suggestions[] = 'block__block_content__'.$entity->bundle(); |
|
225
|
225
|
} |
|
226
|
226
|
} |
|
227
|
227
|
|
|
@@ -517,7 +517,7 @@ discard block |
|
|
block discarded – undo |
|
517
|
517
|
// 'Current @Entity_Type' category. If the block is not a field on the |
|
518
|
518
|
// current entity, allow its category to be remapped. |
|
519
|
519
|
if ($category === '@entity') { |
|
520
|
|
- $block_info[$key]['category'] = $info['category']->render() . ' Fields'; |
|
|
520
|
+ $block_info[$key]['category'] = $info['category']->render().' Fields'; |
|
521
|
521
|
} |
|
522
|
522
|
// Place Block Content entities into categories based on their type. |
|
523
|
523
|
elseif ($category === 'Custom') { |