Skip to content

Commit

Permalink
Improve code style
Browse files Browse the repository at this point in the history
  • Loading branch information
jkphl committed Sep 4, 2022
1 parent d11e6b0 commit e4b2c5a
Show file tree
Hide file tree
Showing 18 changed files with 297 additions and 206 deletions.
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
; top-most EditorConfig file
root = true

; Unix-style newlines
[*]
end_of_line = LF
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4

[{*.yml, *.yaml}]
indent_size = 2

[*.md]
trim_trailing_whitespace = false

[*.adoc]
trim_trailing_whitespace = false
62 changes: 62 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Path-based git attributes
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
# Auto detect text files and perform LF normalization
* text eol=lf

# (binary is a macro for -text -diff)
*.br binary
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.gz binary
*.ico binary
*.mov binary
*.mp4 binary
*.mp3 binary
*.flv binary
*.fla binary
*.swf binary
*.gz binary
*.zip binary
*.7z binary
*.ttf binary
*.otf binary
*.eot binary
*.woff binary
*.woff2 binary
*.pyc binary
*.pdf binary

# Ignore hidden files & directories
/.editorconfig export-ignore
/.env export-ignore
/.env.example export-ignore
/.eslintrc export-ignore
/.eslintignore export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.gitlab-ci.yml export-ignore
/.gitmodules export-ignore
/.idea export-ignore
/.stylelintignore export-ignore
/.stylelintrc.json export-ignore

# Ignore directories
/.githooks export-ignore
/dev export-ignore
/gulp-tasks export-ignore
/node_modules export-ignore
/vendor export-ignore

# Ignore files
/docker-compose.yml export-ignore
/fractal.config.js export-ignore
/gulpfile.js export-ignore
/package.json export-ignore
/package-lock.json export-ignore
/phpcs.xml export-ignore
/phpmd.xml export-ignore
/phpunit.php export-ignore
/phpunit.xml export-ignore
/README.adoc export-ignore
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
12 changes: 6 additions & 6 deletions Classes/Domain/Model/FormElements/Geoselect.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,16 @@ public function initializeFormElement()

// Include google maps javascript if enabled.
if (!empty($settings['googleMaps']['includeJs']) && !empty($settings['googleMaps']['apiKey'])) {
$googleMapsParameters = [
$googleMapsParameters = [
'key' => $settings['googleMaps']['apiKey'],
'language' => $GLOBALS['TYPO3_REQUEST']->getAttribute('language')->getTwoLetterIsoCode(),
];
$GLOBALS['TSFE']->additionalFooterData['tx_twgeo_google_maps_js'] = '<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places&'.http_build_query($googleMapsParameters).'"></script>';
$GLOBALS['TSFE']->additionalFooterData['tx_twgeo_google_maps_js'] = '<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places&' . http_build_query($googleMapsParameters) . '"></script>';
$GLOBALS['TSFE']->additionalFooterData['tx_twgeo_google_geoselect_js'] = '<script src="/typo3conf/ext/tw_geo/Resources/Public/tw_geo-default.min.js"></script>';
}
$this->setProperty(
'mapMarker',
GeneralUtility::getIndpEnv('TYPO3_SITE_URL').$settings['googleMaps']['mapMarker']
GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . $settings['googleMaps']['mapMarker']
);
$this->setProperty(
'mapCenter',
Expand All @@ -186,7 +186,7 @@ public function initializeFormElement()


// Add search field
$this->searchField = $this->createElement($this->identifier.'-search', 'Text');
$this->searchField = $this->createElement($this->identifier . '-search', 'Text');
// $this->searchField->setLabel(
// LocalizationUtility::translate(
// 'LLL:EXT:tw_geo/Resources/Private/Language/locallang_forms.xlf:geoselect.search.label',
Expand All @@ -195,10 +195,10 @@ public function initializeFormElement()
// );

// Add hidden latitude;longitude field
$this->latLonField = $this->createElement($this->identifier.'-lat-lon', 'Hidden');
$this->latLonField = $this->createElement($this->identifier . '-lat-lon', 'Hidden');

// Add position field for selection found positions based on the search result. Only used in non-js version.
$this->positionField = $this->createElement($this->identifier.'-position', 'SingleSelect');
$this->positionField = $this->createElement($this->identifier . '-position', 'SingleSelect');
$this->positionField->setLabel(
LocalizationUtility::translate(
'LLL:EXT:tw_geo/Resources/Private/Language/locallang_forms.xlf:geoselect.positions.label',
Expand Down
16 changes: 8 additions & 8 deletions Classes/Domain/Model/FormElements/StaticMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ class StaticMap extends GenericFormElement
* @var array
*/
protected $properties = [
'latitude' => 0,
'latitude' => 0,
'longitude' => 0,
'zoom' => 10,
'apiKey' => '',
'size' => '640x320',
'scale' => 2,
'maptype' => 'roadmap',
'zoom' => 10,
'apiKey' => '',
'size' => '640x320',
'scale' => 2,
'maptype' => 'roadmap',
];

/**
Expand All @@ -75,8 +75,8 @@ class StaticMap extends GenericFormElement
public function initializeFormElement()
{
// Get typoscript settings for tw_geo
$settings = GeneralUtility::makeInstance(ConfigurationManager::class)
->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
$settings = GeneralUtility::makeInstance(ConfigurationManager::class)
->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
$googleMapsSettings = $settings['plugin.']['tx_twgeo.']['settings.']['googleMaps.'];
$this->setProperty('apiKey', $googleMapsSettings['apiKey']);
}
Expand Down
Loading

0 comments on commit e4b2c5a

Please sign in to comment.