-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
15 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
/** | ||
* This file is part of MetaModels/core. | ||
* | ||
* (c) 2012-2023 The MetaModels team. | ||
* (c) 2012-2024 The MetaModels team. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
@@ -14,7 +14,7 @@ | |
* @author Christian Schiffler <[email protected]> | ||
* @author Sven Baumann <[email protected]> | ||
* @author Ingolf Steinhardt <[email protected]> | ||
* @copyright 2012-2023 The MetaModels team. | ||
* @copyright 2012-2024 The MetaModels team. | ||
* @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later | ||
* @filesource | ||
*/ | ||
|
@@ -42,17 +42,17 @@ class JumpToListener extends AbstractAbstainingListener | |
private const DEFAULT_TYPE = UrlGeneratorInterface::ABSOLUTE_PATH; | ||
|
||
private const TYPE_MAP = [ | ||
'absolute_url' => UrlGeneratorInterface::ABSOLUTE_URL, | ||
'absolute_url' => UrlGeneratorInterface::ABSOLUTE_URL, | ||
'absolute_path' => UrlGeneratorInterface::ABSOLUTE_PATH, | ||
'relative_path' => UrlGeneratorInterface::RELATIVE_PATH, | ||
'network_path' => UrlGeneratorInterface::NETWORK_PATH, | ||
'network_path' => UrlGeneratorInterface::NETWORK_PATH, | ||
]; | ||
|
||
private const TYPE_MAP_INVERSE = [ | ||
UrlGeneratorInterface::ABSOLUTE_URL => 'absolute_url', | ||
UrlGeneratorInterface::ABSOLUTE_URL => 'absolute_url', | ||
UrlGeneratorInterface::ABSOLUTE_PATH => 'absolute_path', | ||
UrlGeneratorInterface::RELATIVE_PATH => 'relative_path', | ||
UrlGeneratorInterface::NETWORK_PATH => 'network_path', | ||
UrlGeneratorInterface::NETWORK_PATH => 'network_path', | ||
]; | ||
|
||
/** | ||
|
@@ -168,7 +168,7 @@ public function encodeValue(EncodePropertyValueFromWidgetEvent $event) | |
|
||
foreach ($value as $k => $v) { | ||
$value[$k]['value'] = \str_replace(['{{link_url::', '}}'], ['', ''], $v['value']); | ||
$value[$k]['type'] = self::TYPE_MAP[$v['type']] ?? self::DEFAULT_TYPE; | ||
$value[$k]['type'] = self::TYPE_MAP[$v['type']] ?? self::DEFAULT_TYPE; | ||
} | ||
|
||
$event->setValue(\serialize($value)); | ||
|
@@ -208,7 +208,7 @@ public function buildWidget(BuildWidgetEvent $event) | |
foreach ((array) $metaModel->getAvailableLanguages() as $strLangCode) { | ||
$arrLanguages[$strLangCode] = $this->translator | ||
->trans('LNG.' . $strLangCode, [], 'contao_languages'); | ||
$rowClasses[] = ($strLangCode === $fallback) ? 'fallback_language' : 'normal_language'; | ||
$rowClasses[] = ($strLangCode === $fallback) ? 'fallback_language' : 'normal_language'; | ||
} | ||
|
||
$extra['minCount'] = \count($arrLanguages); | ||
|
@@ -221,16 +221,11 @@ public function buildWidget(BuildWidgetEvent $event) | |
$extra['maxCount'] = 1; | ||
|
||
$extra['columnFields']['langcode']['options'] = [ | ||
'xx' => $this->translator | ||
->trans( | ||
'jumpTo_allLanguages', | ||
[], | ||
'tl_metamodel_rendersettings' | ||
) | ||
'xx' => $this->translator->trans('jumpTo_allLanguages', [], 'tl_metamodel_rendersettings') | ||
]; | ||
} | ||
|
||
$extra['columnFields']['type']['options'] = $this->getUrlTypes(); | ||
$extra['columnFields']['type']['options'] = $this->getUrlTypes(); | ||
$extra['columnFields']['filter']['options'] = $this->getFilterSettings($model); | ||
|
||
$event->getProperty()->setExtra($extra); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters