@@ -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 | } |
@@ -117,12 +117,12 @@ discard block |
||
| 117 | 117 | foreach ($field_value as $delta => $value) { |
| 118 | 118 | // Check if this field is an Address field. |
| 119 | 119 | if (isset($value['address_line1'])) { |
| 120 | - $address_line2 = !empty($value['address_line2']) ? $value['address_line2'] . "\n" : ''; |
|
| 121 | - $value['value'] = $value['address_line1'] . "\n" . |
|
| 122 | - $address_line2 . |
|
| 123 | - $value['locality'] . ', ' . |
|
| 124 | - str_replace('US-', '', $value['administrative_area']) . ' ' . |
|
| 125 | - $value['postal_code'] . "\n" . |
|
| 120 | + $address_line2 = !empty($value['address_line2']) ? $value['address_line2']."\n" : ''; |
|
| 121 | + $value['value'] = $value['address_line1']."\n". |
|
| 122 | + $address_line2. |
|
| 123 | + $value['locality'].', '. |
|
| 124 | + str_replace('US-', '', $value['administrative_area']).' '. |
|
| 125 | + $value['postal_code']."\n". |
|
| 126 | 126 | $value['country_code']; |
| 127 | 127 | } |
| 128 | 128 | |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | // Set our value in a similar way to Geofield's LatLon Widget. |
| 132 | 132 | // @see \Drupal\geofield\Plugin\Field\FieldWidget\GeofieldLatLonWidget::massageFormValues() |
| 133 | 133 | $coordinates = $collection->first()->getCoordinates(); |
| 134 | - $point = [$coordinates->getLongitude(), $coordinates->getLatitude()]; |
|
| 134 | + $point = [$coordinates->getLongitude(), $coordinates->getLatitude()]; |
|
| 135 | 135 | $values[$delta]['value'] = \Drupal::service('geofield.wkt_generator')->WktBuildPoint($point); |
| 136 | 136 | } |
| 137 | 137 | } |
@@ -32,8 +32,7 @@ |
||
| 32 | 32 | // Create a MigrateSource object. |
| 33 | 33 | if (isset($arguments['path'])) { |
| 34 | 34 | $import_path = $arguments['path']; |
| 35 | - } |
|
| 36 | - else { |
|
| 35 | + } else { |
|
| 37 | 36 | $import_path = drupal_get_path('module', 'df_tools_commerce_product') . '/import/df_tools_commerce.fpp.commerce_product.csv'; |
| 38 | 37 | } |
| 39 | 38 | $this->source = new MigrateSourceCSV($import_path, array(), array('header_rows' => 1)); |
@@ -56,9 +56,9 @@ discard block |
||
| 56 | 56 | // Don't show this element in the context of an admin menu. |
| 57 | 57 | if (!isset($form['admin_label'])) { |
| 58 | 58 | $form['value']['#suffix'] = |
| 59 | - '<a class="simple-proximity-location-button button" title="' . $this->t('Use your current location') . '">' . |
|
| 60 | - ' <i class="fa fa-map-marker" aria-hidden="true"></i>' . |
|
| 61 | - '</a>' . $form['value']['#suffix']; |
|
| 59 | + '<a class="simple-proximity-location-button button" title="'.$this->t('Use your current location').'">'. |
|
| 60 | + ' <i class="fa fa-map-marker" aria-hidden="true"></i>'. |
|
| 61 | + '</a>'.$form['value']['#suffix']; |
|
| 62 | 62 | $form['value']['#attached'] = ['library' => ['df_tools_map/main']]; |
| 63 | 63 | } |
| 64 | 64 | } |
@@ -109,15 +109,15 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | // Geocode the location if it's present. |
| 111 | 111 | if (!empty($location)) { |
| 112 | - if ($collection = \Drupal::service('geocoder')->geocode($location,['googlemaps'])) { |
|
| 112 | + if ($collection = \Drupal::service('geocoder')->geocode($location, ['googlemaps'])) { |
|
| 113 | 113 | $coordinates = $collection->first()->getCoordinates(); |
| 114 | 114 | |
| 115 | 115 | // Generate a distance formula programatically. |
| 116 | 116 | $haversine_options = [ |
| 117 | 117 | 'origin_latitude' => $coordinates->getLatitude(), |
| 118 | 118 | 'origin_longitude' => $coordinates->getLongitude(), |
| 119 | - 'destination_latitude' => $this->table . '.' . $this->realField . '_lat', |
|
| 120 | - 'destination_longitude' => $this->table . '.' . $this->realField . '_lon', |
|
| 119 | + 'destination_latitude' => $this->table.'.'.$this->realField.'_lat', |
|
| 120 | + 'destination_longitude' => $this->table.'.'.$this->realField.'_lon', |
|
| 121 | 121 | 'earth_radius' => GEOFIELD_KILOMETERS, |
| 122 | 122 | ]; |
| 123 | 123 | |
@@ -125,13 +125,13 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | /** @var \Drupal\views\Plugin\views\query\Sql $query */ |
| 127 | 127 | $query = $this->query; |
| 128 | - $query->addOrderBy(NULL, $formula, 'ASC', $this->table . '_simple_proximity'); |
|
| 128 | + $query->addOrderBy(NULL, $formula, 'ASC', $this->table.'_simple_proximity'); |
|
| 129 | 129 | |
| 130 | 130 | // Add a where expression if a distance is used. |
| 131 | 131 | if ($this->options['expose']['distance']) { |
| 132 | 132 | $distance = $this->options['expose']['distance']; |
| 133 | - $placeholder = $query->placeholder($this->table . '_simple_proximity'); |
|
| 134 | - $query->addWhereExpression(0, '(' . $formula . ' <= ' . $placeholder . ')', [$placeholder => $distance]); |
|
| 133 | + $placeholder = $query->placeholder($this->table.'_simple_proximity'); |
|
| 134 | + $query->addWhereExpression(0, '('.$formula.' <= '.$placeholder.')', [$placeholder => $distance]); |
|
| 135 | 135 | } |
| 136 | 136 | } |
| 137 | 137 | } |
@@ -149,10 +149,10 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | foreach ($options as $key => $option) { |
| 151 | 151 | if (is_numeric($option)) { |
| 152 | - $formula = str_replace(':' . $key, $option, $formula); |
|
| 152 | + $formula = str_replace(':'.$key, $option, $formula); |
|
| 153 | 153 | } |
| 154 | 154 | else { |
| 155 | - $formula = str_replace(':' . $key, db_escape_field($option), $formula); |
|
| 155 | + $formula = str_replace(':'.$key, db_escape_field($option), $formula); |
|
| 156 | 156 | } |
| 157 | 157 | } |
| 158 | 158 | |
@@ -102,8 +102,7 @@ discard block |
||
| 102 | 102 | $this->ensureMyTable(); |
| 103 | 103 | if (is_array($this->value)) { |
| 104 | 104 | $location = $this->value[0]; |
| 105 | - } |
|
| 106 | - else { |
|
| 105 | + } else { |
|
| 107 | 106 | $location = $this->value; |
| 108 | 107 | } |
| 109 | 108 | |
@@ -150,8 +149,7 @@ discard block |
||
| 150 | 149 | foreach ($options as $key => $option) { |
| 151 | 150 | if (is_numeric($option)) { |
| 152 | 151 | $formula = str_replace(':' . $key, $option, $formula); |
| 153 | - } |
|
| 154 | - else { |
|
| 152 | + } else { |
|
| 155 | 153 | $formula = str_replace(':' . $key, db_escape_field($option), $formula); |
| 156 | 154 | } |
| 157 | 155 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | public function prepareRow(Row $row) { |
| 18 | 18 | // Prefix the state per the normal Address schema. |
| 19 | 19 | if ($state = $row->getSourceProperty('Address State')) { |
| 20 | - $row->setSourceProperty('Address State', 'US-' . $state); |
|
| 20 | + $row->setSourceProperty('Address State', 'US-'.$state); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | // Use a cached geolocation if possible. |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $zip = $row->getSourceProperty('Address Zip'); |
| 35 | 35 | |
| 36 | 36 | if ($address && $city && $zip && $state) { |
| 37 | - $address2 = $address2 ? $address2 . "\n" : ''; |
|
| 37 | + $address2 = $address2 ? $address2."\n" : ''; |
|
| 38 | 38 | $address_string = "$address\n$address2$city, $state $zip\nUS"; |
| 39 | 39 | if ($collection = \Drupal::service('geocoder')->geocode($address_string, ['googlemaps'])) { |
| 40 | 40 | // Set our value in a similar way to Geofield's LatLon Widget. |
@@ -32,8 +32,7 @@ |
||
| 32 | 32 | // Create a MigrateSource object. |
| 33 | 33 | if (isset($arguments['path'])) { |
| 34 | 34 | $import_path = $arguments['path']; |
| 35 | - } |
|
| 36 | - else { |
|
| 35 | + } else { |
|
| 37 | 36 | $import_path = drupal_get_path('module', 'df_tools_commerce_product') . '/import/df_tools_commerce.fpp.commerce_product.csv'; |
| 38 | 37 | } |
| 39 | 38 | $this->source = new MigrateSourceCSV($import_path, array(), array('header_rows' => 1)); |
@@ -6,6 +6,6 @@ |
||
| 6 | 6 | function df_tools_frontend_library_info_alter(&$libraries, $extension) { |
| 7 | 7 | if ($extension == 'image') { |
| 8 | 8 | $path = drupal_get_path('module', 'df_tools_frontend'); |
| 9 | - $libraries['quickedit.inPlaceEditor.image']['js']['/' . $path . '/js/quickedit_image_browser.js'] = []; |
|
| 9 | + $libraries['quickedit.inPlaceEditor.image']['js']['/'.$path.'/js/quickedit_image_browser.js'] = []; |
|
| 10 | 10 | } |
| 11 | 11 | } |
@@ -90,8 +90,7 @@ discard block |
||
| 90 | 90 | $entity_view_mode_ids = array_keys($this->entityManager()->getViewModes($entity->getEntityTypeId())); |
| 91 | 91 | if (in_array($view_mode_id, $entity_view_mode_ids)) { |
| 92 | 92 | $output = $entity->$field_name->view($view_mode_id); |
| 93 | - } |
|
| 94 | - else { |
|
| 93 | + } else { |
|
| 95 | 94 | // Each part of a custom (non-Entity Display) view mode ID is separated |
| 96 | 95 | // by a dash; the first part must be the module name. |
| 97 | 96 | $mode_id_parts = explode('-', $view_mode_id, 2); |
@@ -108,8 +107,7 @@ discard block |
||
| 108 | 107 | 'html' => $this->renderer->renderRoot($output), |
| 109 | 108 | ]; |
| 110 | 109 | return new JsonResponse($data); |
| 111 | - } |
|
| 112 | - else { |
|
| 110 | + } else { |
|
| 113 | 111 | return new JsonResponse(['main_error' => $this->t('File does not exist.')]); |
| 114 | 112 | } |
| 115 | 113 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 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. |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | foreach ($settings['editor']['formats'] as &$format) { |
| 38 | 38 | // Swap in our custom JS by adding a pseudo plugin. We do this as we do not |
| 39 | 39 | // provide a button, which is what traditional CKEditor plugins would do. |
| 40 | - $format['editorSettings']['drupalExternalPlugins']['df_tools_editor'] = base_path() . drupal_get_path('module', 'df_tools_editor') . '/js/df_tools_editor.js'; |
|
| 40 | + $format['editorSettings']['drupalExternalPlugins']['df_tools_editor'] = base_path().drupal_get_path('module', 'df_tools_editor').'/js/df_tools_editor.js'; |
|
| 41 | 41 | $format['editorSettings']['extraPlugins'] .= ',df_tools_editor'; |
| 42 | 42 | } |
| 43 | 43 | } |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | if ($migration != null) { |
| 49 | 49 | $definition = $migration->getPluginDefinition(); |
| 50 | 50 | $dump = Yaml::dump($definition); |
| 51 | - $file_url = $destination . $migration->id() . '.yml'; |
|
| 51 | + $file_url = $destination.$migration->id().'.yml'; |
|
| 52 | 52 | $message = t('Export migration @name?', ['@name' => $name]); |
| 53 | 53 | if (drush_confirm($message) && $data = file_save_data($dump, $file_url)) { |
| 54 | 54 | drush_print(t('File saved: @file', ['@file' => $data->getFileUri()])); |