@@ -18,12 +18,12 @@ |
||
| 18 | 18 | $first_name = $strings[0]; |
| 19 | 19 | $last_name = $strings[1]; |
| 20 | 20 | $password = \Drupal::service('password')->hash('password'); |
| 21 | - $row->setSourceProperty('Name', $first_name . $last_name); |
|
| 21 | + $row->setSourceProperty('Name', $first_name.$last_name); |
|
| 22 | 22 | $row->setSourceProperty('First', $first_name); |
| 23 | 23 | $row->setSourceProperty('Last', $last_name); |
| 24 | 24 | $row->setSourceProperty('Pass', $password); |
| 25 | 25 | $row->setSourceProperty('Status', 1); |
| 26 | - $row->setSourceProperty('Mail', $first_name . $last_name . '@example.com'); |
|
| 26 | + $row->setSourceProperty('Mail', $first_name.$last_name.'@example.com'); |
|
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | 29 | } |
@@ -16,11 +16,11 @@ |
||
| 16 | 16 | |
| 17 | 17 | public function prepareRow(Row $row) { |
| 18 | 18 | if ($image = $row->getSourceProperty('Picture')) { |
| 19 | - $base_path = dirname($this->configuration['path']) . '/images/'; |
|
| 19 | + $base_path = dirname($this->configuration['path']).'/images/'; |
|
| 20 | 20 | |
| 21 | 21 | // Setup our source/destination paths. |
| 22 | - $path = $base_path . $image; |
|
| 23 | - $destination_path = 'public://' . $image; |
|
| 22 | + $path = $base_path.$image; |
|
| 23 | + $destination_path = 'public://'.$image; |
|
| 24 | 24 | |
| 25 | 25 | // Copy the file. |
| 26 | 26 | file_unmanaged_copy($path, $destination_path, FILE_EXISTS_REPLACE); |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | $icon = $build[$field_name]['#object']->field_icon->getString(); |
| 30 | 30 | if (!empty($icon)) { |
| 31 | 31 | $wrapper['#children'][$field_name] = [ |
| 32 | - '#markup' => '<i class="fa ' . $icon . ' hero-icon"></i>', |
|
| 32 | + '#markup' => '<i class="fa '.$icon.' hero-icon"></i>', |
|
| 33 | 33 | '#allowed_tags' => ['i'], |
| 34 | 34 | ]; |
| 35 | 35 | } |
@@ -43,13 +43,13 @@ discard block |
||
| 43 | 43 | // Attach styles. |
| 44 | 44 | $alignment = $entity->get('field_hero_alignment')->getString(); |
| 45 | 45 | if (preg_match('/^[a-z_]+$/i', $alignment)) { |
| 46 | - $wrapper['#attributes']['class'][] = Html::cleanCssIdentifier('hero-block-align-' . $alignment); |
|
| 46 | + $wrapper['#attributes']['class'][] = Html::cleanCssIdentifier('hero-block-align-'.$alignment); |
|
| 47 | 47 | } |
| 48 | 48 | $color_regex = '/^#[0-9a-f]{6}$/i'; |
| 49 | 49 | $text_color = $entity->get('field_text_color')->getString(); |
| 50 | 50 | if (preg_match($color_regex, $text_color)) { |
| 51 | - $wrapper['#children']['field_first_line']['#attributes']['style'] = 'color: ' . $text_color; |
|
| 52 | - $wrapper['#children']['field_second_line']['#attributes']['style'] = 'color: ' . $text_color; |
|
| 51 | + $wrapper['#children']['field_first_line']['#attributes']['style'] = 'color: '.$text_color; |
|
| 52 | + $wrapper['#children']['field_second_line']['#attributes']['style'] = 'color: '.$text_color; |
|
| 53 | 53 | } |
| 54 | 54 | $gradient_color = $entity->get('field_gradient_color')->getString(); |
| 55 | 55 | if (preg_match($color_regex, $gradient_color)) { |
@@ -68,11 +68,11 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | $callout_color = $entity->get('field_callout_color')->getString(); |
| 70 | 70 | if (preg_match($color_regex, $callout_color)) { |
| 71 | - $style = 'background-color: ' . $callout_color . ';'; |
|
| 71 | + $style = 'background-color: '.$callout_color.';'; |
|
| 72 | 72 | $hex = trim($callout_color, '#'); |
| 73 | - $r = hexdec(substr($hex,0,2)); |
|
| 74 | - $g = hexdec(substr($hex,2,2)); |
|
| 75 | - $b = hexdec(substr($hex,4,2)); |
|
| 73 | + $r = hexdec(substr($hex, 0, 2)); |
|
| 74 | + $g = hexdec(substr($hex, 2, 2)); |
|
| 75 | + $b = hexdec(substr($hex, 4, 2)); |
|
| 76 | 76 | if ($r + $g + $b > 382) { |
| 77 | 77 | $wrapper['#children']['field_hero_link'][0]['#attributes']['class'][] = 'hero-link-light-bg'; |
| 78 | 78 | $style .= 'border-color:black;color:black;'; |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | if (isset($variables['elements']['content']) && isset($variables['elements']['content']['#block_content'])) { |
| 99 | 99 | /** @var \Drupal\block_content\Entity\BlockContent $entity */ |
| 100 | 100 | $entity = $variables['elements']['content']['#block_content']; |
| 101 | - $suggestions[] = 'block__block_content__' . $entity->bundle(); |
|
| 101 | + $suggestions[] = 'block__block_content__'.$entity->bundle(); |
|
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | // Set up the correct pa$th for the CSV files in this module. |
| 271 | 271 | $types = ['hero', 'media']; |
| 272 | 272 | foreach ($types as $type) { |
| 273 | - $id = 'import_block_' . $type; |
|
| 273 | + $id = 'import_block_'.$type; |
|
| 274 | 274 | $definitions[$id]['source']['path'] = str_replace('..', dirname(__FILE__), $definitions[$id]['source']['path']); |
| 275 | 275 | } |
| 276 | 276 | } |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | // 'Current @Entity_Type' category. If the block is not a field on the |
| 315 | 315 | // current entity, allow its category to be remapped. |
| 316 | 316 | if ($category == '@entity') { |
| 317 | - $block_info[$key]['category'] = $info['category']->render() . ' Fields'; |
|
| 317 | + $block_info[$key]['category'] = $info['category']->render().' Fields'; |
|
| 318 | 318 | } |
| 319 | 319 | // Place Block Content entities into categories based on their type. |
| 320 | 320 | else if ($category == 'Custom') { |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | if ($entity = $entity_type_manager->getStorage($entity_type)->load($id)) { |
| 359 | 359 | foreach ($block_info as $key => $info) { |
| 360 | 360 | if ($info['id'] === 'entity_field') { |
| 361 | - list($block_id,$block_entity_type,$field_name) = explode(':', $info['plugin_id']); |
|
| 361 | + list($block_id, $block_entity_type, $field_name) = explode(':', $info['plugin_id']); |
|
| 362 | 362 | if ($block_entity_type !== $entity_type || ($entity instanceof FieldableEntityInterface && !$entity->hasField($field_name))) { |
| 363 | 363 | unset($block_info[$key]); |
| 364 | 364 | } |
@@ -34,8 +34,7 @@ discard block |
||
| 34 | 34 | ]; |
| 35 | 35 | } |
| 36 | 36 | unset($build[$field_name]); |
| 37 | - } |
|
| 38 | - else if ($field_name != 'field_hero_image') { |
|
| 37 | + } else if ($field_name != 'field_hero_image') { |
|
| 39 | 38 | $wrapper['#children'][$field_name] = $build[$field_name]; |
| 40 | 39 | unset($build[$field_name]); |
| 41 | 40 | } |
@@ -76,8 +75,7 @@ discard block |
||
| 76 | 75 | if ($r + $g + $b > 382) { |
| 77 | 76 | $wrapper['#children']['field_hero_link'][0]['#attributes']['class'][] = 'hero-link-light-bg'; |
| 78 | 77 | $style .= 'border-color:black;color:black;'; |
| 79 | - } |
|
| 80 | - else { |
|
| 78 | + } else { |
|
| 81 | 79 | $wrapper['#children']['field_hero_link'][0]['#attributes']['class'][] = 'hero-link-dark-bg'; |
| 82 | 80 | $style .= 'border-color:white;color:white;'; |
| 83 | 81 | } |
@@ -187,8 +185,7 @@ discard block |
||
| 187 | 185 | } |
| 188 | 186 | } |
| 189 | 187 | |
| 190 | - } |
|
| 191 | - else if ($form['plugin_id']['#value'] == 'image_embed' && !$form_state->isProcessingInput()) { |
|
| 188 | + } else if ($form['plugin_id']['#value'] == 'image_embed' && !$form_state->isProcessingInput()) { |
|
| 192 | 189 | $form['#attached']['library'][] = 'df_tools_blocks/auto_open'; |
| 193 | 190 | $form['#attributes']['data-df-tools-blocks-auto-open'] = 'settings_selection_fids_entity_browser'; |
| 194 | 191 | } |
@@ -340,14 +337,12 @@ discard block |
||
| 340 | 337 | if (isset($block_info[$key])) { |
| 341 | 338 | if (isset($category_map[$category])) { |
| 342 | 339 | $block_info[$key]['category'] = t($category_map[$category]); |
| 343 | - } |
|
| 344 | - else if (is_string($block_info[$key]['category'])) { |
|
| 340 | + } else if (is_string($block_info[$key]['category'])) { |
|
| 345 | 341 | $block_info[$key]['category'] = t($block_info[$key]['category']); |
| 346 | 342 | } |
| 347 | 343 | if (isset($label_map[$label])) { |
| 348 | 344 | $block_info[$key]['label'] = $label_map[$label]; |
| 349 | - } |
|
| 350 | - else if (is_string($block_info[$key]['label'])) { |
|
| 345 | + } else if (is_string($block_info[$key]['label'])) { |
|
| 351 | 346 | $block_info[$key]['label'] = t($block_info[$key]['label']); |
| 352 | 347 | } |
| 353 | 348 | } |
@@ -29,8 +29,7 @@ |
||
| 29 | 29 | // Copy and return the entity. |
| 30 | 30 | if ($copy = $this->replicator->replicateEntity($entity)) { |
| 31 | 31 | return $copy; |
| 32 | - } |
|
| 33 | - else { |
|
| 32 | + } else { |
|
| 34 | 33 | return false; |
| 35 | 34 | } |
| 36 | 35 | } |
@@ -23,13 +23,13 @@ |
||
| 23 | 23 | $anchor_id = Html::getUniqueId('df-tools-anchor'); |
| 24 | 24 | $build = [ |
| 25 | 25 | '#markup' => |
| 26 | - '<div id="' . $anchor_id . '"></div>' . |
|
| 27 | - '<div data-sticky-container class="df-tools-magellan-block hide-for-small-only full-width-row">' . |
|
| 28 | - ' <div class="sticky" data-sticky data-top-anchor="' . $anchor_id . '" data-margin-top="0">' . |
|
| 29 | - ' <nav data-magellan data-active-class="active">' . |
|
| 30 | - ' <ul class="horizontal menu expanded"></ul>' . |
|
| 31 | - ' </nav>' . |
|
| 32 | - ' </div>' . |
|
| 26 | + '<div id="'.$anchor_id.'"></div>'. |
|
| 27 | + '<div data-sticky-container class="df-tools-magellan-block hide-for-small-only full-width-row">'. |
|
| 28 | + ' <div class="sticky" data-sticky data-top-anchor="'.$anchor_id.'" data-margin-top="0">'. |
|
| 29 | + ' <nav data-magellan data-active-class="active">'. |
|
| 30 | + ' <ul class="horizontal menu expanded"></ul>'. |
|
| 31 | + ' </nav>'. |
|
| 32 | + ' </div>'. |
|
| 33 | 33 | '</div>' |
| 34 | 34 | ]; |
| 35 | 35 | |
@@ -20,19 +20,19 @@ |
||
| 20 | 20 | 'render element' => 'content', |
| 21 | 21 | 'base hook' => 'node', |
| 22 | 22 | 'template' => 'node--cta', |
| 23 | - 'path' => drupal_get_path('module', 'df_tools_cta') . '/templates', |
|
| 23 | + 'path' => drupal_get_path('module', 'df_tools_cta').'/templates', |
|
| 24 | 24 | ); |
| 25 | 25 | $theme['node__cta__callout'] = array( |
| 26 | 26 | 'render element' => 'content', |
| 27 | 27 | 'base hook' => 'node', |
| 28 | 28 | 'template' => 'node--cta--callout', |
| 29 | - 'path' => drupal_get_path('module', 'df_tools_cta') . '/templates', |
|
| 29 | + 'path' => drupal_get_path('module', 'df_tools_cta').'/templates', |
|
| 30 | 30 | ); |
| 31 | 31 | $theme['node__cta__notification'] = array( |
| 32 | 32 | 'render element' => 'content', |
| 33 | 33 | 'base hook' => 'node', |
| 34 | 34 | 'template' => 'node--cta--notification', |
| 35 | - 'path' => drupal_get_path('module', 'df_tools_cta') . '/templates', |
|
| 35 | + 'path' => drupal_get_path('module', 'df_tools_cta').'/templates', |
|
| 36 | 36 | ); |
| 37 | 37 | return $theme; |
| 38 | 38 | } |
@@ -11,14 +11,14 @@ |
||
| 11 | 11 | function df_tools_gallery_library_info_alter(&$libraries, $extension) { |
| 12 | 12 | // Optionally use the Libraries module to determine our library paths. |
| 13 | 13 | if ($extension == 'df_tools_gallery' && \Drupal::moduleHandler()->moduleExists('libraries')) { |
| 14 | - $imagesloaded_path = libraries_get_path('imagesloaded') . '/imagesloaded.pkgd.min.js'; |
|
| 15 | - $masonry_path = libraries_get_path('masonry') . '/dist/masonry.pkgd.min.js'; |
|
| 14 | + $imagesloaded_path = libraries_get_path('imagesloaded').'/imagesloaded.pkgd.min.js'; |
|
| 15 | + $masonry_path = libraries_get_path('masonry').'/dist/masonry.pkgd.min.js'; |
|
| 16 | 16 | $lightbox2_path = libraries_get_path('lightbox2'); |
| 17 | 17 | |
| 18 | - $libraries['lightbox2']['css']['theme'] = ['/' . $lightbox2_path . '/dist/css/lightbox.min.css' => []]; |
|
| 19 | - $libraries['lightbox2']['js'] = ['/' . $lightbox2_path . '/dist/js/lightbox.min.js' => ['minified' => 'true']]; |
|
| 20 | - $libraries['imagesloaded']['js'] = ['/' . $imagesloaded_path => ['minified' => 'true']]; |
|
| 21 | - $libraries['masonry']['js'] = ['/' . $masonry_path => ['minified' => 'true']]; |
|
| 18 | + $libraries['lightbox2']['css']['theme'] = ['/'.$lightbox2_path.'/dist/css/lightbox.min.css' => []]; |
|
| 19 | + $libraries['lightbox2']['js'] = ['/'.$lightbox2_path.'/dist/js/lightbox.min.js' => ['minified' => 'true']]; |
|
| 20 | + $libraries['imagesloaded']['js'] = ['/'.$imagesloaded_path => ['minified' => 'true']]; |
|
| 21 | + $libraries['masonry']['js'] = ['/'.$masonry_path => ['minified' => 'true']]; |
|
| 22 | 22 | } |
| 23 | 23 | } |
| 24 | 24 | |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | $image_names = explode(',', $images); |
| 20 | 20 | $files = []; |
| 21 | 21 | foreach ($image_names as $image_name) { |
| 22 | - $path = dirname($this->configuration['path']) . '/images/' . $image_name; |
|
| 22 | + $path = dirname($this->configuration['path']).'/images/'.$image_name; |
|
| 23 | 23 | $data = file_get_contents($path); |
| 24 | 24 | $uri = file_build_uri($image_name); |
| 25 | 25 | $files[] = file_save_data($data, $uri); |
@@ -20,8 +20,8 @@ |
||
| 20 | 20 | ->getStorage('file')->loadByProperties(['filename' => $image]); |
| 21 | 21 | |
| 22 | 22 | if (empty($files)) { |
| 23 | - $base_path = dirname($this->configuration['path']) . '/images/'; |
|
| 24 | - $path = $base_path . $image; |
|
| 23 | + $base_path = dirname($this->configuration['path']).'/images/'; |
|
| 24 | + $path = $base_path.$image; |
|
| 25 | 25 | $data = file_get_contents($path); |
| 26 | 26 | $uri = file_build_uri($image); |
| 27 | 27 | $file = file_save_data($data, $uri); |
@@ -25,8 +25,7 @@ |
||
| 25 | 25 | $data = file_get_contents($path); |
| 26 | 26 | $uri = file_build_uri($image); |
| 27 | 27 | $file = file_save_data($data, $uri); |
| 28 | - } |
|
| 29 | - else { |
|
| 28 | + } else { |
|
| 30 | 29 | $file = reset($files); |
| 31 | 30 | } |
| 32 | 31 | |