@@ -34,12 +34,10 @@ |
||
| 34 | 34 | } |
| 35 | 35 | } |
| 36 | 36 | return $new_value; |
| 37 | - } |
|
| 38 | - else { |
|
| 37 | + } else { |
|
| 39 | 38 | throw new MigrateException('delimiter is empty'); |
| 40 | 39 | } |
| 41 | - } |
|
| 42 | - else { |
|
| 40 | + } else { |
|
| 43 | 41 | throw new MigrateException(sprintf('%s is not a string', var_export($value, TRUE))); |
| 44 | 42 | } |
| 45 | 43 | } |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | |
| 36 | 36 | // Point source path to local CSV file. |
| 37 | 37 | if ($local_csv === TRUE) { |
| 38 | - $migration['source']['path'] = $path . $prefix . "." . $entity_type . "." . $type . '.csv'; |
|
| 38 | + $migration['source']['path'] = $path.$prefix.".".$entity_type.".".$type.'.csv'; |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | // Set content type to current bundle. |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | |
| 23 | 23 | // Reset the library path to work around a bug with the Libraries module not |
| 24 | 24 | // incorporating the ['path'] when calling libraries_get_path(). |
| 25 | - $libraries['lite']['library path'] = libraries_get_path('lite') . '/' . $libraries['lite']['path']; |
|
| 25 | + $libraries['lite']['library path'] = libraries_get_path('lite').'/'.$libraries['lite']['path']; |
|
| 26 | 26 | |
| 27 | 27 | // Hardcode the version number because the raw source files do not contain |
| 28 | 28 | // any version information. |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | $summary[] = $this->t('Source Field: @source', ['@source' => $this->getSetting('source_field')]); |
| 75 | 75 | $coordinates = $this->getSetting('show_coordinates') ? 'shown' : 'hidden'; |
| 76 | - $summary[] = $this->t('Coordinates are ' . $coordinates); |
|
| 76 | + $summary[] = $this->t('Coordinates are '.$coordinates); |
|
| 77 | 77 | |
| 78 | 78 | return $summary; |
| 79 | 79 | } |
@@ -122,12 +122,12 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | // Check if this field is an Address field. |
| 124 | 124 | if (isset($value['address_line1'])) { |
| 125 | - $address_line2 = !empty($value['address_line2']) ? $value['address_line2'] . "\n" : ''; |
|
| 126 | - $value['value'] = $value['address_line1'] . "\n" . |
|
| 127 | - $address_line2 . |
|
| 128 | - $value['locality'] . ', ' . |
|
| 129 | - str_replace('US-', '', $value['administrative_area']) . ' ' . |
|
| 130 | - $value['postal_code'] . "\n" . |
|
| 125 | + $address_line2 = !empty($value['address_line2']) ? $value['address_line2']."\n" : ''; |
|
| 126 | + $value['value'] = $value['address_line1']."\n". |
|
| 127 | + $address_line2. |
|
| 128 | + $value['locality'].', '. |
|
| 129 | + str_replace('US-', '', $value['administrative_area']).' '. |
|
| 130 | + $value['postal_code']."\n". |
|
| 131 | 131 | $value['country_code']; |
| 132 | 132 | } |
| 133 | 133 | |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | // Set our value in a similar way to Geofield's LatLon Widget. |
| 137 | 137 | // @see \Drupal\geofield\Plugin\Field\FieldWidget\GeofieldLatLonWidget::massageFormValues() |
| 138 | 138 | $coordinates = $collection->first()->getCoordinates(); |
| 139 | - $point = [$coordinates->getLongitude(), $coordinates->getLatitude()]; |
|
| 139 | + $point = [$coordinates->getLongitude(), $coordinates->getLatitude()]; |
|
| 140 | 140 | $values[$delta]['value'] = \Drupal::service('geofield.wkt_generator')->WktBuildPoint($point); |
| 141 | 141 | } |
| 142 | 142 | } |
@@ -90,8 +90,7 @@ |
||
| 90 | 90 | '#placeholder' => t('Latitude: @lat, Longitude: @lon', ['@lat' => $items[$delta]->lat, '@lon' => $items[$delta]->lon]), |
| 91 | 91 | '#suffix' => t('These values are set dynamically on submit from the @field field.', ['@field' => $this->getSetting('source_field')]), |
| 92 | 92 | ]; |
| 93 | - } |
|
| 94 | - else { |
|
| 93 | + } else { |
|
| 95 | 94 | // We set this field dynamically, no need to have more than the minimum. |
| 96 | 95 | $element += [ |
| 97 | 96 | '#type' => 'hidden', |
@@ -8,11 +8,11 @@ |
||
| 8 | 8 | function df_tools_frontend_library_info_alter(&$libraries, $extension) { |
| 9 | 9 | if ($extension == 'image') { |
| 10 | 10 | $path = drupal_get_path('module', 'df_tools_frontend'); |
| 11 | - $libraries['quickedit.inPlaceEditor.image']['js']['/' . $path . '/js/quickedit_image_browser.js'] = []; |
|
| 11 | + $libraries['quickedit.inPlaceEditor.image']['js']['/'.$path.'/js/quickedit_image_browser.js'] = []; |
|
| 12 | 12 | } |
| 13 | 13 | else if ($extension === 'lightning_media') { |
| 14 | 14 | $path = drupal_get_path('module', 'df_tools_frontend'); |
| 15 | - $libraries['browser.styling']['css']['component']['/' . $path . '/css/lightning_media.css'] = []; |
|
| 15 | + $libraries['browser.styling']['css']['component']['/'.$path.'/css/lightning_media.css'] = []; |
|
| 16 | 16 | } |
| 17 | 17 | } |
| 18 | 18 | |
@@ -9,8 +9,7 @@ |
||
| 9 | 9 | if ($extension == 'image') { |
| 10 | 10 | $path = drupal_get_path('module', 'df_tools_frontend'); |
| 11 | 11 | $libraries['quickedit.inPlaceEditor.image']['js']['/' . $path . '/js/quickedit_image_browser.js'] = []; |
| 12 | - } |
|
| 13 | - else if ($extension === 'lightning_media') { |
|
| 12 | + } else if ($extension === 'lightning_media') { |
|
| 14 | 13 | $path = drupal_get_path('module', 'df_tools_frontend'); |
| 15 | 14 | $libraries['browser.styling']['css']['component']['/' . $path . '/css/lightning_media.css'] = []; |
| 16 | 15 | } |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | $form['description'] = [ |
| 29 | - '#markup' => '<p>' . t('Image derivatives can be created in bulk manually to remove the need for Drupal to create them on page load.') . '</p>', |
|
| 29 | + '#markup' => '<p>'.t('Image derivatives can be created in bulk manually to remove the need for Drupal to create them on page load.').'</p>', |
|
| 30 | 30 | ]; |
| 31 | 31 | $form['image_styles'] = [ |
| 32 | 32 | '#type' => 'checkboxes', |
@@ -41,21 +41,21 @@ |
||
| 41 | 41 | |
| 42 | 42 | // Inline the logo image as a data URL. |
| 43 | 43 | $theme = \Drupal::config('system.theme')->get('default'); |
| 44 | - $logo = DRUPAL_ROOT . '/' . theme_get_setting('logo.url', $theme); |
|
| 44 | + $logo = DRUPAL_ROOT.'/'.theme_get_setting('logo.url', $theme); |
|
| 45 | 45 | $mime = \Drupal::service('file.mime_type.guesser')->guess($logo); |
| 46 | 46 | $allowed_mime = ['image/svg+xml', 'image/png', 'image/jpeg', 'image/gif']; |
| 47 | 47 | if (in_array($mime, $allowed_mime, TRUE)) { |
| 48 | 48 | $data = base64_encode(file_get_contents($logo)); |
| 49 | - $logo_url = 'data: ' . $mime . ';base64,' . $data; |
|
| 49 | + $logo_url = 'data: '.$mime.';base64,'.$data; |
|
| 50 | 50 | } |
| 51 | 51 | else { |
| 52 | 52 | $logo_url = FALSE; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | // Use the current theme's template is available. |
| 56 | - $template_file = drupal_get_path('theme', $theme) . '/inky_templates/compiled/styled_email.html.twig'; |
|
| 56 | + $template_file = drupal_get_path('theme', $theme).'/inky_templates/compiled/styled_email.html.twig'; |
|
| 57 | 57 | if (file_exists($template_file)) { |
| 58 | - $template = str_replace(["'{{","}}'"], ['{{','}}'], file_get_contents($template_file)); |
|
| 58 | + $template = str_replace(["'{{", "}}'"], ['{{', '}}'], file_get_contents($template_file)); |
|
| 59 | 59 | } |
| 60 | 60 | else { |
| 61 | 61 | $template = '{{ message }}'; |
@@ -47,8 +47,7 @@ discard block |
||
| 47 | 47 | if (in_array($mime, $allowed_mime, TRUE)) { |
| 48 | 48 | $data = base64_encode(file_get_contents($logo)); |
| 49 | 49 | $logo_url = 'data: ' . $mime . ';base64,' . $data; |
| 50 | - } |
|
| 51 | - else { |
|
| 50 | + } else { |
|
| 52 | 51 | $logo_url = FALSE; |
| 53 | 52 | } |
| 54 | 53 | |
@@ -56,8 +55,7 @@ discard block |
||
| 56 | 55 | $template_file = drupal_get_path('theme', $theme) . '/inky_templates/compiled/styled_email.html.twig'; |
| 57 | 56 | if (file_exists($template_file)) { |
| 58 | 57 | $template = str_replace(["'{{","}}'"], ['{{','}}'], file_get_contents($template_file)); |
| 59 | - } |
|
| 60 | - else { |
|
| 58 | + } else { |
|
| 61 | 59 | $template = '{{ message }}'; |
| 62 | 60 | } |
| 63 | 61 | |
@@ -104,7 +104,7 @@ |
||
| 104 | 104 | 'format' => $format, |
| 105 | 105 | ]; |
| 106 | 106 | // Set a unique key for this mail. |
| 107 | - $key = 'rules_action_mail_' . $this->getPluginId(); |
|
| 107 | + $key = 'rules_action_mail_'.$this->getPluginId(); |
|
| 108 | 108 | $message = $this->mailManager->mail('df_tools_message', $key, $to, LanguageInterface::LANGCODE_NOT_SPECIFIED, $params); |
| 109 | 109 | if ($message['result']) { |
| 110 | 110 | $this->logger->notice('Successfully sent styled email to %recipient', ['%recipient' => $to]); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | '#attributes' => [ |
| 36 | 36 | 'id' => $this->getFieldId($items, $delta), |
| 37 | 37 | ], |
| 38 | - '#prefix' => '<h3 class="df-tools-tabs-accordion-title">' . Xss::filter($item->tab_title) . '</h3>', |
|
| 38 | + '#prefix' => '<h3 class="df-tools-tabs-accordion-title">'.Xss::filter($item->tab_title).'</h3>', |
|
| 39 | 39 | ]; |
| 40 | 40 | $elements[$delta][] = [ |
| 41 | 41 | '#type' => 'processed_text', |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | ]; |
| 65 | 65 | |
| 66 | 66 | foreach ($items as $delta => $item) { |
| 67 | - $url = Url::fromUri('internal:#' . $this->getFieldId($items, $delta))->toRenderArray(); |
|
| 67 | + $url = Url::fromUri('internal:#'.$this->getFieldId($items, $delta))->toRenderArray(); |
|
| 68 | 68 | $tabs['#items'][] = [ |
| 69 | 69 | '#type' => 'link', |
| 70 | 70 | '#title' => $item->tab_title, |