16 | * @copyright 2012-2019 The MetaModels team.
17 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
18 | * @filesource
19 | */
20 |
21 | namespace MetaModels\Attribute;
22 |
23 | /**
24 | * Base implementation for "complex" MetaModel attributes.
25 | * Complex fields are fields that can not be fetched with a simple "SELECT colName FROM cat_table" and therefore need
26 | * to be handled differently.
27 | */
28 | abstract class BaseComplex extends Base implements IComplex
29 | {
30 | }
31 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/contao/templates/metamodel_unrendered.text:
--------------------------------------------------------------------------------
1 | get('translator');
3 |
4 | $hideLabels = $this->view->get('hideLabels');
5 |
6 | if ($this->items->getCount()) {
7 | foreach ($this->items->parseAll('text', $this->view) as $item) {
8 | foreach ($item['attributes'] as $field => $attribute) {
9 | if ((isset($item['text'][$field]) && ($value = $item['text'][$field]))) {
10 | if (!$hideLabels) {
11 | echo \trim($translator->trans('field_label', ['%field_label%' => $attribute->getName()], 'metamodels_list')) . ' ';
12 | }
13 | echo $value . PHP_EOL;
14 | }
15 | }
16 |
17 | foreach ($item['actions'] as $action) {
18 | echo \sprintf(
19 | '%s: %s%s',
20 | $action['label'],
21 | $action['href'],
22 | PHP_EOL
23 | );
24 | }
25 | }
26 | } else {
27 | echo $this->noItemsMsg;
28 | }
29 |
--------------------------------------------------------------------------------
/src/Schema/SchemaInformationInterface.php:
--------------------------------------------------------------------------------
1 |
15 | * @copyright 2012-2019 The MetaModels team.
16 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
17 | * @filesource
18 | */
19 |
20 | declare(strict_types=1);
21 |
22 | namespace MetaModels\Schema;
23 |
24 | /**
25 | * This interface describes a MetaModels schema information for a particular engine.
26 | */
27 | interface SchemaInformationInterface
28 | {
29 | /**
30 | * Obtain the name of the schema information.
31 | *
32 | * @return string
33 | */
34 | public function getName(): string;
35 | }
36 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/translations/metamodels_list.en.xlf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Sorting
7 |
8 |
9 | Random
10 |
11 |
12 | Id
13 |
14 |
15 | %field_label%:
16 |
17 |
18 | There are no items matching your search.
19 |
20 |
21 | Details
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/CoreBundle/FileUsage/MetaModelsSingleResult.php:
--------------------------------------------------------------------------------
1 | tableName;
22 | }
23 |
24 | public function getAttributeName(): string
25 | {
26 | return $this->attributeName;
27 | }
28 |
29 | public function getItemId(): string
30 | {
31 | return $this->itemId;
32 | }
33 |
34 | public function getEditUrl(): string
35 | {
36 | return $this->editUrl;
37 | }
38 |
39 | public function getTemplate(): string
40 | {
41 | return '@MetaModelsCore/FileUsage/file_usage_single_result.html.twig';
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/CoreBundle/FileUsage/MetaModelsMultipleResult.php:
--------------------------------------------------------------------------------
1 | tableName;
22 | }
23 |
24 | public function getAttributeName(): string
25 | {
26 | return $this->attributeName;
27 | }
28 |
29 | public function getItemId(): string
30 | {
31 | return $this->itemId;
32 | }
33 |
34 | public function getEditUrl(): string
35 | {
36 | return $this->editUrl;
37 | }
38 |
39 | public function getTemplate(): string
40 | {
41 | return '@MetaModelsCore/FileUsage/file_usage_multiple_result.html.twig';
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/contao/languages/et/tl_metamodel_dca_combine.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | "%metaModelName%" in attribute "%attribute%"
7 |
8 |
9 | "%metaModelName%" in attribute "%attribute%" in language "%language%"
10 |
11 |
12 | Edit "%metaModelName%" dataset with id %id%
13 |
14 |
15 | Edit "%metaModelName%" dataset with id %id% in language %language%
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/contao/languages/da/tl_metamodel_filtersetting.php:
--------------------------------------------------------------------------------
1 |
5 | |
6 | MetaModels
7 | |
8 |
9 | -
10 | |
11 |
12 | {{ 'single_usage'|trans({'%metaModelName%': metaModelName, '%attribute%': attributeName}) }}
13 | |
14 |
15 | ID {{ result.itemId }}
16 | |
17 |
18 | {% if result.editUrl|default %}
19 |
20 |
21 |
22 | {% endif %}
23 | |
24 |
25 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/contao/languages/el/default.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Sorting
6 |
7 |
8 | Random
9 |
10 |
11 | Id
12 |
13 |
14 | %field_label%:
15 |
16 |
17 | There are no items matching your search.
18 | Aucun article ne correspond à votre recherche.
19 |
20 |
21 | Details
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/views/FileUsage/file_usage_single_result.html.twig:
--------------------------------------------------------------------------------
1 | {% trans_default_domain 'metamodels_file_usage' %}
2 | {% set metaModelName = 'name'|trans(domain: result.tableName) %}
3 | {% set attributeName = (result.attributeName ~ '.label')|trans(domain: result.tableName) %}
4 | {% set translationParameters = {'%metaModelName%': metaModelName, '%attribute%': attributeName, '%id%': result.itemId} %}
5 |
6 | |
7 | MetaModels
8 | |
9 |
10 | -
11 | |
12 |
13 | {{ 'single_usage'|trans(translationParameters) }}
14 | |
15 |
16 | ID {{ result.itemId }}
17 | |
18 |
19 | {% if result.editUrl|default %}
20 |
21 |
22 |
23 | {% endif %}
24 | |
25 |
26 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/contao/languages/et/modules.php:
--------------------------------------------------------------------------------
1 |
15 | * @copyright 2012-2019 The MetaModels team.
16 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
17 | * @filesource
18 | */
19 |
20 | namespace MetaModels\CoreBundle\DcGeneral;
21 |
22 | /**
23 | * This interface describes a property condition factory that may contain children.
24 | *
25 | * @SuppressWarnings(PHPMD.LongClassName)
26 | */
27 | interface NestablePropertyConditionFactoryInterface extends PropertyConditionFactoryInterface
28 | {
29 | /**
30 | * Get the amount of children this type supports - for unlimited, return -1.
31 | *
32 | * @return int
33 | */
34 | public function maxChildren();
35 | }
36 |
--------------------------------------------------------------------------------
/src/Filter/Setting/IWithChildren.php:
--------------------------------------------------------------------------------
1 |
15 | * @author Sven Baumann
16 | * @copyright 2012-2019 The MetaModels team.
17 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
18 | * @filesource
19 | */
20 |
21 | namespace MetaModels\Filter\Setting;
22 |
23 | /**
24 | * This interface handles filter setting abstraction for settings that can contain children.
25 | */
26 | interface IWithChildren extends ISimple
27 | {
28 | /**
29 | * Adds a child setting to this setting.
30 | *
31 | * @param ISimple $objFilterSetting The setting that shall be added as child.
32 | *
33 | * @return void
34 | */
35 | public function addChild(ISimple $objFilterSetting);
36 | }
37 |
--------------------------------------------------------------------------------
/src/Schema/Doctrine/SchemaProcessorInterface.php:
--------------------------------------------------------------------------------
1 |
15 | * @copyright 2012-2019 The MetaModels team.
16 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
17 | * @filesource
18 | */
19 |
20 | declare(strict_types=1);
21 |
22 | namespace MetaModels\Schema\Doctrine;
23 |
24 | /**
25 | * This interface describes a schema processor for pre/post processing.
26 | */
27 | interface SchemaProcessorInterface
28 | {
29 | /**
30 | * Perform the action.
31 | *
32 | * @return void
33 | */
34 | public function process(): void;
35 |
36 | /**
37 | * Get a string representation of the task performed.
38 | *
39 | * @return string
40 | */
41 | public function __toString();
42 | }
43 |
--------------------------------------------------------------------------------
/src/CoreBundle/DcGeneral/OrPropertyConditionFactory.php:
--------------------------------------------------------------------------------
1 |
15 | * @copyright 2012-2019 The MetaModels team.
16 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
17 | * @filesource
18 | */
19 |
20 | namespace MetaModels\CoreBundle\DcGeneral;
21 |
22 | use ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Condition\Property\PropertyConditionChain;
23 |
24 | /**
25 | * This factory creates OR property conditions.
26 | */
27 | class OrPropertyConditionFactory extends AbstractPropertyConditionChainFactory
28 | {
29 | /**
30 | * {@inheritDoc}
31 | */
32 | protected function createCondition(array $children)
33 | {
34 | return new PropertyConditionChain($children, PropertyConditionChain::OR_CONJUNCTION);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/CoreBundle/DcGeneral/AndPropertyConditionFactory.php:
--------------------------------------------------------------------------------
1 |
15 | * @copyright 2012-2019 The MetaModels team.
16 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
17 | * @filesource
18 | */
19 |
20 | namespace MetaModels\CoreBundle\DcGeneral;
21 |
22 | use ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Condition\Property\PropertyConditionChain;
23 |
24 | /**
25 | * This factory creates AND property conditions.
26 | */
27 | class AndPropertyConditionFactory extends AbstractPropertyConditionChainFactory
28 | {
29 | /**
30 | * {@inheritDoc}
31 | */
32 | protected function createCondition(array $children)
33 | {
34 | return new PropertyConditionChain($children, PropertyConditionChain::AND_CONJUNCTION);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/CoreBundle/DcGeneral/AttributeAwarePropertyConditionFactoryInterface.php:
--------------------------------------------------------------------------------
1 |
15 | * @copyright 2012-2019 The MetaModels team.
16 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
17 | * @filesource
18 | */
19 |
20 | namespace MetaModels\CoreBundle\DcGeneral;
21 |
22 | /**
23 | * This interface describes a property condition factory that uses an attribute.
24 | *
25 | * @SuppressWarnings(PHPMD.LongClassName)
26 | */
27 | interface AttributeAwarePropertyConditionFactoryInterface extends PropertyConditionFactoryInterface
28 | {
29 | /**
30 | * Test if an attribute type is supported.
31 | *
32 | * @param string $attribute The attribute type name.
33 | *
34 | * @return bool
35 | */
36 | public function supportsAttribute($attribute);
37 | }
38 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/contao/languages/de/tl_form_field.php:
--------------------------------------------------------------------------------
1 | tableName;
23 | }
24 |
25 | public function getAttributeName(): string
26 | {
27 | return $this->attributeName;
28 | }
29 |
30 | public function getItemId(): string
31 | {
32 | return $this->itemId;
33 | }
34 |
35 | public function getLanguage(): string
36 | {
37 | return $this->language;
38 | }
39 |
40 | public function getEditUrl(): string
41 | {
42 | return $this->editUrl;
43 | }
44 |
45 | public function getTemplate(): string
46 | {
47 | return '@MetaModelsCore/FileUsage/file_usage_translated_single_result.html.twig';
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/contao/languages/da/default.php:
--------------------------------------------------------------------------------
1 | tableName;
23 | }
24 |
25 | public function getAttributeName(): string
26 | {
27 | return $this->attributeName;
28 | }
29 |
30 | public function getItemId(): string
31 | {
32 | return $this->itemId;
33 | }
34 |
35 | public function getLanguage(): string
36 | {
37 | return $this->language;
38 | }
39 |
40 | public function getEditUrl(): string
41 | {
42 | return $this->editUrl;
43 | }
44 |
45 | public function getTemplate(): string
46 | {
47 | return '@MetaModelsCore/FileUsage/file_usage_translated_multiple_result.html.twig';
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/contao/templates/mm_filteritem_linklist.html5:
--------------------------------------------------------------------------------
1 | extend('mm_filteritem_default'); ?>
2 | block('formlabel'); ?>
3 | hide_label): ?>
4 | = $this->label ?>
5 |
6 | endblock(); ?>
7 | block('formfield'); ?>
8 | options) && count($this->options)): ?>
9 |
10 | options) - 1;
13 | $urlFragment = $this->urlfragment ? '#' . $this->urlfragment : '';
14 | foreach ($this->options as $option):
15 | $class = (!$index) ? 'first ' : '';
16 | $class .= ($index == $last) ? 'last ' : '';
17 | $class .= ($index++ % 2) ? 'even' : 'odd';
18 | $class .= (strlen($option['class'])) ? ' ' . $option['class'] : '';
19 | ?>
20 | -
21 | = $option['value'] ?>
24 |
25 |
26 |
27 |
28 | endblock(); ?>
29 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/contao/languages/it/default.php:
--------------------------------------------------------------------------------
1 |
15 | * @author Sven Baumann
16 | * @author Ingolf Steinhardt
17 | * @copyright 2012-2024 The MetaModels team.
18 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
19 | * @filesource
20 | */
21 |
22 | namespace MetaModels\Filter;
23 |
24 | /**
25 | * This is the MetaModel filter interface.
26 | */
27 | interface IFilterRule
28 | {
29 | /**
30 | * Fetch the ids for all matches for this filter rule.
31 | *
32 | * If no entries have been found, the result is an empty array.
33 | * If no filtering was applied and therefore all ids shall be reported as valid, the return value of NULL is
34 | * allowed.
35 | *
36 | * @return list|null
37 | */
38 | public function getMatchingIds();
39 | }
40 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/contao/languages/sk/modules.php:
--------------------------------------------------------------------------------
1 |
7 |
8 | MetaModels
9 | |
10 |
11 | -
12 | |
13 |
14 | {{ 'single_usage_translated'|trans(translationParameters) }}
15 | |
16 |
17 | ID {{ result.itemId }}
18 | |
19 |
20 | {% if result.editUrl|default %}
21 |
22 |
23 |
24 | {% endif %}
25 | |
26 |
27 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/translations/metamodels_filter.en.xlf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Filter value for attribute "%id%"
7 |
8 |
9 |
10 |
11 |
12 | Filter
13 |
14 |
15 | No filtering
16 |
17 |
18 | Select all
19 |
20 |
21 | Clear all filter
22 |
23 |
24 | (No matching combinations found.)
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/views/FileUsage/file_usage_translated_multiple_result.html.twig:
--------------------------------------------------------------------------------
1 | {% trans_default_domain 'metamodels_file_usage' %}
2 | {% set metaModelName = 'name'|trans(domain: result.tableName) %}
3 | {% set attributeName = (result.attributeName ~ '.label')|trans(domain: result.tableName) %}
4 | {% set language = result.language|language_name %}
5 | {% set translationParameters = {'%metaModelName%': metaModelName, '%attribute%': attributeName, '%id%': result.itemId, '%language%': language} %}
6 |
7 | |
8 | MetaModels
9 | |
10 |
11 | -
12 | |
13 |
14 | {{ 'single_usage_translated'|trans(translationParameters) }}
15 | |
16 |
17 | ID {{ result.itemId }}
18 | |
19 |
20 | {% if result.editUrl|default %}
21 |
22 |
23 |
24 | {% endif %}
25 | |
26 |
27 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/contao/templates/mm_filter_default.html5:
--------------------------------------------------------------------------------
1 |
2 | cssID ?>style): ?> style="= $this->style ?>">
3 | headline): ?>
4 | <= $this->hl ?>>= $this->headline ?>= $this->hl ?>>
5 |
6 |
7 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/contao/languages/rm/default.php:
--------------------------------------------------------------------------------
1 |
15 | * @copyright 2012-2019 The MetaModels team.
16 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
17 | * @filesource
18 | */
19 |
20 | declare(strict_types=1);
21 |
22 | namespace MetaModels\Schema;
23 |
24 | use MetaModels\Information\MetaModelCollectionInterface;
25 |
26 | /**
27 | * This interface describes a generic schema generator.
28 | */
29 | interface SchemaGeneratorInterface
30 | {
31 | /**
32 | * Generate the schema information.
33 | *
34 | * @param SchemaInformation $information The schema information.
35 | * @param MetaModelCollectionInterface $collection The collection of MetaModels.
36 | *
37 | * @return void
38 | */
39 | public function generate(SchemaInformation $information, MetaModelCollectionInterface $collection): void;
40 | }
41 |
--------------------------------------------------------------------------------
/src/Schema/Doctrine/DoctrineSchemaGeneratorInterface.php:
--------------------------------------------------------------------------------
1 |
15 | * @copyright 2012-2019 The MetaModels team.
16 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
17 | * @filesource
18 | */
19 |
20 | declare(strict_types=1);
21 |
22 | namespace MetaModels\Schema\Doctrine;
23 |
24 | use MetaModels\Information\MetaModelCollectionInterface;
25 |
26 | /**
27 | * This interface describes a schema provider.
28 | */
29 | interface DoctrineSchemaGeneratorInterface
30 | {
31 | /**
32 | * Generate a schema.
33 | *
34 | * @param DoctrineSchemaInformation $schema The doctrine schema to populate.
35 | * @param MetaModelCollectionInterface $collection The collection of MetaModels.
36 | *
37 | * @return void
38 | */
39 | public function generate(DoctrineSchemaInformation $schema, MetaModelCollectionInterface $collection): void;
40 | }
41 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/translations/metamodels_list.de.xlf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Sorting
6 | Sortierung
7 |
8 |
9 | Random
10 | Zufällig
11 |
12 |
13 | Id
14 | ID
15 |
16 |
17 | %field_label%:
18 | %field_label%:
19 |
20 |
21 | There are no items matching your search.
22 | Es gibt keine Einträge, die Ihrer Suche entsprechen.
23 |
24 |
25 | Details
26 | Details
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/contao/languages/ru/tl_maintenance.php:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 | PHPMD rule set
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/src/CoreBundle/DcGeneral/PropertyConditionFactoryInterface.php:
--------------------------------------------------------------------------------
1 |
15 | * @copyright 2012-2019 The MetaModels team.
16 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
17 | * @filesource
18 | */
19 |
20 | namespace MetaModels\CoreBundle\DcGeneral;
21 |
22 | use ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Condition\Property\PropertyConditionInterface;
23 | use MetaModels\IMetaModel;
24 |
25 | /**
26 | * This interface describes a property condition factory.
27 | */
28 | interface PropertyConditionFactoryInterface
29 | {
30 | /**
31 | * Create a property condition.
32 | *
33 | * @param array $configuration The configuration.
34 | * @param IMetaModel $metaModel The MetaModel the condition relates to.
35 | *
36 | * @return PropertyConditionInterface
37 | */
38 | public function buildCondition(array $configuration, IMetaModel $metaModel);
39 | }
40 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/contao/dca/tl_user_group.php:
--------------------------------------------------------------------------------
1 |
15 | * @copyright 2012-2019 The MetaModels team.
16 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
17 | * @filesource
18 | */
19 |
20 | use ContaoCommunityAlliance\DcGeneral\Contao\Callback\Callbacks;
21 |
22 | $prefCallback = $GLOBALS['TL_DCA']['tl_user_group']['fields']['alexf']['options_callback'] ?? null;
23 | // Filter all MetaModels tables from user group permissions - only Admins MUST edit MetaModels.
24 | $GLOBALS['TL_DCA']['tl_user_group']['fields']['alexf']['options_callback'] =
25 | static function () use ($prefCallback): array {
26 | $options = (null === $prefCallback) ? [] : Callbacks::call($prefCallback);
27 | foreach (\array_keys($options) as $tableName) {
28 | if (str_starts_with($tableName, 'tl_metamodel')) {
29 | unset($options[$tableName]);
30 | }
31 | }
32 |
33 | return $options;
34 | };
35 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/config/routing.yml:
--------------------------------------------------------------------------------
1 | metamodels.inputscreen.add_all:
2 | path: /%contao.backend.route_prefix%/metamodels/inputscreen/add-all/{metaModel}/{inputScreen}
3 | defaults: { _controller: metamodels.controller.inputscreen.add_all, _scope: backend, _dcg_referer_update: true, _token_check: true }
4 |
5 | metamodels.support_screen:
6 | path: /%contao.backend.route_prefix%/metamodels/support
7 | defaults: { _controller: metamodels.controller.support_screen, _scope: backend, _token_check: true }
8 |
9 | metamodels.rendersetting.add_all:
10 | path: /%contao.backend.route_prefix%/metamodels/rendersetting/add-all/{metaModel}/{renderSetting}
11 | defaults: { _controller: metamodels.controller.rendersetting.add_all, _scope: backend, _dcg_referer_update: true, _token_check: true }
12 |
13 | metamodels.configuration:
14 | path: /%contao.backend.route_prefix%/metamodels/{tableName}
15 | defaults:
16 | _controller: MetaModels\CoreBundle\Controller\Backend\ConfigurationController
17 | _scope: backend
18 | _dcg_referer_update: true
19 | _token_check: true
20 | tableName: ~
21 |
22 | metamodels.metamodel:
23 | path: /%contao.backend.route_prefix%/metamodel/{tableName}
24 | defaults:
25 | _controller: MetaModels\CoreBundle\Controller\Backend\MetaModelController
26 | _scope: backend
27 | _dcg_referer_update: true
28 | _token_check: true
29 |
--------------------------------------------------------------------------------
/src/CoreBundle/Formatter/SelectAttributeOptionLabelFormatter.php:
--------------------------------------------------------------------------------
1 |
15 | * @copyright 2012-2020 The MetaModels team.
16 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
17 | * @filesource
18 | */
19 |
20 | namespace MetaModels\CoreBundle\Formatter;
21 |
22 | use MetaModels\Attribute\IAttribute;
23 |
24 | /**
25 | * This formats the label for use in the backend as select options in attribute selection lists.
26 | */
27 | final class SelectAttributeOptionLabelFormatter
28 | {
29 | /**
30 | * Format the label.
31 | *
32 | * @param IAttribute $attribute The attribute.
33 | *
34 | * @return string
35 | */
36 | public function formatLabel(IAttribute $attribute): string
37 | {
38 | return \sprintf(
39 | '%1$s [%2$s, "%3$s"]',
40 | $attribute->getName(),
41 | $attribute->get('type'),
42 | $attribute->getColName()
43 | );
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/CoreBundle/Translator/LoaderInterface.php:
--------------------------------------------------------------------------------
1 |
15 | * @copyright 2012-2024 The MetaModels team.
16 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
17 | * @filesource
18 | */
19 |
20 | namespace MetaModels\CoreBundle\Translator;
21 |
22 | use MetaModels\IMetaModel;
23 | use Symfony\Component\Translation\Exception\InvalidResourceException;
24 | use Symfony\Component\Translation\Exception\NotFoundResourceException;
25 | use Symfony\Component\Translation\MessageCatalogue;
26 |
27 | interface LoaderInterface
28 | {
29 | /**
30 | * Loads a locale.
31 | *
32 | * @param IMetaModel $metaModel A MetaModel
33 | * @param string $locale A locale
34 | *
35 | * @return MessageCatalogue
36 | *
37 | * @throws NotFoundResourceException when the resource cannot be found
38 | * @throws InvalidResourceException when the resource cannot be loaded
39 | */
40 | public function load(IMetaModel $metaModel, string $locale): MessageCatalogue;
41 | }
42 |
--------------------------------------------------------------------------------
/src/Filter/Setting/IdList.php:
--------------------------------------------------------------------------------
1 |
15 | * @author Sven Baumann
16 | * @copyright 2012-2019 The MetaModels team.
17 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
18 | * @filesource
19 | */
20 |
21 | namespace MetaModels\Filter\Setting;
22 |
23 | use MetaModels\Filter\IFilter;
24 | use MetaModels\Filter\Rules\StaticIdList as FilterRuleIdList;
25 |
26 | /**
27 | * Filter setting implementation of a static list of matching ids.
28 | */
29 | class IdList extends Simple
30 | {
31 | /**
32 | * {@inheritDoc}
33 | *
34 | * @SuppressWarnings(PHPMD.UnusedFormalParameter)
35 | */
36 | public function prepareRules(IFilter $objFilter, $arrFilterUrl)
37 | {
38 | if ($this->get('items')) {
39 | $arrItems = explode(',', (string) $this->get('items'));
40 | } else {
41 | $arrItems = array();
42 | }
43 | $objFilter->addFilterRule(new FilterRuleIdList($arrItems));
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/CoreBundle/DcGeneral/PropertyVisibleConditionFactory.php:
--------------------------------------------------------------------------------
1 |
15 | * @copyright 2012-2019 The MetaModels team.
16 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
17 | * @filesource
18 | */
19 |
20 | namespace MetaModels\CoreBundle\DcGeneral;
21 |
22 | use ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Condition\Property\PropertyVisibleCondition;
23 | use MetaModels\IMetaModel;
24 |
25 | /**
26 | * This builds property visible conditions.
27 | */
28 | class PropertyVisibleConditionFactory extends AbstractAttributeConditionFactory
29 | {
30 | /**
31 | * {@inheritDoc}
32 | */
33 | public function buildCondition(array $configuration, IMetaModel $metaModel)
34 | {
35 | return new PropertyVisibleCondition($this->attributeIdToName($metaModel, $configuration['attr_id']));
36 | }
37 |
38 | /**
39 | * {@inheritDoc}
40 | */
41 | public function supportsAttribute($attribute)
42 | {
43 | return true;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/contao/languages/en/tl_maintenance.php:
--------------------------------------------------------------------------------
1 |
16 | * @author Ingolf Steinhardt
17 | * @author Sven Baumann
18 | * @copyright 2012-2024 The MetaModels team.
19 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
20 | * @filesource
21 | */
22 |
23 | $GLOBALS['TL_LANG']['tl_maintenance_jobs']['metamodels'][0] = 'MetaModels cache';
24 | $GLOBALS['TL_LANG']['tl_maintenance_jobs']['metamodels'][1] = 'Clear the MetaModels cache files (backend menu etc.).';
25 |
26 | $GLOBALS['TL_LANG']['tl_maintenance_jobs']['metamodels_assets'][0] = 'MetaModels assets';
27 | $GLOBALS['TL_LANG']['tl_maintenance_jobs']['metamodels_assets'][1] = 'Clear the MetaModels assets files (backend icons etc.).';
28 |
29 | $GLOBALS['TL_LANG']['tl_maintenance_jobs']['translator'][0] = 'Symfony translator';
30 | $GLOBALS['TL_LANG']['tl_maintenance_jobs']['translator'][1] = 'Clear the Symfony translator cache for active environment.';
31 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/contao/config/services.php:
--------------------------------------------------------------------------------
1 |
15 | * @author Sven Baumann
16 | * @author Oliver Willmes
17 | * @author Richard Henkenjohann
18 | * @author Ingolf Steinhardt
19 | * @copyright 2012-2024 The MetaModels team.
20 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
21 | * @filesource
22 | */
23 |
24 | /** @var \DependencyInjection\Container\PimpleGate $container */
25 | $service = $container->getContainer();
26 |
27 | $container->provideSymfonyService('metamodels.attribute_factory');
28 | $container->provideSymfonyService('metamodels.factory');
29 | $container->provideSymfonyService('metamodels.filter_setting_factory');
30 | $container->provideSymfonyService('metamodels.render_setting_factory');
31 | $container->provideSymfonyService('metamodels.cache');
32 | $container->provideSymfonyService('metamodels-service-container', 'MetaModels\MetaModelsServiceContainer');
33 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/translations/tl_content.en.xlf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Edit MetaModel
7 |
8 |
9 | Edit the MetaModel ID %id%.
10 |
11 |
12 | Edit render setting
13 |
14 |
15 | Edit the render setting ID %id%.
16 |
17 |
18 | Edit filter setting
19 |
20 |
21 | Edit the filter setting ID %id%.
22 |
23 |
24 | - no value [null] -
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/translations/tl_module.en.xlf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Edit MetaModel
7 |
8 |
9 | Edit the MetaModel ID %id%.
10 |
11 |
12 | Edit render setting
13 |
14 |
15 | Edit the render setting ID %id%.
16 |
17 |
18 | Edit filter setting
19 |
20 |
21 | Edit the filter setting ID %id%.
22 |
23 |
24 | - no value [null] -
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/contao/languages/et/tl_metamodel_searchable_pages.php:
--------------------------------------------------------------------------------
1 | this.classhooks[t](e,this)))},t.prototype.bindEvent=function(t){this.events.push(t),t.object.addEventListener(t.type,t.func)},t.prototype.unbindEvent=function(t,e){let o=null;if(t.object.removeEventListener(t.type,t.func),!0!==e){for(let e=0;e!(t.object&&e.object!==t.object||t.type&&t.type!==e.type))));for(var o=0;o
15 | * @author Sven Baumann
16 | * @author Ingolf Steinhardt
17 | * @copyright 2012-2024 The MetaModels team.
18 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
19 | * @filesource
20 | */
21 |
22 | namespace MetaModels\Exceptions\Database;
23 |
24 | /**
25 | * Class TableDoesNotExistException
26 | */
27 | class TableExistsException extends \RuntimeException
28 | {
29 | /**
30 | * Create a new exception for an existing table.
31 | *
32 | * @param string $tableName Table name.
33 | * @param int $code The optional Exception code.
34 | * @param \Exception $previous The optional previous throwable used for the exception chaining.
35 | *
36 | * @return self
37 | */
38 | public static function withName($tableName, $code = 0, $previous = null)
39 | {
40 | return new self(\sprintf('Table "%s" already exists.', $tableName), $code, $previous);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/CoreBundle/Contao/InsertTag/ReplaceTableName.php:
--------------------------------------------------------------------------------
1 |
15 | * @author David Maack
16 | * @author Jan Malte Gerth
17 | * @author Oliver Hoff
18 | * @author Sven Baumann
19 | * @copyright 2012-2019 The MetaModels team.
20 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
21 | * @filesource
22 | */
23 |
24 | declare(strict_types=1);
25 |
26 | namespace MetaModels\CoreBundle\Contao\InsertTag;
27 |
28 | /**
29 | * This insert tag replace the table name in the given content.
30 | */
31 | final class ReplaceTableName
32 | {
33 | /**
34 | * Replace the table name in the given content.
35 | *
36 | * @param string $tableName The table name.
37 | * @param string $content The content.
38 | *
39 | * @return string
40 | */
41 | public function replace(string $tableName, string $content): string
42 | {
43 | return \str_replace('{{table}}', $tableName, $content);
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/Exceptions/Database/TableDoesNotExistException.php:
--------------------------------------------------------------------------------
1 |
15 | * @author Sven Baumann
16 | * @author Ingolf Steinhardt
17 | * @copyright 2012-2024 The MetaModels team.
18 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
19 | * @filesource
20 | */
21 |
22 | namespace MetaModels\Exceptions\Database;
23 |
24 | /**
25 | * Class TableDoesNotExistException
26 | */
27 | class TableDoesNotExistException extends \RuntimeException
28 | {
29 | /**
30 | * Create a new exception for a non existing table.
31 | *
32 | * @param string $tableName Table name.
33 | * @param int $code The optional Exception code.
34 | * @param \Exception $previous The optional previous throwable used for the exception chaining.
35 | *
36 | * @return self
37 | */
38 | public static function withName($tableName, $code = 0, $previous = null)
39 | {
40 | return new self(\sprintf('Table "%s" does not exist.', $tableName), $code, $previous);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/CoreBundle/Contao/Hooks/FilterModuleCallback.php:
--------------------------------------------------------------------------------
1 |
15 | * @copyright 2012-2025 The MetaModels team.
16 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
17 | * @filesource
18 | */
19 |
20 | namespace MetaModels\CoreBundle\Contao\Hooks;
21 |
22 | use Contao\DC_Table;
23 |
24 | /**
25 | * This class provides callbacks for tl_module.
26 | */
27 | final class FilterModuleCallback extends AbstractContentElementAndModuleCallback
28 | {
29 | /**
30 | * The table name.
31 | *
32 | * @var string
33 | */
34 | protected static $tableName = 'tl_module';
35 |
36 | /** Called from tl_module.onload_callback. */
37 | public function buildFilterParameterList(DC_Table $dataContainer): void
38 | {
39 | if (
40 | null === ($currentRecord = $dataContainer->getCurrentRecord())
41 | || $currentRecord['type'] !== 'metamodels_frontendfilter'
42 | ) {
43 | return;
44 | }
45 |
46 | $this->buildFilterParamsFor($dataContainer, 'metamodels_frontendfilter');
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/src/CoreBundle/DcGeneral/PropertyValueConditionFactory.php:
--------------------------------------------------------------------------------
1 |
15 | * @author Stefan Heimes
16 | * @author Ingolf Steinhardt
17 | * @copyright 2012-2022 The MetaModels team.
18 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
19 | * @filesource
20 | */
21 |
22 | namespace MetaModels\CoreBundle\DcGeneral;
23 |
24 | use MetaModels\DcGeneral\DataDefinition\Palette\Condition\Property\PropertyValueCondition;
25 | use MetaModels\IMetaModel;
26 |
27 | /**
28 | * This builds a property condition.
29 | */
30 | class PropertyValueConditionFactory extends AbstractRestrictedAttributeConditionFactory
31 | {
32 | /**
33 | * {@inheritDoc}
34 | */
35 | public function buildCondition(array $configuration, IMetaModel $metaModel)
36 | {
37 | return new PropertyValueCondition(
38 | $this->attributeIdToName($metaModel, $configuration['attr_id']),
39 | $configuration['value'],
40 | false,
41 | $metaModel
42 | );
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/Exceptions/Database/InvalidTableNameException.php:
--------------------------------------------------------------------------------
1 |
15 | * @author Sven Baumann
16 | * @author Ingolf Steinhardt
17 | * @copyright 2012-2023 The MetaModels team.
18 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
19 | * @filesource
20 | */
21 |
22 | namespace MetaModels\Exceptions\Database;
23 |
24 | /**
25 | * Class InvalidTableNameException
26 | */
27 | class InvalidTableNameException extends \RuntimeException
28 | {
29 | /**
30 | * Create a new exception for a invalid table name.
31 | *
32 | * @param string $tableName Table name.
33 | * @param int $code The optional Exception code.
34 | * @param \Exception $previous The optional previous throwable used for the exception chaining.
35 | *
36 | * @return self
37 | */
38 | public static function invalidCharacters($tableName, $code = 0, $previous = null)
39 | {
40 | return new self(\sprintf('The table name "%s" is invalid.', $tableName), $code, $previous);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/Filter/IFilter.php:
--------------------------------------------------------------------------------
1 |
15 | * @author David Maack
16 | * @author Sven Baumann
17 | * @copyright 2012-2019 The MetaModels team.
18 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
19 | * @filesource
20 | */
21 |
22 | namespace MetaModels\Filter;
23 |
24 | /**
25 | * This is the MetaModel filter interface.
26 | */
27 | interface IFilter
28 | {
29 | /**
30 | * Create an copy of this filter.
31 | *
32 | * @return IFilter
33 | */
34 | public function createCopy();
35 |
36 | /**
37 | * Adds a filter rule to this filter chain.
38 | *
39 | * @param IFilterRule $objFilterRule The filter rule to add.
40 | *
41 | * @return IFilter
42 | */
43 | public function addFilterRule(IFilterRule $objFilterRule);
44 |
45 | /**
46 | * Narrow down the list of Ids that match the given filter.
47 | *
48 | * @return list|null all matching Ids or null if all ids did match.
49 | */
50 | public function getMatchingIds();
51 | }
52 |
--------------------------------------------------------------------------------
/src/InformationProvider/InformationProviderInterface.php:
--------------------------------------------------------------------------------
1 |
15 | * @author Ingolf Steinhardt
16 | * @copyright 2012-2024 The MetaModels team.
17 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
18 | * @filesource
19 | */
20 |
21 | declare(strict_types=1);
22 |
23 | namespace MetaModels\InformationProvider;
24 |
25 | use MetaModels\Information\MetaModelInformation;
26 |
27 | /**
28 | * This collects information for MetaModels.
29 | */
30 | interface InformationProviderInterface
31 | {
32 | /**
33 | * Gets the names of known MetaModels.
34 | *
35 | * @return list
36 | */
37 | public function getNames(): array;
38 |
39 | /**
40 | * Obtain the schema for a single MetaModel.
41 | *
42 | * If the provider does not know the MetaModel, it must ignore it.
43 | *
44 | * @param MetaModelInformation $information The information to which to add.
45 | *
46 | * @return void
47 | */
48 | public function getInformationFor(MetaModelInformation $information): void;
49 | }
50 |
--------------------------------------------------------------------------------
/src/CoreBundle/EventListener/SetLocaleInMetaModelListener.php:
--------------------------------------------------------------------------------
1 |
15 | * @copyright 2012-2024 The MetaModels team.
16 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
17 | * @filesource
18 | */
19 |
20 | declare(strict_types=1);
21 |
22 | namespace MetaModels\CoreBundle\EventListener;
23 |
24 | use MetaModels\Events\CreateMetaModelEvent;
25 | use MetaModels\ITranslatedMetaModel;
26 |
27 | final class SetLocaleInMetaModelListener
28 | {
29 | /** @SuppressWarnings(PHPMD.Superglobals) */
30 | public function __invoke(CreateMetaModelEvent $event): void
31 | {
32 | $metaModel = $event->getMetaModel();
33 | /** @var array $done */
34 | static $done = [];
35 |
36 | if (!($metaModel instanceof ITranslatedMetaModel) || ($done[$metaModel->getTableName()] ?? false)) {
37 | return;
38 | }
39 |
40 | if (null !== ($language = $GLOBALS['TL_LANGUAGE'] ?? null)) {
41 | $metaModel->selectLanguage($language);
42 | }
43 |
44 | $done[$metaModel->getTableName()] = true;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/InsertTag/LiteralNode.php:
--------------------------------------------------------------------------------
1 |
15 | * @copyright 2012-2023 The MetaModels team.
16 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
17 | * @filesource
18 | */
19 |
20 | declare(strict_types=1);
21 |
22 | namespace MetaModels\InsertTag;
23 |
24 | /**
25 | * This represents a string literal in an insert tag node list.
26 | */
27 | final class LiteralNode implements NodeInterface
28 | {
29 | /**
30 | * The node value.
31 | *
32 | * @var string
33 | */
34 | private string $value;
35 |
36 | /**
37 | * Create a new instance.
38 | *
39 | * @param string $value The node value.
40 | */
41 | public function __construct(string $value)
42 | {
43 | $this->value = $value;
44 | }
45 |
46 | /**
47 | * Obtrain the string value
48 | */
49 | public function getValue(): string
50 | {
51 | return $this->value;
52 | }
53 |
54 | /**
55 | * {@inheritDoc}
56 | */
57 | public function asString(): string
58 | {
59 | return $this->getValue();
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/Render/Setting/IRenderSettingFactory.php:
--------------------------------------------------------------------------------
1 |
15 | * @author Sven Baumann
16 | * @author Ingolf Steinhardt
17 | * @copyright 2012-2024 The MetaModels team.
18 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
19 | * @filesource
20 | */
21 |
22 | namespace MetaModels\Render\Setting;
23 |
24 | use MetaModels\IMetaModel;
25 | use MetaModels\IServiceContainerAware;
26 |
27 | /**
28 | * This is the filter settings factory interface.
29 | *
30 | * @see IRenderSettingFactory::createCollection() to create a render setting collection instance.
31 | */
32 | interface IRenderSettingFactory extends IServiceContainerAware
33 | {
34 | /**
35 | * Create a ICollection instance from the id.
36 | *
37 | * @param IMetaModel $metaModel The MetaModel for which to retrieve the render setting.
38 | * @param string $settingId The id of the ICollection.
39 | *
40 | * @return ICollection The instance or null if not found.
41 | */
42 | public function createCollection(IMetaModel $metaModel, $settingId = '');
43 | }
44 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/contao/languages/en/default.php:
--------------------------------------------------------------------------------
1 |
16 | * @author Ingolf Steinhardt
17 | * @author David Molineus
18 | * @author Sven Baumann
19 | * @copyright 2012-2024 The MetaModels team.
20 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
21 | * @filesource
22 | */
23 |
24 | $GLOBALS['TL_LANG']['CTE']['metamodels'] = 'MetaModels elements';
25 | $GLOBALS['TL_LANG']['CTE']['metamodel_content'][0] = 'MetaModels list';
26 | $GLOBALS['TL_LANG']['CTE']['metamodel_content'][1] =
27 | 'Adds a list of MetaModel items to the article.';
28 | $GLOBALS['TL_LANG']['CTE']['metamodels_frontendfilter'][0] = 'MetaModels frontend filter';
29 | $GLOBALS['TL_LANG']['CTE']['metamodels_frontendfilter'][1] =
30 | 'Adds a frontend filter for a MetaModel.';
31 | $GLOBALS['TL_LANG']['CTE']['metamodels_frontendclearall'][0] = 'MetaModels clear all';
32 | $GLOBALS['TL_LANG']['CTE']['metamodels_frontendclearall'][1] =
33 | 'Adds a clear all for all frontend filter.';
34 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/translations/metamodels_file_usage.de.xlf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | "%metaModelName%" in attribute "%attribute%"
6 | "%metaModelName%" im Attribut "%attribute%"
7 |
8 |
9 | "%metaModelName%" in attribute "%attribute%" in language "%language%"
10 | "%metaModelName%" im Attribut "%attribute%" in Sprache "%language%"
11 |
12 |
13 | Edit "%metaModelName%" dataset with id %id%
14 | "%metaModelName%" Datensatz mit der Id %id% bearbeiten
15 |
16 |
17 | Edit "%metaModelName%" dataset with id %id% in language %language%
18 | "%metaModelName%" Datensatz mit der Id %id% in Sprache %language% bearbeiten
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/CoreBundle/Contao/Picker/InsertTagIdTranscoder.php:
--------------------------------------------------------------------------------
1 | ::::}}',
23 | [
24 | '' => $this->metaModel,
25 | '' => $this->renderSettingId,
26 | '' => $id
27 | ]
28 | );
29 | }
30 |
31 | public function decode(string $encodedId): string
32 | {
33 | if (
34 | 1 !== preg_match(
35 | '#^{{mm::jumpTo::(?[^:]*)::(?[^:]*)::(?[^|}]*)(:?\|.*)?}}$#',
36 | $encodedId,
37 | $matches
38 | )
39 | ) {
40 | throw new InvalidArgumentException('Unparsable id value');
41 | }
42 | if ($matches['metaModel'] !== $this->metaModel || $matches['rendersettingId'] !== $this->renderSettingId) {
43 | throw new InvalidArgumentException('Not my id value');
44 | }
45 |
46 | return $matches['id'];
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/translations/tl_module.fr.xlf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Edit MetaModel
6 |
7 |
8 | Edit the MetaModel ID %id%.
9 |
10 |
11 | Edit render setting
12 |
13 |
14 | Edit the render setting ID %id%.
15 |
16 |
17 | Edit filter setting
18 | Modifier les paramètres du filtre
19 |
20 |
21 | Edit the filter setting ID %id%.
22 | Modifier les paramètres du filtre ID %id%
23 |
24 |
25 | - no value [null] -
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/translations/metamodels_filter.de.xlf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Filter value for attribute "%id%"
6 | Filterwert für Attribut "%id%"
7 |
8 |
9 |
10 |
11 |
12 | Filter
13 | Filter
14 |
15 |
16 | No filtering
17 | Nicht filtern
18 |
19 |
20 | Select all
21 | Alles auswählen
22 |
23 |
24 | Clear all filter
25 | Alle Filter zurücksetzen
26 |
27 |
28 | (No matching combinations found.)
29 | (Keine passenden Kombinationen gefunden.)
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/src/CoreBundle/EventListener/DcGeneral/EnvironmentPopulator/AssetPopulator.php:
--------------------------------------------------------------------------------
1 |
15 | * @author Sven Baumann
16 | * @author Ingolf Steinhardt
17 | * @copyright 2012-2022 The MetaModels team.
18 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
19 | * @filesource
20 | */
21 |
22 | namespace MetaModels\CoreBundle\EventListener\DcGeneral\EnvironmentPopulator;
23 |
24 | use ContaoCommunityAlliance\DcGeneral\EnvironmentInterface;
25 |
26 | /**
27 | * This class adds the style sheet.
28 | */
29 | class AssetPopulator
30 | {
31 | use MetaModelPopulatorTrait;
32 |
33 | /**
34 | * Populate the environment.
35 | *
36 | * @param EnvironmentInterface $environment The environment.
37 | *
38 | * @return void
39 | *
40 | * @SuppressWarnings(PHPMD.Superglobals)
41 | * @SuppressWarnings(PHPMD.CamelCaseVariableName)
42 | * @SuppressWarnings(PHPMD.UnusedFormalParameter)
43 | */
44 | public function populate(EnvironmentInterface $environment)
45 | {
46 | $GLOBALS['TL_CSS'][] = '/bundles/metamodelscore/css/style.css';
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/translations/metamodels_filter.fr.xlf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Filter value for attribute "%id%"
6 | Valeur du filtre pour l'attribut « %id% »
7 |
8 |
9 |
10 |
11 |
12 | Filter
13 | Filtre
14 |
15 |
16 | No filtering
17 | Pas de filtrage
18 |
19 |
20 | Select all
21 | Tout sélectionner
22 |
23 |
24 | Clear all filter
25 | Supprimer tous les filtres
26 |
27 |
28 | (No matching combinations found.)
29 | (Aucune combinaison n'a été trouvée).
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/contao/languages/de/tl_maintenance.php:
--------------------------------------------------------------------------------
1 |
15 | * @author Ingolf Steinhardt
16 | * @author Stefan Heimes
17 | * @copyright 2012-2022 The MetaModels team.
18 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
19 | * @filesource
20 | */
21 |
22 | namespace MetaModels\CoreBundle\DcGeneral;
23 |
24 | use Contao\StringUtil;
25 | use MetaModels\DcGeneral\DataDefinition\Palette\Condition\Property\PropertyContainAnyOfCondition;
26 | use MetaModels\IMetaModel;
27 |
28 | /**
29 | * This builds a property condition.
30 | */
31 | class PropertyContainAnyOfConditionFactory extends AbstractRestrictedAttributeConditionFactory
32 | {
33 | /**
34 | * {@inheritDoc}
35 | */
36 | public function buildCondition(array $configuration, IMetaModel $metaModel)
37 | {
38 | $condition = new PropertyContainAnyOfCondition(
39 | $this->attributeIdToName($metaModel, $configuration['attr_id']),
40 | StringUtil::deserialize($configuration['value'])
41 | );
42 | $condition->setMetaModel($metaModel);
43 |
44 | return $condition;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/Filter/Rules/StaticIdList.php:
--------------------------------------------------------------------------------
1 |
15 | * @author David Maack
16 | * @author Sven Baumann
17 | * @author Ingolf Steinhardt
18 | * @copyright 2012-2024 The MetaModels team.
19 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
20 | * @filesource
21 | */
22 |
23 | namespace MetaModels\Filter\Rules;
24 |
25 | use MetaModels\Filter\FilterRule;
26 |
27 | /**
28 | * This is the MetaModel filter interface.
29 | */
30 | class StaticIdList extends FilterRule
31 | {
32 | /**
33 | * The static id list that shall be applied.
34 | *
35 | * @var list|null
36 | */
37 | protected $arrIds = [];
38 |
39 | /**
40 | * Create a new FilterRule instance.
41 | *
42 | * @param list|null $arrIds Static list of ids that shall be returned as matches.
43 | */
44 | public function __construct($arrIds)
45 | {
46 | parent::__construct();
47 | $this->arrIds = $arrIds;
48 | }
49 |
50 | /**
51 | * {@inheritdoc}
52 | */
53 | public function getMatchingIds()
54 | {
55 | return $this->arrIds;
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/contao/languages/el/tl_metamodel_dca.php:
--------------------------------------------------------------------------------
1 |
16 | * @author Sven Baumann
17 | * @author Ingolf Steinhardt
18 | * @copyright 2012-2024 The MetaModels team.
19 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
20 | * @filesource
21 | */
22 |
23 | /**
24 | * Back end modules
25 | */
26 | $GLOBALS['TL_LANG']['FMD']['metamodels'][0] = 'MetaModels';
27 | $GLOBALS['TL_LANG']['FMD']['metamodels'][1] =
28 | 'The MetaModels extension allows you to create own data models.';
29 | $GLOBALS['TL_LANG']['FMD']['metamodel_list'][0] = 'MetaModel list';
30 | $GLOBALS['TL_LANG']['FMD']['metamodel_list'][1] = 'Adds a list of MetaModel items to the page.';
31 | $GLOBALS['TL_LANG']['FMD']['metamodels_frontendfilter'][0] = 'MetaModel frontend filter';
32 | $GLOBALS['TL_LANG']['FMD']['metamodels_frontendfilter'][1] = 'Adds a frontend filter for a MetaModel.';
33 | $GLOBALS['TL_LANG']['FMD']['metamodels_frontendclearall'][0] = 'MetaModel clear all';
34 | $GLOBALS['TL_LANG']['FMD']['metamodels_frontendclearall'][1] = 'Adds a clear all for all frontend filter.';
35 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/contao/languages/el/tl_metamodel_searchable_pages.php:
--------------------------------------------------------------------------------
1 |
15 | * @author Sven Baumann
16 | * @author Ingolf Steinhardt
17 | * @copyright 2012-2024 The MetaModels team.
18 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
19 | * @filesource
20 | */
21 |
22 | namespace MetaModels\Exceptions\Database;
23 |
24 | /**
25 | * Class TableDoesNotExistException
26 | */
27 | class ColumnExistsException extends \RuntimeException
28 | {
29 | /**
30 | * Create a new exception for an existing column.
31 | *
32 | * @param string $columnName The column name.
33 | * @param string $tableName The table name.
34 | * @param int $code The optional Exception code.
35 | * @param \Exception $previous The optional previous throwable used for the exception chaining.
36 | *
37 | * @return self
38 | */
39 | public static function withName($columnName, $tableName, $code = 0, $previous = null)
40 | {
41 | return new self(
42 | \sprintf('Column "%s" already exists on table "%s', $columnName, $tableName),
43 | $code,
44 | $previous
45 | );
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/contao/templates/mm_filteritem_datepicker.html5:
--------------------------------------------------------------------------------
1 | extend('mm_filteritem_default'); ?>
2 | block('formlabel'); ?>
3 | hide_label): ?>
4 | = $this->label ?>
5 |
6 | endblock(); ?>
7 | block('formfield'); ?>
8 | raw['eval']['urlparam'];
10 | $dateMin = null !== $this->raw['optionsMin']['key'] ? \date('Y-m-d', $this->raw['optionsMin']['key']) : '';
11 | $dateMax = null !== $this->raw['optionsMax']['key'] ? \date('Y-m-d', $this->raw['optionsMax']['key']) : '';
12 | $placeholderMin = $this->raw['optionsMin']['value'] ?? '';
13 | $placeholderMax = $this->raw['optionsMax']['value'] ?? '';
14 | $index = 0;
15 | ?>
16 | raw['eval']['fromField']): ?>
17 |
18 |
19 | raw['eval']['size']) {
21 | $index = 1;
22 | }
23 | ?>
24 | raw['eval']['toField']): ?>
25 |
26 |
27 | endblock(); ?>
28 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/contao/languages/el/explain.php:
--------------------------------------------------------------------------------
1 | απλό ερώτημα ';
26 | $GLOBALS['TL_LANG']['XPL']['customsql']['2']['0'] = 'Παραδειγμα 2
εισαγωγη ονοματος ταμπελας';
27 | $GLOBALS['TL_LANG']['XPL']['customsql']['3']['0'] = 'Εισαγωγη ετικετων';
28 | $GLOBALS['TL_LANG']['XPL']['customsql']['4']['0'] = 'Ασφαλης εισαγωγη ετικετων';
29 | $GLOBALS['TL_LANG']['XPL']['customsql']['5']['0'] = 'Πηγες παραμετρων
';
30 | $GLOBALS['TL_LANG']['XPL']['customsql']['6']['0'] = 'Παραδειγμα 3
χρησιμοποιηση φιλτρων των παραμετρων πηγων';
31 | $GLOBALS['TL_LANG']['XPL']['dcasetting_condition']['3']['0'] = 'OR';
32 |
--------------------------------------------------------------------------------
/src/Exceptions/Database/ColumnDoesNotExistException.php:
--------------------------------------------------------------------------------
1 |
15 | * @author Sven Baumann
16 | * @author Ingolf Steinhardt
17 | * @copyright 2012-2024 The MetaModels team.
18 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
19 | * @filesource
20 | */
21 |
22 | namespace MetaModels\Exceptions\Database;
23 |
24 | /**
25 | * Class TableDoesNotExistException
26 | */
27 | class ColumnDoesNotExistException extends \RuntimeException
28 | {
29 | /**
30 | * Create a new exception for a non-existing table.
31 | *
32 | * @param string $columnName Column name.
33 | * @param string $tableName The table name.
34 | * @param int $code The optional Exception code.
35 | * @param \Exception $previous The optional previous throwable used for the exception chaining.
36 | *
37 | * @return self
38 | */
39 | public static function withName($columnName, $tableName, $code = 0, $previous = null)
40 | {
41 | return new self(
42 | \sprintf('Column "%s" does not exist on table "%s".', $columnName, $tableName),
43 | $code,
44 | $previous
45 | );
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/CoreBundle/DcGeneral/AbstractRestrictedAttributeConditionFactory.php:
--------------------------------------------------------------------------------
1 |
15 | * @copyright 2012-2019 The MetaModels team.
16 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
17 | * @filesource
18 | */
19 |
20 | namespace MetaModels\CoreBundle\DcGeneral;
21 |
22 | /**
23 | * This is the abstract base for attribute aware condition factories.
24 | *
25 | * @SuppressWarnings(PHPMD.LongClassName)
26 | * @SuppressWarnings(PHPMD.LongVariable)
27 | */
28 | abstract class AbstractRestrictedAttributeConditionFactory extends AbstractAttributeConditionFactory
29 | {
30 | /**
31 | * The list of supported attribute types.
32 | *
33 | * @var array
34 | */
35 | private $supportedAttributeTypes;
36 |
37 | /**
38 | * Create a new instance.
39 | *
40 | * @param array $supportedAttributeTypes
41 | */
42 | public function __construct(array $supportedAttributeTypes)
43 | {
44 | $this->supportedAttributeTypes = $supportedAttributeTypes;
45 | }
46 |
47 | /**
48 | * {@inheritDoc}
49 | */
50 | public function supportsAttribute($attribute)
51 | {
52 | return \in_array($attribute, $this->supportedAttributeTypes, true);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/src/Helper/LocaleUtil.php:
--------------------------------------------------------------------------------
1 |
15 | * @copyright 2012-2023 The MetaModels team.
16 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
17 | * @filesource
18 | */
19 |
20 | namespace MetaModels\Helper;
21 |
22 | use Contao\CoreBundle\Util\LocaleUtil as ContaoLocaleUtil;
23 | use Contao\System;
24 |
25 | final class LocaleUtil
26 | {
27 | /**
28 | * Converts a Locale ID to a Language Tag and strips keywords
29 | * after the @ sign.
30 | * As legacy part we convert a Locale ID (_) to a Language Tag (-)
31 | * and strips keywords after the @ sign.
32 | *
33 | * @param string $localeId The locale id.
34 | *
35 | * @return string
36 | */
37 | public static function formatAsLanguageTag(string $localeId): string
38 | {
39 | return self::formatAsLocale($localeId);
40 | }
41 |
42 | /**
43 | * Converts a Language Tag (-) to a Locale ID (_) and strips keywords
44 | * after the @ sign.
45 | *
46 | * @param string $languageTag The language tag.
47 | *
48 | * @return string
49 | */
50 | public static function formatAsLocale(string $languageTag): string
51 | {
52 | return ContaoLocaleUtil::formatAsLocale($languageTag);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/contao/languages/sk/explain.php:
--------------------------------------------------------------------------------
1 |
15 | * @author Sven Baumann
16 | * @copyright 2012-2022 The MetaModels team.
17 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
18 | * @filesource
19 | */
20 |
21 | namespace MetaModels\Render\Setting\Events;
22 |
23 | use MetaModels\Render\Setting\IRenderSettingFactory;
24 | use Symfony\Contracts\EventDispatcher\Event;
25 |
26 | /**
27 | * This event is triggered for every render setting factory instance that is created.
28 | */
29 | class CreateRenderSettingFactoryEvent extends Event
30 | {
31 | /**
32 | * The factory that has been created.
33 | *
34 | * @var IRenderSettingFactory
35 | */
36 | protected $factory;
37 |
38 | /**
39 | * Create a new instance.
40 | *
41 | * @param IRenderSettingFactory $factory The factory that has been created.
42 | */
43 | public function __construct($factory)
44 | {
45 | $this->factory = $factory;
46 | }
47 |
48 | /**
49 | * Retrieve the attribute information array.
50 | *
51 | * @return IRenderSettingFactory
52 | */
53 | public function getFactory()
54 | {
55 | return $this->factory;
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/src/Schema/SchemaGenerator.php:
--------------------------------------------------------------------------------
1 |
15 | * @copyright 2012-2019 The MetaModels team.
16 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
17 | * @filesource
18 | */
19 |
20 | declare(strict_types=1);
21 |
22 | namespace MetaModels\Schema;
23 |
24 | use MetaModels\Information\MetaModelCollectionInterface;
25 |
26 | /**
27 | * This is the main MetaModels schema generator, it is a composite of other generators.
28 | */
29 | class SchemaGenerator implements SchemaGeneratorInterface
30 | {
31 | /**
32 | * The list of registered schema managers.
33 | *
34 | * @var SchemaGeneratorInterface[]
35 | */
36 | private $generators;
37 |
38 | /**
39 | * Create a new instance.
40 | *
41 | * @param SchemaGeneratorInterface[] $generators The managers to use.
42 | */
43 | public function __construct(array $generators)
44 | {
45 | $this->generators = $generators;
46 | }
47 |
48 | /**
49 | * {@inheritDoc}
50 | */
51 | public function generate(SchemaInformation $information, MetaModelCollectionInterface $collection): void
52 | {
53 | foreach ($this->generators as $manager) {
54 | $manager->generate($information, $collection);
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/src/Attribute/Events/CreateAttributeFactoryEvent.php:
--------------------------------------------------------------------------------
1 |
15 | * @author Sven Baumann
16 | * @author Ingolf Steinhardt
17 | * @copyright 2012-2022 The MetaModels team.
18 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
19 | * @filesource
20 | */
21 |
22 | namespace MetaModels\Attribute\Events;
23 |
24 | use MetaModels\Attribute\IAttributeFactory;
25 | use Symfony\Contracts\EventDispatcher\Event;
26 |
27 | /**
28 | * This event is triggered for every attribute factory instance that is created.
29 | */
30 | class CreateAttributeFactoryEvent extends Event
31 | {
32 | /**
33 | * The factory that has been created.
34 | *
35 | * @var IAttributeFactory
36 | */
37 | protected $factory;
38 |
39 | /**
40 | * Create a new instance.
41 | *
42 | * @param IAttributeFactory $factory The factory that has been created.
43 | */
44 | public function __construct($factory)
45 | {
46 | $this->factory = $factory;
47 | }
48 |
49 | /**
50 | * Retrieve the attribute information array.
51 | *
52 | * @return IAttributeFactory
53 | */
54 | public function getFactory()
55 | {
56 | return $this->factory;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/CoreBundle/DependencyInjection/CompilerPass/CollectSchemaManagersPass.php:
--------------------------------------------------------------------------------
1 |
15 | * @copyright 2012-2019 The MetaModels team.
16 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
17 | * @filesource
18 | */
19 |
20 | declare(strict_types=1);
21 |
22 | namespace MetaModels\CoreBundle\DependencyInjection\CompilerPass;
23 |
24 | use MetaModels\Schema\SchemaManager;
25 | use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
26 | use Symfony\Component\DependencyInjection\Compiler\PriorityTaggedServiceTrait;
27 | use Symfony\Component\DependencyInjection\ContainerBuilder;
28 |
29 | /**
30 | * This pass adds the tagged schema managers.
31 | */
32 | class CollectSchemaManagersPass implements CompilerPassInterface
33 | {
34 | use PriorityTaggedServiceTrait;
35 |
36 | public const TAG_NAME = 'metamodels.schema-manager';
37 |
38 | /**
39 | * {@inheritDoc}
40 | */
41 | public function process(ContainerBuilder $container): void
42 | {
43 | $generator = $container->getDefinition(SchemaManager::class);
44 | $generator->setArgument(
45 | 0,
46 | array_merge($generator->getArgument(0), $this->findAndSortTaggedServices(self::TAG_NAME, $container))
47 | );
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/contao/languages/et/tl_metamodel_rendersetting.php:
--------------------------------------------------------------------------------
1 |
14 | * @author Ingolf Steinhardt
15 | * @author Sven Baumann
16 | * @author Carolina Koehn
17 | * @copyright 2012-2025 The MetaModels team.
18 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
19 | * @filesource
20 | */
21 |
22 | //colors
23 | $white: rgba(255, 255, 255, 1);
24 |
25 | //urls
26 | $url_metamodels: url('/bundles/metamodelscore/images/backend/metamodels-logo.png');
27 |
28 | .mm_support_display {
29 | padding: 15px;
30 |
31 | .logo {
32 | display: block;
33 | height: 80px;
34 | text-indent: -99999px;
35 | background: transparent $url_metamodels no-repeat top left;
36 | background-size: contain;
37 | }
38 |
39 | h1 {
40 | margin-bottom: 20px;
41 | }
42 |
43 | .colset {
44 | width: 100%;
45 | padding-top: 10px;
46 | padding-bottom: 10px;
47 | overflow: hidden;
48 | clear: both;
49 |
50 | form {
51 | padding-bottom: 10px;
52 | }
53 | .left {
54 | width: 35%;
55 | float: left;
56 | }
57 |
58 | .right {
59 | float: right;
60 | width: 60%;
61 | }
62 | }
63 |
64 | a {
65 | text-decoration: underline;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/src/CoreBundle/DependencyInjection/CompilerPass/CollectSchemaGeneratorsPass.php:
--------------------------------------------------------------------------------
1 |
15 | * @copyright 2012-2019 The MetaModels team.
16 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
17 | * @filesource
18 | */
19 |
20 | declare(strict_types=1);
21 |
22 | namespace MetaModels\CoreBundle\DependencyInjection\CompilerPass;
23 |
24 | use MetaModels\Schema\SchemaGenerator;
25 | use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
26 | use Symfony\Component\DependencyInjection\Compiler\PriorityTaggedServiceTrait;
27 | use Symfony\Component\DependencyInjection\ContainerBuilder;
28 |
29 | /**
30 | * This pass adds the tagged schema generators.
31 | */
32 | class CollectSchemaGeneratorsPass implements CompilerPassInterface
33 | {
34 | use PriorityTaggedServiceTrait;
35 |
36 | public const TAG_NAME = 'metamodels.schema-generator';
37 |
38 | /**
39 | * {@inheritDoc}
40 | */
41 | public function process(ContainerBuilder $container): void
42 | {
43 | $generator = $container->getDefinition(SchemaGenerator::class);
44 | $generator->setArgument(
45 | 0,
46 | array_merge($generator->getArgument(0), $this->findAndSortTaggedServices(self::TAG_NAME, $container))
47 | );
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/contao/languages/fr/tl_metamodel_searchable_pages.php:
--------------------------------------------------------------------------------
1 |
16 | * @author Christian Schiffler
17 | * @author Sven Baumann
18 | * @copyright 2012-2018 The MetaModels team.
19 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
20 | * @filesource
21 | */
22 |
23 | $GLOBALS['TL_LANG']['tl_syncCto_database']['tl_metamodel'] = 'MetaModels';
24 | $GLOBALS['TL_LANG']['tl_syncCto_database']['tl_metamodel_attribute'] = 'MetaModels attribute';
25 | $GLOBALS['TL_LANG']['tl_syncCto_database']['tl_metamodel_dca'] = 'MetaModels input screens';
26 | $GLOBALS['TL_LANG']['tl_syncCto_database']['tl_metamodel_dca_combine'] = 'MetaModels workflow';
27 | $GLOBALS['TL_LANG']['tl_syncCto_database']['tl_metamodel_dcasetting'] = 'MetaModels input screens settings';
28 | $GLOBALS['TL_LANG']['tl_syncCto_database']['tl_metamodel_filter'] = 'MetaModels filter';
29 | $GLOBALS['TL_LANG']['tl_syncCto_database']['tl_metamodel_filtersetting'] = 'MetaModels filter setting';
30 | $GLOBALS['TL_LANG']['tl_syncCto_database']['tl_metamodel_rendersetting'] = 'MetaModels render setting';
31 | $GLOBALS['TL_LANG']['tl_syncCto_database']['tl_metamodel_rendersettings'] = 'MetaModels render settings';
32 |
--------------------------------------------------------------------------------
/src/CoreBundle/Resources/contao/languages/rm/tl_metamodel_searchable_pages.php:
--------------------------------------------------------------------------------
1 | previous->getHelpFor($table, $property) as $helpText) {
23 | $buffer[$helpText->getSection() . '_' . $helpText->getKey()] = true;
24 | yield $helpText;
25 | }
26 | if ('tl_metamodel_dca' === $table && 'panelLayout' === $property) {
27 | foreach (
28 | [
29 | 'filter',
30 | 'search',
31 | 'sort',
32 | 'limit',
33 | ] as $option
34 | ) {
35 | $helpText = new HelpText(
36 | 'panelLayout_headline',
37 | $option,
38 | 'panelLayout_' . $option . '.caption',
39 | 'panelLayout_' . $option . '.description',
40 | 'tl_metamodel_dca',
41 | );
42 | if ($buffer[$helpText->getSection() . '_' . $helpText->getKey()] ?? false) {
43 | continue;
44 | }
45 | yield $helpText;
46 | }
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/Filter/Setting/Events/CreateFilterSettingFactoryEvent.php:
--------------------------------------------------------------------------------
1 |
15 | * @author Sven Baumann
16 | * @author Ingolf Steinhardt
17 | * @copyright 2012-2022 The MetaModels team.
18 | * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
19 | * @filesource
20 | */
21 |
22 | namespace MetaModels\Filter\Setting\Events;
23 |
24 | use MetaModels\Filter\Setting\IFilterSettingFactory;
25 | use Symfony\Contracts\EventDispatcher\Event;
26 |
27 | /**
28 | * This event is triggered for every attribute factory instance that is created.
29 | */
30 | class CreateFilterSettingFactoryEvent extends Event
31 | {
32 | /**
33 | * The factory that has been created.
34 | *
35 | * @var IFilterSettingFactory
36 | */
37 | protected $factory;
38 |
39 | /**
40 | * Create a new instance.
41 | *
42 | * @param IFilterSettingFactory $factory The factory that has been created.
43 | */
44 | public function __construct($factory)
45 | {
46 | $this->factory = $factory;
47 | }
48 |
49 | /**
50 | * Retrieve the attribute information array.
51 | *
52 | * @return IFilterSettingFactory
53 | */
54 | public function getFactory()
55 | {
56 | return $this->factory;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------