@@ -13,40 +13,35 @@ |
||
| 13 | 13 | // Make Page Mangers pages full width |
| 14 | 14 | elseif (\Drupal::routeMatch()->getRouteObject()->hasDefault('page_manager_page')) { |
| 15 | 15 | $variables['container_class'] = 'container-fluid full'; |
| 16 | - } |
|
| 17 | - else { |
|
| 16 | + } else { |
|
| 18 | 17 | $variables['container_class'] = 'container'; |
| 19 | 18 | } |
| 20 | 19 | |
| 21 | 20 | // Set container for Meta Header |
| 22 | 21 | if (theme_get_setting('meta_header_full_width')) { |
| 23 | 22 | $variables['meta_header_width'] = 'container-fluid'; |
| 24 | - } |
|
| 25 | - else { |
|
| 23 | + } else { |
|
| 26 | 24 | $variables['meta_header_width'] = 'container'; |
| 27 | 25 | } |
| 28 | 26 | |
| 29 | 27 | // Set container for Navbar |
| 30 | 28 | if (theme_get_setting('navbar_full_width')) { |
| 31 | 29 | $variables['navbar_width'] = 'container-fluid'; |
| 32 | - } |
|
| 33 | - else { |
|
| 30 | + } else { |
|
| 34 | 31 | $variables['navbar_width'] = 'container'; |
| 35 | 32 | } |
| 36 | 33 | |
| 37 | 34 | // Set container for Header |
| 38 | 35 | if (theme_get_setting('header_full_width')) { |
| 39 | 36 | $variables['header_width'] = 'container-fluid'; |
| 40 | - } |
|
| 41 | - else { |
|
| 37 | + } else { |
|
| 42 | 38 | $variables['header_width'] = 'container'; |
| 43 | 39 | } |
| 44 | 40 | |
| 45 | 41 | // Set container for Footer |
| 46 | 42 | if (theme_get_setting('footer_full_width')) { |
| 47 | 43 | $variables['footer_width'] = 'container-fluid'; |
| 48 | - } |
|
| 49 | - else { |
|
| 44 | + } else { |
|
| 50 | 45 | $variables['footer_width'] = 'container'; |
| 51 | 46 | } |
| 52 | 47 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | // Append the prefix before buildRegions. |
| 44 | - $build['landing-top']['#prefix'] = '<div class="landing-display-' . $class . ' container-fluid">'; |
|
| 44 | + $build['landing-top']['#prefix'] = '<div class="landing-display-'.$class.' container-fluid">'; |
|
| 45 | 45 | |
| 46 | 46 | // Build the regions via PageBlockDisplayVariant::buildRegions. |
| 47 | 47 | $build = parent::buildRegions($build); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | continue; |
| 53 | 53 | } |
| 54 | 54 | $region_name = Html::getClass("block-region-$region"); |
| 55 | - $build[$region]['#prefix'] = '<div class="' . $region_name . ' row">'; |
|
| 55 | + $build[$region]['#prefix'] = '<div class="'.$region_name.' row">'; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | // Add suffix for wrapper after buildRegions. |
@@ -134,8 +134,7 @@ discard block |
||
| 134 | 134 | if (isset($options['langcode']) && $node->hasTranslation($options['langcode'])) { |
| 135 | 135 | $url_options['language'] = \Drupal::languageManager()->getLanguage($options['langcode']); |
| 136 | 136 | $langcode = $options['langcode']; |
| 137 | - } |
|
| 138 | - else { |
|
| 137 | + } else { |
|
| 139 | 138 | $langcode = NULL; |
| 140 | 139 | } |
| 141 | 140 | |
@@ -161,8 +160,7 @@ discard block |
||
| 161 | 160 | $replacements[$original] = Url::fromRoute('entity.node.latest_version', [ |
| 162 | 161 | 'node' => $node->id(), |
| 163 | 162 | ], $url_options)->toString(); |
| 164 | - } |
|
| 165 | - else { |
|
| 163 | + } else { |
|
| 166 | 164 | $replacements[$original] = $latest->toUrl('canonical', $url_options)->toString(); |
| 167 | 165 | } |
| 168 | 166 | break; |
@@ -56,12 +56,12 @@ |
||
| 56 | 56 | $build = array(); |
| 57 | 57 | global $base_url; |
| 58 | 58 | header('Content-Type: application/json'); |
| 59 | - $json_output = (string) $this->httpClient->get($base_url . '/api/node/article')->getBody(); |
|
| 59 | + $json_output = (string) $this->httpClient->get($base_url.'/api/node/article')->getBody(); |
|
| 60 | 60 | $json_pretty = json_encode(json_decode($json_output), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); |
| 61 | 61 | $json_indented_by_2 = preg_replace('/^( +?)\\1(?=[^ ])/m', '$1', $json_pretty); |
| 62 | 62 | $build['article_node_endpoint_block']['#markup'] = '<a class="btn btn-primary coh-style-link-button open-apiModal" href="#open">Expand API Response</a> |
| 63 | - <div class="apiResponse"><pre><code class="language-json">' . $json_indented_by_2 . '</code></pre></div> |
|
| 64 | - <div class="apiResponseModal"><pre><code class="language-json">' . $json_indented_by_2 . '</code></pre></div>'; |
|
| 63 | + <div class="apiResponse"><pre><code class="language-json">' . $json_indented_by_2.'</code></pre></div> |
|
| 64 | + <div class="apiResponseModal"><pre><code class="language-json">' . $json_indented_by_2.'</code></pre></div>'; |
|
| 65 | 65 | $build['article_node_endpoint_block']['#attached']['library'][] = 'df_tools_articles/main'; |
| 66 | 66 | return $build; |
| 67 | 67 | } |
@@ -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 | } |
@@ -97,8 +97,7 @@ discard block |
||
| 97 | 97 | ->getViewModes($entity->getEntityTypeId())); |
| 98 | 98 | if (in_array($view_mode_id, $entity_view_mode_ids)) { |
| 99 | 99 | $output = $entity->$field_name->view($view_mode_id); |
| 100 | - } |
|
| 101 | - else { |
|
| 100 | + } else { |
|
| 102 | 101 | // Each part of a custom (non-Entity Display) view mode ID is separated |
| 103 | 102 | // by a dash; the first part must be the module name. |
| 104 | 103 | $mode_id_parts = explode('-', $view_mode_id, 2); |
@@ -115,8 +114,7 @@ discard block |
||
| 115 | 114 | 'html' => $this->renderer->renderRoot($output), |
| 116 | 115 | ]; |
| 117 | 116 | return new JsonResponse($data); |
| 118 | - } |
|
| 119 | - else { |
|
| 117 | + } else { |
|
| 120 | 118 | return new JsonResponse(['main_error' => $this->t('File does not exist.')]); |
| 121 | 119 | } |
| 122 | 120 | } |
@@ -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); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | $path = \Drupal::service('path.current')->getPath(); |
| 131 | 131 | $language = $variables['language']->getId(); |
| 132 | 132 | $alias = \Drupal::service('path_alias.manager')->getAliasByPath($path, $language); |
| 133 | - $url = Url::fromUri('internal:/' . $alias); |
|
| 133 | + $url = Url::fromUri('internal:/'.$alias); |
|
| 134 | 134 | $name = t($variables['language']->getName()); |
| 135 | 135 | $link = Link::fromTextAndUrl($name, $url)->toString(); |
| 136 | 136 | $variables['language_current_link'] = $link; |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | if ($langcode == 'en') { |
| 159 | 159 | $langcode = ''; |
| 160 | 160 | } |
| 161 | - $url = Url::fromUri('base:/' . $langcode . $alias); |
|
| 161 | + $url = Url::fromUri('base:/'.$langcode.$alias); |
|
| 162 | 162 | $current_name = t($language->getName()); |
| 163 | 163 | $links[] = Link::fromTextAndUrl($current_name, $url)->toString(); |
| 164 | 164 | } |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | if ($phase == 'runtime') { |
| 57 | 57 | $requirements['df_version'] = [ |
| 58 | 58 | 'title' => t("Demo Framework"), |
| 59 | - 'value' => t( "4.1.0+dev"), |
|
| 59 | + 'value' => t("4.1.0+dev"), |
|
| 60 | 60 | 'description' => 'Last Update: 2020-11-19', |
| 61 | 61 | 'severity' => REQUIREMENT_INFO, |
| 62 | 62 | ]; |