@@ -287,7 +287,7 @@ |
||
| 287 | 287 | // Move the hero image out of the details element and set a better label. |
| 288 | 288 | $element['field_hero_background']['widget']['#type'] = 'container'; |
| 289 | 289 | $element['field_hero_background']['widget']['entity_browser']['#process'][] = '_df_tools_blocks_hero_browser_button'; |
| 290 | - // Remove the link fieldset and put the URI and title side-by-side. |
|
| 290 | + // Remove the link fieldset and put the URI and title side-by-side. |
|
| 291 | 291 | $element['field_hero_link']['widget'][0]['#type'] = 'container'; |
| 292 | 292 | $element['field_hero_link']['widget'][0]['#attributes']['class'][] = 'row'; |
| 293 | 293 | unset($element['field_hero_link']['widget'][0]['uri']['#description']); |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | $hero_callout_width = $entity->get('field_callout_width')->getString(); |
| 79 | - switch($hero_callout_width) { |
|
| 79 | + switch ($hero_callout_width) { |
|
| 80 | 80 | case '03': |
| 81 | 81 | $hero_callout_width = 'col col-md-5 col-lg-3'; |
| 82 | 82 | break; |
@@ -110,12 +110,12 @@ discard block |
||
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | $wrapper = [ |
| 113 | - '#prefix' => '<div class="container"><div class="row ' . $hero_alignment . '">', |
|
| 113 | + '#prefix' => '<div class="container"><div class="row '.$hero_alignment.'">', |
|
| 114 | 114 | '#suffix' => '</div></div>', |
| 115 | 115 | '#type' => 'container', |
| 116 | 116 | '#weight' => -1, |
| 117 | 117 | '#attributes' => [ |
| 118 | - 'class' => ['hero-block-fields', $hero_callout_width ], |
|
| 118 | + 'class' => ['hero-block-fields', $hero_callout_width], |
|
| 119 | 119 | ], |
| 120 | 120 | '#children' => [], |
| 121 | 121 | ]; |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | $icon = $build[$field_name]['#object']->field_icon->getString(); |
| 125 | 125 | if (!empty($icon)) { |
| 126 | 126 | $wrapper['#children'][$field_name] = [ |
| 127 | - '#markup' => '<i class="fa ' . $icon . ' hero-icon"></i>', |
|
| 127 | + '#markup' => '<i class="fa '.$icon.' hero-icon"></i>', |
|
| 128 | 128 | '#allowed_tags' => ['i'], |
| 129 | 129 | ]; |
| 130 | 130 | } |
@@ -137,15 +137,15 @@ discard block |
||
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | $hero_first_line_size = $entity->get('field_first_line_size')->getString(); |
| 140 | - $wrapper['#children']['field_first_line']['#attributes']['class'][] = 'size-' . $hero_first_line_size; |
|
| 140 | + $wrapper['#children']['field_first_line']['#attributes']['class'][] = 'size-'.$hero_first_line_size; |
|
| 141 | 141 | |
| 142 | 142 | $hero_second_line_size = $entity->get('field_second_line_size')->getString(); |
| 143 | - $wrapper['#children']['field_second_line']['#attributes']['class'][] = 'size-' . $hero_second_line_size; |
|
| 143 | + $wrapper['#children']['field_second_line']['#attributes']['class'][] = 'size-'.$hero_second_line_size; |
|
| 144 | 144 | |
| 145 | 145 | // Attach styles. |
| 146 | 146 | $alignment = $entity->get('field_hero_alignment')->getString(); |
| 147 | 147 | if (preg_match('/^[a-z_]+$/i', $alignment)) { |
| 148 | - $wrapper['#attributes']['class'][] = Html::cleanCssIdentifier('hero-block-align-' . $alignment); |
|
| 148 | + $wrapper['#attributes']['class'][] = Html::cleanCssIdentifier('hero-block-align-'.$alignment); |
|
| 149 | 149 | } |
| 150 | 150 | $color_regex = '/^#[0-9a-f]{6}$/i'; |
| 151 | 151 | $callout_background_color = $entity->get('field_callout_background_color')->getString(); |
@@ -158,8 +158,8 @@ discard block |
||
| 158 | 158 | $wrapper['#attributes']['style'] = $callout_background_color; |
| 159 | 159 | $text_color = $entity->get('field_text_color')->getString(); |
| 160 | 160 | if (preg_match($color_regex, $text_color)) { |
| 161 | - $wrapper['#children']['field_first_line']['#attributes']['style'] = 'color: ' . $text_color; |
|
| 162 | - $wrapper['#children']['field_second_line']['#attributes']['style'] = 'color: ' . $text_color; |
|
| 161 | + $wrapper['#children']['field_first_line']['#attributes']['style'] = 'color: '.$text_color; |
|
| 162 | + $wrapper['#children']['field_second_line']['#attributes']['style'] = 'color: '.$text_color; |
|
| 163 | 163 | } |
| 164 | 164 | $gradient_color = $entity->get('field_gradient_color')->getString(); |
| 165 | 165 | if (preg_match($color_regex, $gradient_color)) { |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | } |
| 181 | 181 | $callout_color = $entity->get('field_callout_color')->getString(); |
| 182 | 182 | if (preg_match($color_regex, $callout_color)) { |
| 183 | - $style = 'background-color: ' . $callout_color . ';'; |
|
| 183 | + $style = 'background-color: '.$callout_color.';'; |
|
| 184 | 184 | $hex = trim($callout_color, '#'); |
| 185 | 185 | $r = hexdec(substr($hex, 0, 2)); |
| 186 | 186 | $g = hexdec(substr($hex, 2, 2)); |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | if (isset($variables['elements']['content']) && isset($variables['elements']['content']['#block_content'])) { |
| 234 | 234 | /** @var \Drupal\block_content\Entity\BlockContent $entity */ |
| 235 | 235 | $entity = $variables['elements']['content']['#block_content']; |
| 236 | - $suggestions[] = 'block__block_content__' . $entity->bundle(); |
|
| 236 | + $suggestions[] = 'block__block_content__'.$entity->bundle(); |
|
| 237 | 237 | } |
| 238 | 238 | } |
| 239 | 239 | |
@@ -542,7 +542,7 @@ discard block |
||
| 542 | 542 | // 'Current @Entity_Type' category. If the block is not a field on the |
| 543 | 543 | // current entity, allow its category to be remapped. |
| 544 | 544 | if ($category === '@entity') { |
| 545 | - $block_info[$key]['category'] = $info['category']->render() . ' Fields'; |
|
| 545 | + $block_info[$key]['category'] = $info['category']->render().' Fields'; |
|
| 546 | 546 | } |
| 547 | 547 | // Place Block Content entities into categories based on their type. |
| 548 | 548 | elseif ($category === 'Custom') { |
@@ -129,8 +129,7 @@ discard block |
||
| 129 | 129 | ]; |
| 130 | 130 | } |
| 131 | 131 | unset($build[$field_name]); |
| 132 | - } |
|
| 133 | - elseif ($field_name !== 'field_hero_background') { |
|
| 132 | + } elseif ($field_name !== 'field_hero_background') { |
|
| 134 | 133 | $wrapper['#children'][$field_name] = $build[$field_name]; |
| 135 | 134 | unset($build[$field_name]); |
| 136 | 135 | } |
@@ -188,8 +187,7 @@ discard block |
||
| 188 | 187 | if ($r + $g + $b > 382) { |
| 189 | 188 | $wrapper['#children']['field_hero_link'][0]['#attributes']['class'][] = 'hero-link-light-bg'; |
| 190 | 189 | $style .= 'border-color:black;color:black;'; |
| 191 | - } |
|
| 192 | - else { |
|
| 190 | + } else { |
|
| 193 | 191 | $wrapper['#children']['field_hero_link'][0]['#attributes']['class'][] = 'hero-link-dark-bg'; |
| 194 | 192 | $style .= 'border-color:white;color:white;'; |
| 195 | 193 | } |
@@ -298,8 +296,7 @@ discard block |
||
| 298 | 296 | $element['field_hero_link']['widget'][0]['uri']['#suffix'] = '</div>'; |
| 299 | 297 | $element['field_hero_link']['widget'][0]['title']['#prefix'] = '<div class="col-6">'; |
| 300 | 298 | $element['field_hero_link']['widget'][0]['title']['#suffix'] = '</div>'; |
| 301 | - } |
|
| 302 | - else { |
|
| 299 | + } else { |
|
| 303 | 300 | $element['field_hero_link']['widget'][0]['uri']['#prefix'] = '<div class="col-12">'; |
| 304 | 301 | $element['field_hero_link']['widget'][0]['uri']['#suffix'] = '</div>'; |
| 305 | 302 | $element['field_hero_link']['widget'][0]['title']['#prefix'] = '<div class="col-12">'; |
@@ -329,8 +326,7 @@ discard block |
||
| 329 | 326 | } |
| 330 | 327 | if (\Drupal::moduleHandler()->moduleExists('layout_builder_modal')) { |
| 331 | 328 | $element[$field]['#attributes']['class'][] = 'col-4'; |
| 332 | - } |
|
| 333 | - else { |
|
| 329 | + } else { |
|
| 334 | 330 | $element[$field]['#attributes']['class'][] = 'col-6'; |
| 335 | 331 | } |
| 336 | 332 | $element['style_fields'][] = $element[$field]; |
@@ -394,8 +390,7 @@ discard block |
||
| 394 | 390 | unset($form['flipper']['front']['settings']['view_mode']['#options'][$view_mode]); |
| 395 | 391 | } |
| 396 | 392 | } |
| 397 | - } |
|
| 398 | - elseif ($form['plugin_id']['#value'] === 'media_embed') { |
|
| 393 | + } elseif ($form['plugin_id']['#value'] === 'media_embed') { |
|
| 399 | 394 | if (empty(Element::getVisibleChildren($form['flipper']['front']['settings']['selection']['table'])) && !$form_state->isProcessingInput()) { |
| 400 | 395 | $form['#attached']['library'][] = 'df_tools_blocks/auto_open'; |
| 401 | 396 | $form['#attributes']['data-df-tools-blocks-auto-open'] = 'settings_selection_mids_entity_browser'; |
@@ -562,16 +557,14 @@ discard block |
||
| 562 | 557 | if (isset($category_map[$category])) { |
| 563 | 558 | // Already translated. |
| 564 | 559 | $block_info[$key]['category'] = $category_map[$category]; |
| 565 | - } |
|
| 566 | - elseif (is_string($block_info[$key]['category'])) { |
|
| 560 | + } elseif (is_string($block_info[$key]['category'])) { |
|
| 567 | 561 | // Already translated. |
| 568 | 562 | $block_info[$key]['category'] = $block_info[$key]['category']; |
| 569 | 563 | } |
| 570 | 564 | if (isset($label_map[$label])) { |
| 571 | 565 | // Already translated. |
| 572 | 566 | $block_info[$key]['label'] = $label_map[$label]; |
| 573 | - } |
|
| 574 | - elseif (is_string($block_info[$key]['label'])) { |
|
| 567 | + } elseif (is_string($block_info[$key]['label'])) { |
|
| 575 | 568 | // Already translated. |
| 576 | 569 | $block_info[$key]['label'] = $block_info[$key]['label']; |
| 577 | 570 | } |