| @@ -12,7 +12,7 @@ | ||
| 12 | 12 |    foreach ($settings['editor']['formats'] as &$format) { | 
| 13 | 13 | // Swap in our custom JS by adding a pseudo plugin. We do this as we do not | 
| 14 | 14 | // provide a button, which is what traditional CKEditor plugins would do. | 
| 15 | -    $format['editorSettings']['drupalExternalPlugins']['df_tools_editor'] = base_path() . drupal_get_path('module', 'df_tools_editor') . '/js/df_tools_editor.js'; | |
| 15 | +    $format['editorSettings']['drupalExternalPlugins']['df_tools_editor'] = base_path().drupal_get_path('module', 'df_tools_editor').'/js/df_tools_editor.js'; | |
| 16 | 16 | $format['editorSettings']['extraPlugins'] .= ',df_tools_editor'; | 
| 17 | 17 | } | 
| 18 | 18 | } | 
| @@ -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'; | |
| @@ -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' => [ | 
| @@ -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 | |
| @@ -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 | } | 
| @@ -50,7 +50,7 @@ discard block | ||
| 50 | 50 | return; | 
| 51 | 51 | } | 
| 52 | 52 | |
| 53 | -  $config = \Drupal::configFactory()->getEditable('color.theme.' . $theme); | |
| 53 | +  $config = \Drupal::configFactory()->getEditable('color.theme.'.$theme); | |
| 54 | 54 | |
| 55 | 55 | // Resolve palette. | 
| 56 | 56 |    if ($scheme != '') { | 
| @@ -65,7 +65,7 @@ discard block | ||
| 65 | 65 | // Make sure enough memory is available. | 
| 66 | 66 |    if (isset($info['base_image'])) { | 
| 67 | 67 | // Fetch source image dimensions. | 
| 68 | -    $source = drupal_get_path('theme', $theme) . '/' . $info['base_image']; | |
| 68 | +    $source = drupal_get_path('theme', $theme).'/'.$info['base_image']; | |
| 69 | 69 | list($width, $height) = getimagesize($source); | 
| 70 | 70 | |
| 71 | 71 | // We need at least a copy of the source and a target buffer of the same | 
| @@ -102,28 +102,28 @@ discard block | ||
| 102 | 102 | } | 
| 103 | 103 | |
| 104 | 104 | // Prepare target locations for generated files. | 
| 105 | -  $id = $theme . '-' . substr(hash('sha256', serialize($palette) . microtime()), 0, 8); | |
| 105 | +  $id = $theme.'-'.substr(hash('sha256', serialize($palette).microtime()), 0, 8); | |
| 106 | 106 | $paths['color'] = 'public://color'; | 
| 107 | - $paths['target'] = $paths['color'] . '/' . $id; | |
| 107 | + $paths['target'] = $paths['color'].'/'.$id; | |
| 108 | 108 |    foreach ($paths as $path) { | 
| 109 | 109 | file_prepare_directory($path, FILE_CREATE_DIRECTORY); | 
| 110 | 110 | } | 
| 111 | - $paths['target'] = $paths['target'] . '/'; | |
| 111 | + $paths['target'] = $paths['target'].'/'; | |
| 112 | 112 | $paths['id'] = $id; | 
| 113 | -  $paths['source'] = drupal_get_path('theme', $theme) . '/'; | |
| 113 | +  $paths['source'] = drupal_get_path('theme', $theme).'/'; | |
| 114 | 114 | $paths['files'] = $paths['map'] = array(); | 
| 115 | 115 | |
| 116 | 116 | // Save palette and logo location. | 
| 117 | 117 | $config | 
| 118 | 118 |      ->set('palette', $palette) | 
| 119 | -    ->set('logo', $paths['target'] . 'logo.svg') | |
| 119 | +    ->set('logo', $paths['target'].'logo.svg') | |
| 120 | 120 | ->save(); | 
| 121 | 121 | |
| 122 | 122 | // Copy over neutral images. | 
| 123 | 123 |    foreach ($info['copy'] as $file) { | 
| 124 | 124 | $base = drupal_basename($file); | 
| 125 | - $source = $paths['source'] . $file; | |
| 126 | - $filepath = file_unmanaged_copy($source, $paths['target'] . $base); | |
| 125 | + $source = $paths['source'].$file; | |
| 126 | + $filepath = file_unmanaged_copy($source, $paths['target'].$base); | |
| 127 | 127 | $paths['map'][$file] = $base; | 
| 128 | 128 | $paths['files'][] = $filepath; | 
| 129 | 129 | } | 
| @@ -138,7 +138,7 @@ discard block | ||
| 138 | 138 |    foreach ($info['css'] as $stylesheet) { | 
| 139 | 139 | // Build a temporary array with CSS files. | 
| 140 | 140 | $files = array(); | 
| 141 | -    if (file_exists($paths['source'] . $stylesheet)) { | |
| 141 | +    if (file_exists($paths['source'].$stylesheet)) { | |
| 142 | 142 | $files[] = $stylesheet; | 
| 143 | 143 | } | 
| 144 | 144 | |
| @@ -147,11 +147,11 @@ discard block | ||
| 147 | 147 | // Aggregate @imports recursively for each configured top level CSS file | 
| 148 | 148 | // without optimization. Aggregation and optimization will be | 
| 149 | 149 | // handled by drupal_build_css_cache() only. | 
| 150 | - $style = $css_optimizer->loadFile($paths['source'] . $file, FALSE); | |
| 150 | + $style = $css_optimizer->loadFile($paths['source'].$file, FALSE); | |
| 151 | 151 | |
| 152 | 152 | // Return the path to where this CSS file originated from, stripping | 
| 153 | 153 | // off the name of the file at the end of the path. | 
| 154 | - $css_optimizer->rewriteFileURIBasePath = base_path() . dirname($paths['source'] . $file) . '/'; | |
| 154 | + $css_optimizer->rewriteFileURIBasePath = base_path().dirname($paths['source'].$file).'/'; | |
| 155 | 155 | |
| 156 | 156 | // Prefix all paths within this CSS file, ignoring absolute paths. | 
| 157 | 157 |        $style = preg_replace_callback('/url\([\'"]?(?![a-z]+:|\/+)([^\'")]+)[\'"]?\)/i', array($css_optimizer, 'rewriteFileURI'), $style); | 
| @@ -159,8 +159,8 @@ discard block | ||
| 159 | 159 | // Rewrite stylesheet with new colors. | 
| 160 | 160 | $style = _df_tools_color_color_rewrite_stylesheet($theme, $info, $paths, $palette, $style); | 
| 161 | 161 | $base_file = drupal_basename($file); | 
| 162 | - $css[] = $paths['target'] . $base_file; | |
| 163 | - _color_save_stylesheet($paths['target'] . $base_file, $style, $paths); | |
| 162 | + $css[] = $paths['target'].$base_file; | |
| 163 | + _color_save_stylesheet($paths['target'].$base_file, $style, $paths); | |
| 164 | 164 | } | 
| 165 | 165 | } | 
| 166 | 166 | |
| @@ -216,7 +216,7 @@ discard block | ||
| 216 | 216 | |
| 217 | 217 | // Convert placeholder ids to the format we handle. | 
| 218 | 218 |      foreach ($palette_template as $color_id => $color_placeholder) { | 
| 219 | - $palette_template[$color_id] = '#__' . Html::cleanCssIdentifier((string) $color_placeholder, $filter) . '__'; | |
| 219 | + $palette_template[$color_id] = '#__'.Html::cleanCssIdentifier((string) $color_placeholder, $filter).'__'; | |
| 220 | 220 | } | 
| 221 | 221 | |
| 222 | 222 | return $palette_template; | 
| @@ -291,7 +291,7 @@ discard block | ||
| 291 | 291 | |
| 292 | 292 | // Replace paths to images. | 
| 293 | 293 |    foreach ($paths['map'] as $before => $after) { | 
| 294 | - $before = base_path() . $paths['source'] . $before; | |
| 294 | + $before = base_path().$paths['source'].$before; | |
| 295 | 295 |      $before = preg_replace('`(^|/)(?!../)([^/]+)/../`', '$1', $before); | 
| 296 | 296 | $output = str_replace($before, $after, $output); | 
| 297 | 297 | } | 
| @@ -43,12 +43,12 @@ discard block | ||
| 43 | 43 | } | 
| 44 | 44 |          else { | 
| 45 | 45 |            foreach ($value as $j) { | 
| 46 | - $output[] = $this->keysToString($keys) . '[] = ' . $j; | |
| 46 | + $output[] = $this->keysToString($keys).'[] = '.$j; | |
| 47 | 47 | } | 
| 48 | 48 | } | 
| 49 | 49 | } | 
| 50 | 50 |        else { | 
| 51 | - $output[] = $this->keysToString($keys) . ' = ' . $value; | |
| 51 | + $output[] = $this->keysToString($keys).' = '.$value; | |
| 52 | 52 | } | 
| 53 | 53 | |
| 54 | 54 | array_pop($keys); | 
| @@ -69,7 +69,7 @@ discard block | ||
| 69 | 69 |    protected function keysToString(array $keys) { | 
| 70 | 70 | $head = array_shift($keys); | 
| 71 | 71 |      if ($keys) { | 
| 72 | -      return $head . '[' . implode('][', $keys) . ']'; | |
| 72 | +      return $head.'['.implode('][', $keys).']'; | |
| 73 | 73 | } | 
| 74 | 74 |      else { | 
| 75 | 75 | return $head; | 
| @@ -123,7 +123,7 @@ discard block | ||
| 123 | 123 |          foreach (['key', 'value1', 'value2', 'value3'] as $var) { | 
| 124 | 124 | $$var = isset($match[++$i]) ? $match[$i] : ''; | 
| 125 | 125 | } | 
| 126 | - $value = stripslashes(substr($value1, 1, -1)) . stripslashes(substr($value2, 1, -1)) . $value3; | |
| 126 | + $value = stripslashes(substr($value1, 1, -1)).stripslashes(substr($value2, 1, -1)).$value3; | |
| 127 | 127 | |
| 128 | 128 | // Parse array syntax. | 
| 129 | 129 |          $keys = preg_split('/\]?\[/', rtrim($key, ']')); | 
| @@ -139,7 +139,7 @@ | ||
| 139 | 139 | $selection['table'][$mid] = [ | 
| 140 | 140 | '#attributes' => [ | 
| 141 | 141 | 'class' => ['draggable'], | 
| 142 | - 'data-entity-id' => $media->getEntityTypeId() . ':' . $mid, | |
| 142 | + 'data-entity-id' => $media->getEntityTypeId().':'.$mid, | |
| 143 | 143 | ], | 
| 144 | 144 | 'title' => ['#markup' => $media->label()], | 
| 145 | 145 | 'type' => ['#markup' => $bundle_info[$media->bundle()]['label']], | 
| @@ -181,11 +181,11 @@ | ||
| 181 | 181 | // Check if this field is an Address field. | 
| 182 | 182 |        if (isset($address['address_line1'])) { | 
| 183 | 183 | // Format the address as a single string. | 
| 184 | - $string .= $address['address_line1'] . "\n"; | |
| 185 | - $string .= !empty($address['address_line2']) ? $address['address_line2'] . "\n" : ''; | |
| 186 | - $string .= $address['locality'] . ', '; | |
| 187 | -        $string .= str_replace('US-', '', $address['administrative_area']) . ' '; | |
| 188 | - $string .= $address['postal_code'] . "\n"; | |
| 184 | + $string .= $address['address_line1']."\n"; | |
| 185 | + $string .= !empty($address['address_line2']) ? $address['address_line2']."\n" : ''; | |
| 186 | + $string .= $address['locality'].', '; | |
| 187 | +        $string .= str_replace('US-', '', $address['administrative_area']).' '; | |
| 188 | + $string .= $address['postal_code']."\n"; | |
| 189 | 189 | $string .= $address['country_code']; | 
| 190 | 190 | } | 
| 191 | 191 | |