@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | batch_set($batch); |
| 72 | 72 | // Set a batch to update configuration as well. |
| 73 | 73 | if ($batch = locale_config_batch_update_components($options, $langcodes)) { |
| 74 | - $batch['file'] = drupal_get_path('module', 'df_tools_translation') . '/df_tools_translation.batch.inc'; |
|
| 74 | + $batch['file'] = drupal_get_path('module', 'df_tools_translation').'/df_tools_translation.batch.inc'; |
|
| 75 | 75 | batch_set($batch); |
| 76 | 76 | } |
| 77 | 77 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | // Import each file. |
| 99 | 99 | foreach ($langcodes as $langcode) { |
| 100 | - $filepath = DRUPAL_ROOT . '/' . $path . '/translations/' . $langcode . '.po'; |
|
| 100 | + $filepath = DRUPAL_ROOT.'/'.$path.'/translations/'.$langcode.'.po'; |
|
| 101 | 101 | if (file_exists($filepath)) { |
| 102 | 102 | \Drupal::moduleHandler()->loadInclude('locale', 'bulk.inc'); |
| 103 | 103 | \Drupal::moduleHandler()->loadInclude('locale', 'translation.inc'); |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | ]); |
| 112 | 112 | |
| 113 | 113 | $original_file = (object) [ |
| 114 | - 'filename' => $langcode . '.po', |
|
| 114 | + 'filename' => $langcode.'.po', |
|
| 115 | 115 | 'uri' => $filepath |
| 116 | 116 | ]; |
| 117 | 117 | $file = locale_translate_file_attach_properties($original_file, $options); |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | if ($langcode == 'en') { |
| 155 | 155 | $langcode = ''; |
| 156 | 156 | } |
| 157 | - $url = Url::fromUri('base:/' . $langcode . $alias); |
|
| 157 | + $url = Url::fromUri('base:/'.$langcode.$alias); |
|
| 158 | 158 | |
| 159 | 159 | $current_name = [ |
| 160 | 160 | '#markup' => t($language->getName()) |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | return; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - $config = \Drupal::configFactory()->getEditable('color.theme.' . $theme); |
|
| 54 | + $config = \Drupal::configFactory()->getEditable('color.theme.'.$theme); |
|
| 55 | 55 | |
| 56 | 56 | // Resolve palette. |
| 57 | 57 | if ($scheme != '') { |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | // Make sure enough memory is available. |
| 67 | 67 | if (isset($info['base_image'])) { |
| 68 | 68 | // Fetch source image dimensions. |
| 69 | - $source = drupal_get_path('theme', $theme) . '/' . $info['base_image']; |
|
| 69 | + $source = drupal_get_path('theme', $theme).'/'.$info['base_image']; |
|
| 70 | 70 | list($width, $height) = getimagesize($source); |
| 71 | 71 | |
| 72 | 72 | // We need at least a copy of the source and a target buffer of the same |
@@ -104,28 +104,28 @@ discard block |
||
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | // Prepare target locations for generated files. |
| 107 | - $id = $theme . '-' . substr(hash('sha256', serialize($palette) . microtime()), 0, 8); |
|
| 107 | + $id = $theme.'-'.substr(hash('sha256', serialize($palette).microtime()), 0, 8); |
|
| 108 | 108 | $paths['color'] = 'public://color'; |
| 109 | - $paths['target'] = $paths['color'] . '/' . $id; |
|
| 109 | + $paths['target'] = $paths['color'].'/'.$id; |
|
| 110 | 110 | foreach ($paths as $path) { |
| 111 | 111 | \Drupal::service('file_system')->prepareDirectory($path, FileSystemInterface::CREATE_DIRECTORY); |
| 112 | 112 | } |
| 113 | - $paths['target'] = $paths['target'] . '/'; |
|
| 113 | + $paths['target'] = $paths['target'].'/'; |
|
| 114 | 114 | $paths['id'] = $id; |
| 115 | - $paths['source'] = drupal_get_path('theme', $theme) . '/'; |
|
| 115 | + $paths['source'] = drupal_get_path('theme', $theme).'/'; |
|
| 116 | 116 | $paths['files'] = $paths['map'] = array(); |
| 117 | 117 | |
| 118 | 118 | // Save palette and logo location. |
| 119 | 119 | $config |
| 120 | 120 | ->set('palette', $palette) |
| 121 | - ->set('logo', $paths['target'] . 'logo.svg') |
|
| 121 | + ->set('logo', $paths['target'].'logo.svg') |
|
| 122 | 122 | ->save(); |
| 123 | 123 | |
| 124 | 124 | // Copy over neutral images. |
| 125 | 125 | foreach ($info['copy'] as $file) { |
| 126 | 126 | $base = drupal_basename($file); |
| 127 | - $source = $paths['source'] . $file; |
|
| 128 | - $filepath = file_unmanaged_copy($source, $paths['target'] . $base); |
|
| 127 | + $source = $paths['source'].$file; |
|
| 128 | + $filepath = file_unmanaged_copy($source, $paths['target'].$base); |
|
| 129 | 129 | $paths['map'][$file] = $base; |
| 130 | 130 | $paths['files'][] = $filepath; |
| 131 | 131 | } |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | foreach ($info['css'] as $stylesheet) { |
| 141 | 141 | // Build a temporary array with CSS files. |
| 142 | 142 | $files = array(); |
| 143 | - if (file_exists($paths['source'] . $stylesheet)) { |
|
| 143 | + if (file_exists($paths['source'].$stylesheet)) { |
|
| 144 | 144 | $files[] = $stylesheet; |
| 145 | 145 | } |
| 146 | 146 | |
@@ -149,11 +149,11 @@ discard block |
||
| 149 | 149 | // Aggregate @imports recursively for each configured top level CSS file |
| 150 | 150 | // without optimization. Aggregation and optimization will be |
| 151 | 151 | // handled by drupal_build_css_cache() only. |
| 152 | - $style = $css_optimizer->loadFile($paths['source'] . $file, FALSE); |
|
| 152 | + $style = $css_optimizer->loadFile($paths['source'].$file, FALSE); |
|
| 153 | 153 | |
| 154 | 154 | // Return the path to where this CSS file originated from, stripping |
| 155 | 155 | // off the name of the file at the end of the path. |
| 156 | - $css_optimizer->rewriteFileURIBasePath = base_path() . dirname($paths['source'] . $file) . '/'; |
|
| 156 | + $css_optimizer->rewriteFileURIBasePath = base_path().dirname($paths['source'].$file).'/'; |
|
| 157 | 157 | |
| 158 | 158 | // Prefix all paths within this CSS file, ignoring absolute paths. |
| 159 | 159 | $style = preg_replace_callback('/url\([\'"]?(?![a-z]+:|\/+)([^\'")]+)[\'"]?\)/i', array($css_optimizer, 'rewriteFileURI'), $style); |
@@ -161,8 +161,8 @@ discard block |
||
| 161 | 161 | // Rewrite stylesheet with new colors. |
| 162 | 162 | $style = _df_tools_color_color_rewrite_stylesheet($theme, $info, $paths, $palette, $style); |
| 163 | 163 | $base_file = drupal_basename($file); |
| 164 | - $css[] = $paths['target'] . $base_file; |
|
| 165 | - _color_save_stylesheet($paths['target'] . $base_file, $style, $paths); |
|
| 164 | + $css[] = $paths['target'].$base_file; |
|
| 165 | + _color_save_stylesheet($paths['target'].$base_file, $style, $paths); |
|
| 166 | 166 | } |
| 167 | 167 | } |
| 168 | 168 | |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | |
| 219 | 219 | // Convert placeholder ids to the format we handle. |
| 220 | 220 | foreach ($palette_template as $color_id => $color_placeholder) { |
| 221 | - $palette_template[$color_id] = '#__' . Html::cleanCssIdentifier((string) $color_placeholder, $filter) . '__'; |
|
| 221 | + $palette_template[$color_id] = '#__'.Html::cleanCssIdentifier((string) $color_placeholder, $filter).'__'; |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | return $palette_template; |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | |
| 294 | 294 | // Replace paths to images. |
| 295 | 295 | foreach ($paths['map'] as $before => $after) { |
| 296 | - $before = base_path() . $paths['source'] . $before; |
|
| 296 | + $before = base_path().$paths['source'].$before; |
|
| 297 | 297 | $before = preg_replace('`(^|/)(?!../)([^/]+)/../`', '$1', $before); |
| 298 | 298 | $output = str_replace($before, $after, $output); |
| 299 | 299 | } |
@@ -96,8 +96,7 @@ discard block |
||
| 96 | 96 | $entity_view_mode_ids = array_keys(\Drupal::entityTypeManager()->getViewModes($entity->getEntityTypeId())); |
| 97 | 97 | if (in_array($view_mode_id, $entity_view_mode_ids)) { |
| 98 | 98 | $output = $entity->$field_name->view($view_mode_id); |
| 99 | - } |
|
| 100 | - else { |
|
| 99 | + } else { |
|
| 101 | 100 | // Each part of a custom (non-Entity Display) view mode ID is separated |
| 102 | 101 | // by a dash; the first part must be the module name. |
| 103 | 102 | $mode_id_parts = explode('-', $view_mode_id, 2); |
@@ -114,8 +113,7 @@ discard block |
||
| 114 | 113 | 'html' => $this->renderer->renderRoot($output), |
| 115 | 114 | ]; |
| 116 | 115 | return new JsonResponse($data); |
| 117 | - } |
|
| 118 | - else { |
|
| 116 | + } else { |
|
| 119 | 117 | return new JsonResponse(['main_error' => $this->t('File does not exist.')]); |
| 120 | 118 | } |
| 121 | 119 | } |
@@ -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 | } |
@@ -150,10 +150,10 @@ discard block |
||
| 150 | 150 | |
| 151 | 151 | foreach ($options as $key => $option) { |
| 152 | 152 | if (is_numeric($option)) { |
| 153 | - $formula = str_replace(':' . $key, $option, $formula); |
|
| 153 | + $formula = str_replace(':'.$key, $option, $formula); |
|
| 154 | 154 | } |
| 155 | 155 | else { |
| 156 | - $formula = str_replace(':' . $key, $connection->escapeField($option), $formula); |
|
| 156 | + $formula = str_replace(':'.$key, $connection->escapeField($option), $formula); |
|
| 157 | 157 | } |
| 158 | 158 | } |
| 159 | 159 | |
@@ -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 | |
@@ -151,8 +150,7 @@ discard block |
||
| 151 | 150 | foreach ($options as $key => $option) { |
| 152 | 151 | if (is_numeric($option)) { |
| 153 | 152 | $formula = str_replace(':' . $key, $option, $formula); |
| 154 | - } |
|
| 155 | - else { |
|
| 153 | + } else { |
|
| 156 | 154 | $formula = str_replace(':' . $key, $connection->escapeField($option), $formula); |
| 157 | 155 | } |
| 158 | 156 | } |
@@ -25,8 +25,7 @@ discard block |
||
| 25 | 25 | function df_tools_media_views_insert(ViewEntityInterface $view) { |
| 26 | 26 | if (\Drupal::isConfigSyncing()) { |
| 27 | 27 | return; |
| 28 | - } |
|
| 29 | - elseif (InstallerKernel::installationAttempted() && $view->id() == 'media') { |
|
| 28 | + } elseif (InstallerKernel::installationAttempted() && $view->id() == 'media') { |
|
| 30 | 29 | $display1 = &$view->getDisplay('entity_browser_1'); |
| 31 | 30 | $display2 = &$view->getDisplay('entity_browser_2'); |
| 32 | 31 | $display1['display_options']['filters']['field_tags_target_id'] = $display2['display_options']['filters']['field_tags_target_id'] = [ |
@@ -165,8 +164,7 @@ discard block |
||
| 165 | 164 | $entity->$image_field->focal_point = $x_y; |
| 166 | 165 | $entity->$image_field->alt = $entity->label(); |
| 167 | 166 | $entity->$image_field->target_id = $file->id(); |
| 168 | - } |
|
| 169 | - elseif (in_array($type, $types) |
|
| 167 | + } elseif (in_array($type, $types) |
|
| 170 | 168 | && $entity->hasField($image_field) |
| 171 | 169 | && !$entity->get($image_field)->isEmpty() |
| 172 | 170 | && $entity->hasField($unsplash_field) |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | $request = \Drupal::request(); |
| 19 | 19 | |
| 20 | 20 | // Add language body class. |
| 21 | - $variables['attributes']['class'][] = 'lang-' . $site_language; |
|
| 21 | + $variables['attributes']['class'][] = 'lang-'.$site_language; |
|
| 22 | 22 | |
| 23 | 23 | // Classes for body element. Allows advanced theming based on context |
| 24 | 24 | $is_front_page = \Drupal::service('path.matcher')->isFrontPage(); |
@@ -32,10 +32,10 @@ discard block |
||
| 32 | 32 | $section = 'node-add'; |
| 33 | 33 | } |
| 34 | 34 | elseif (isset($arg[2]) && is_numeric($arg[1]) && ($arg[2] == 'edit' || $arg[2] == 'delete')) { |
| 35 | - $section = 'node-' . $arg[2]; |
|
| 35 | + $section = 'node-'.$arg[2]; |
|
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | - $variables['attributes']['class'][] = Html::getClass('section-' . $section); |
|
| 38 | + $variables['attributes']['class'][] = Html::getClass('section-'.$section); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | // Store the menu item since it has some useful information. |