@@ -109,13 +109,13 @@ |
||
109 | 109 | $markup = ''; |
110 | 110 | $markup .= '<a class="login-dropdown-button standard-icon meta-icon-size left" data-toggle="user-logout-wrapper" aria-controls="user-logout-wrapper" aria-expanded="false">'; |
111 | 111 | $markup .= '<i class="icon ion-ios-person"></i>'; |
112 | - $markup .= '<span> '. $username . '</span>'; |
|
112 | + $markup .= '<span> '.$username.'</span>'; |
|
113 | 113 | $markup .= '</a>'; |
114 | 114 | |
115 | 115 | $markup .= '<div id="user-logout-wrapper" class="dropdown-pane f-dropdown" data-dropdown aria-hidden="true" aria-autoclose="false" data-auto-focus="false">'; |
116 | 116 | $markup .= '<div class="user-links">'; |
117 | - $markup .= '<a class="" href="' . $user_page_url . '"><i class="icon ion-ios-person"></i> ' . $username . '</a>'; |
|
118 | - $markup .= '<a class="logout-button" href="' . $user_logout_url . '"><i class="icon ion-log-out"></i> ' . t('Log Out') . '</a>'; |
|
117 | + $markup .= '<a class="" href="'.$user_page_url.'"><i class="icon ion-ios-person"></i> '.$username.'</a>'; |
|
118 | + $markup .= '<a class="logout-button" href="'.$user_logout_url.'"><i class="icon ion-log-out"></i> '.t('Log Out').'</a>'; |
|
119 | 119 | $markup .= '</div>'; |
120 | 120 | $markup .= '</div>'; |
121 | 121 |
@@ -99,8 +99,7 @@ |
||
99 | 99 | $login_wrapper['form'] = $form; |
100 | 100 | |
101 | 101 | $block['wrapper'] = $login_wrapper; |
102 | - } |
|
103 | - else { |
|
102 | + } else { |
|
104 | 103 | $username = $this->user->getDisplayName(); |
105 | 104 | $user_page_url = Url::fromRoute('user.page')->toString(); |
106 | 105 | $user_logout_url = Url::fromRoute('user.logout')->toString(); |
@@ -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') { |
|
188 | + } else if ($form['plugin_id']['#value'] == 'image_embed') { |
|
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 | } |
@@ -332,8 +329,7 @@ discard block |
||
332 | 329 | if (isset($block_info[$key])) { |
333 | 330 | if (isset($category_map[$category])) { |
334 | 331 | $block_info[$key]['category'] = t($category_map[$category]); |
335 | - } |
|
336 | - else if (is_string($block_info[$key]['category'])) { |
|
332 | + } else if (is_string($block_info[$key]['category'])) { |
|
337 | 333 | $block_info[$key]['category'] = t($block_info[$key]['category']); |
338 | 334 | } |
339 | 335 | } |
@@ -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); |