@@ -15,8 +15,8 @@ discard block |
||
| 15 | 15 | // Main module help for the dfs_dev module. |
| 16 | 16 | case 'help.page.dfs_tec': |
| 17 | 17 | $output = ''; |
| 18 | - $output .= '<h3>' . t('About') . '</h3>'; |
|
| 19 | - $output .= '<p>' . t('Demo Framework Scenario for Technology Websites.') . '</p>'; |
|
| 18 | + $output .= '<h3>'.t('About').'</h3>'; |
|
| 19 | + $output .= '<p>'.t('Demo Framework Scenario for Technology Websites.').'</p>'; |
|
| 20 | 20 | return $output; |
| 21 | 21 | default: |
| 22 | 22 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | function dfs_tec_migration_plugins_alter(&$definitions) { |
| 78 | 78 | // Set up base path. |
| 79 | - $path = dirname(__FILE__) . '/data/'; |
|
| 79 | + $path = dirname(__FILE__).'/data/'; |
|
| 80 | 80 | |
| 81 | 81 | $dfs = 'dfs_tec'; |
| 82 | 82 | |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | // Add our block migrations |
| 177 | 177 | $block_types = array('slideshow', 'hero', 'basic'); |
| 178 | 178 | foreach ($block_types as $type) { |
| 179 | - $migration = _df_migration_copy($definitions['import_block_' . $type], $dfs, $type, 'block_content', $path); |
|
| 179 | + $migration = _df_migration_copy($definitions['import_block_'.$type], $dfs, $type, 'block_content', $path); |
|
| 180 | 180 | $definitions[$migration['id']] = $migration; |
| 181 | 181 | } |
| 182 | 182 | |
@@ -75,13 +75,13 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | try { |
| 77 | 77 | $module_info = \Drupal::moduleHandler()->getModule($input); |
| 78 | - $destination_dir = DRUPAL_ROOT . '/' . $module_info->getPath() . '/config/install/'; |
|
| 79 | - $source = DRUPAL_ROOT . '/' . $destination_storage->getFilePath($config); |
|
| 78 | + $destination_dir = DRUPAL_ROOT.'/'.$module_info->getPath().'/config/install/'; |
|
| 79 | + $source = DRUPAL_ROOT.'/'.$destination_storage->getFilePath($config); |
|
| 80 | 80 | // Create /config/install directory if it does not exist. |
| 81 | 81 | if (!file_exists($destination_dir)) { |
| 82 | 82 | mkdir($destination_dir, 0755, true); |
| 83 | 83 | } |
| 84 | - $destination = $destination_dir . basename($source); |
|
| 84 | + $destination = $destination_dir.basename($source); |
|
| 85 | 85 | if (!copy($source, $destination)) { |
| 86 | 86 | drush_log(dt('New copy from @source to @destination failed.', ['@source' => $source, '@destination' => $destination]), LogLevel::ERROR); |
| 87 | 87 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | break; |
| 97 | 97 | case 'update': |
| 98 | 98 | foreach ($list as $config) { |
| 99 | - $source = DRUPAL_ROOT . '/' . $destination_storage->getFilePath($config); |
|
| 99 | + $source = DRUPAL_ROOT.'/'.$destination_storage->getFilePath($config); |
|
| 100 | 100 | |
| 101 | 101 | $instances = _df_tools_config_find_config_instances($destination_storage, $config); |
| 102 | 102 | $choice = drush_choice($instances, dt('Choose update destination for @config.', ['@config' => $config])); |
@@ -148,8 +148,8 @@ discard block |
||
| 148 | 148 | |
| 149 | 149 | $iterator = new RecursiveDirectoryIterator(DRUPAL_ROOT); |
| 150 | 150 | $files = []; |
| 151 | - foreach(new RecursiveIteratorIterator($iterator) as $file){ |
|
| 152 | - if(strpos($file, $filename) !== FALSE && strpos($file, DRUPAL_ROOT . '/sites/') === FALSE){ |
|
| 151 | + foreach (new RecursiveIteratorIterator($iterator) as $file) { |
|
| 152 | + if (strpos($file, $filename) !== FALSE && strpos($file, DRUPAL_ROOT.'/sites/') === FALSE) { |
|
| 153 | 153 | $files[] = (string) $file; |
| 154 | 154 | } |
| 155 | 155 | } |
@@ -1,4 +1,4 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -include_once drupal_get_path('module', 'locale') . '/locale.bulk.inc'; |
|
| 4 | -include_once drupal_get_path('module', 'locale') . '/locale.batch.inc'; |
|
| 3 | +include_once drupal_get_path('module', 'locale').'/locale.bulk.inc'; |
|
| 4 | +include_once drupal_get_path('module', 'locale').'/locale.batch.inc'; |
|
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | $source = $migration->getSourcePlugin(); |
| 17 | 17 | /** @var Drupal\migrate_source_csv\CSVFileObject $iterator */ |
| 18 | 18 | $iterator = $source->initializeIterator(); |
| 19 | - $filename = $iterator->getPath() . '/' . $iterator->getFilename(); |
|
| 19 | + $filename = $iterator->getPath().'/'.$iterator->getFilename(); |
|
| 20 | 20 | |
| 21 | 21 | $destination = $migration->getDestinationPlugin(); |
| 22 | 22 | $entity_type = explode(':', $destination->getPluginId())[1]; |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | batch_set($batch); |
| 198 | 198 | // Set a batch to update configuration as well. |
| 199 | 199 | if ($batch = locale_config_batch_update_components($options, $langcodes)) { |
| 200 | - $batch['file'] = drupal_get_path('module', 'df_tools_translation') . '/df_tools_translation.batch.inc'; |
|
| 200 | + $batch['file'] = drupal_get_path('module', 'df_tools_translation').'/df_tools_translation.batch.inc'; |
|
| 201 | 201 | batch_set($batch); |
| 202 | 202 | } |
| 203 | 203 | } |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | |
| 224 | 224 | // Import each file. |
| 225 | 225 | foreach ($langcodes as $langcode) { |
| 226 | - $filepath = DRUPAL_ROOT . '/' . $path . '/translations/' . $langcode . '.po'; |
|
| 226 | + $filepath = DRUPAL_ROOT.'/'.$path.'/translations/'.$langcode.'.po'; |
|
| 227 | 227 | if (file_exists($filepath)) { |
| 228 | 228 | \Drupal::moduleHandler()->loadInclude('locale', 'bulk.inc'); |
| 229 | 229 | \Drupal::moduleHandler()->loadInclude('locale', 'translation.inc'); |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | ]); |
| 238 | 238 | |
| 239 | 239 | $original_file = (object) [ |
| 240 | - 'filename' => $langcode . '.po', |
|
| 240 | + 'filename' => $langcode.'.po', |
|
| 241 | 241 | 'uri' => $filepath |
| 242 | 242 | ]; |
| 243 | 243 | $file = locale_translate_file_attach_properties($original_file, $options); |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | if ($langcode == 'en') { |
| 281 | 281 | $langcode = ''; |
| 282 | 282 | } |
| 283 | - $url = \Drupal\Core\Url::fromUri('base:/' . $langcode . $alias); |
|
| 283 | + $url = \Drupal\Core\Url::fromUri('base:/'.$langcode.$alias); |
|
| 284 | 284 | |
| 285 | 285 | $current_name = [ |
| 286 | 286 | '#markup' => t($language->getName()) |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | * {@inheritdoc} |
| 19 | 19 | */ |
| 20 | 20 | public static function getSubscribedEvents() { |
| 21 | - $events[RoutingEvents::ALTER] = ['onAlterRoutes',-9999]; // negative Values means "late" |
|
| 21 | + $events[RoutingEvents::ALTER] = ['onAlterRoutes', -9999]; // negative Values means "late" |
|
| 22 | 22 | return $events; |
| 23 | 23 | } |
| 24 | 24 | |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | if ($node = $event->getRequest()->get('node')) { |
| 61 | 61 | if (\Drupal::currentUser()->hasPermission('view latest version')) { |
| 62 | 62 | $theme = $this->themeManager->getActiveTheme()->getName(); |
| 63 | - $tag = 'config:block.block.' . $theme . '_local_actions'; |
|
| 63 | + $tag = 'config:block.block.'.$theme.'_local_actions'; |
|
| 64 | 64 | $this->cacheTagsInvalidator->invalidateTags([$tag]); |
| 65 | 65 | } |
| 66 | 66 | } |
@@ -10,13 +10,13 @@ |
||
| 10 | 10 | foreach ($geofield_map as $entity_type_id => $fields) { |
| 11 | 11 | foreach ($fields as $field_name => $info) { |
| 12 | 12 | $args = array('@field_name' => $field_name); |
| 13 | - $data_key = $entity_type_id . '__' . $field_name; |
|
| 13 | + $data_key = $entity_type_id.'__'.$field_name; |
|
| 14 | 14 | |
| 15 | 15 | $field_coordinates_table_data = $data[$data_key][$field_name]; |
| 16 | - $data[$data_key][$data_key . '_simple_proximity'] = [ |
|
| 16 | + $data[$data_key][$data_key.'_simple_proximity'] = [ |
|
| 17 | 17 | 'group' => 'Content', |
| 18 | 18 | 'title' => t('Simple Proximity (@field_name)', $args), |
| 19 | - 'title short' => $field_coordinates_table_data['title short'] . t(' Simple Proximity'), |
|
| 19 | + 'title short' => $field_coordinates_table_data['title short'].t(' Simple Proximity'), |
|
| 20 | 20 | 'help' => $field_coordinates_table_data['help'], |
| 21 | 21 | 'real field' => $field_name, |
| 22 | 22 | 'filter' => [ |
@@ -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 | } |
@@ -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 | |