Skip to content

Commit db5ec8a

Browse files
committed
Merge remote-tracking branch 'origin/rework'
2 parents 9cf904b + 6c38a46 commit db5ec8a

26 files changed

Lines changed: 120 additions & 763 deletions

README.md

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,47 @@
1-
[![Build Status](https://travis-ci.org/MetaModels/attribute_translatedtabletext.svg)](https://travis-ci.org/MetaModels/attribute_translatedtabletext)
2-
[![Latest Version tagged](http://img.shields.io/github/tag/MetaModels/attribute_translatedtabletext.svg)](https://github.com/MetaModels/attribute_translatedtabletext/tags)
3-
[![Latest Version on Packagist](http://img.shields.io/packagist/v/MetaModels/attribute_translatedtabletext.svg)](https://packagist.org/packages/MetaModels/attribute_translatedtabletext)
4-
[![Installations via composer per month](http://img.shields.io/packagist/dm/MetaModels/attribute_translatedtabletext.svg)](https://packagist.org/packages/MetaModels/attribute_translatedtabletext)
1+
Translated multi table
2+
======================
53

6-
Translated table text
7-
================
4+
The translated multi table attribute.
85

9-
The translated table text attribute.
6+
With this attribute you are able to create complex table structures with the MultiColumnWizard.
7+
Create a config in the initConfig or somewhere else and write something like this:
8+
9+
```php
10+
$GLOBALS['TL_CONFIG']['metamodelsattribute_multi']['mm_test']['multi_test'] = array(
11+
'tl_class' => 'clr',
12+
'minCount' => 0,
13+
'columnFields' => array(
14+
'col_title' => array(
15+
'label' => 'Title',
16+
'exclude' => true,
17+
'inputType' => 'text',
18+
'eval' => array
19+
(
20+
'style'=>'width:130px'
21+
)
22+
),
23+
'col_highlight' => array(
24+
'label' => 'Hervorheben',
25+
'exclude' => true,
26+
'inputType' => 'checkbox',
27+
'eval' => array
28+
(
29+
'style' => 'width:40px'
30+
)
31+
),
32+
'col_url' => array(
33+
'label' => 'URL',
34+
'exclude' => true,
35+
'inputType' => 'text',
36+
'eval' => array
37+
(
38+
'style'=>'width:130px',
39+
'mandatory'=>false,
40+
'rgxp'=>'url'
41+
)
42+
),
43+
),
44+
);
45+
```
46+
47+
The `mm_test` is the name of the table and the `multi_test` is the name of the field.

composer.json

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
{
2-
"name": "metamodels/attribute_translatedtabletext",
3-
"description": "MetaModels attribute for dynamic translated table text",
2+
"name": "menatwork/attribute_translatedmulti",
3+
"description": "MetaModels attribute for dynamic translated multi table",
44
"keywords": [
55
"contao",
66
"metamodels",
77
"attribute",
88
"text",
99
"tabletext",
10-
"translatable"
10+
"translatable",
11+
"multicolumnwizard"
1112
],
1213
"type": "contao-module",
13-
"homepage": "http://now.metamodel.me/",
14+
"homepage": "http://www.men-at-work.de/",
1415
"license": "LGPL-3.0+",
1516
"authors": [
1617
{
@@ -26,11 +27,8 @@
2627
}
2728
],
2829
"support": {
29-
"email": "mail@metamodel.me",
30-
"issues": "https://github.com/MetaModels/attribute_translatedtabletext/issues",
31-
"wiki": "http://de.contaowiki.org/MetaModels",
32-
"irc": "irc://irc.freenode.org/contao.mm",
33-
"source": "https://github.com/MetaModels/attribute_translatedtabletext"
30+
"issues": "https://github.com/menatwork/attribute_translatedmulti/issues",
31+
"source": "https://github.com/menatwork/attribute_translatedmulti"
3432
},
3533
"require": {
3634
"php": ">=5.4",
@@ -55,18 +53,12 @@
5553
"extra": {
5654
"contao": {
5755
"symlinks": {
58-
"contao": "system/modules/metamodelsattribute_translatedtabletext"
59-
},
60-
"transifex": {
61-
"project": "metamodels",
62-
"prefix": "attribute_translatedtabletext-",
63-
"languages_cto": "contao/languages",
64-
"languages_tx": ".tx"
56+
"contao": "system/modules/metamodelsattribute_translatedmulti"
6557
}
6658
},
6759
"branch-alias": {
68-
"dev-master": "2.0.x-dev",
69-
"dev-develop": "2.1.x-dev"
60+
"dev-master": "2.1.x-dev",
61+
"dev-develop": "2.2.x-dev"
7062
}
7163
},
7264
"prefer-stable": true

contao/config/autoload.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
* @author Andreas Isaak <andy.jared@googlemail.com>
1313
* @author David Greminger <david.greminger@1up.io>
1414
* @copyright 2012-2016 The MetaModels team.
15-
* @license https://github.com/MetaModels/attribute_translatedtabletext/blob/master/LICENSE LGPL-3.0
15+
* @license https://github.com/menatwork/attribute_translatedmulti/blob/master/LICENSE LGPL-3.0
1616
* @filesource
1717
*/
1818

1919
/**
2020
* Register the templates
2121
*/
2222
TemplateLoader::addFiles(array(
23-
'mm_attr_translatedtabletext' => 'system/modules/metamodelsattribute_translatedtabletext/templates',
23+
'mm_attr_translatedmulti' => 'system/modules/metamodelsattribute_translatedmulti/templates',
2424
));

contao/config/database.sql

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,20 @@
77
-- * *
88
-- **********************************************************
99

10-
--
10+
--
1111
-- Table `tl_metamodel_tabletext`
12-
--
12+
--
1313

14-
CREATE TABLE `tl_metamodel_translatedtabletext` (
14+
CREATE TABLE `tl_metamodel_translatedmulti` (
1515
`id` int(10) unsigned NOT NULL auto_increment,
1616
`tstamp` int(10) unsigned NOT NULL default '0',
1717
`att_id` int(10) unsigned NOT NULL default '0',
1818
`item_id` int(10) unsigned NOT NULL default '0',
1919
`langcode` varchar(5) NOT NULL default '',
2020
`row` int(5) unsigned NOT NULL default '0',
21-
`col` int(5) unsigned NOT NULL default '0',
22-
`value` varchar(255) NOT NULL default '',
21+
`col` varchar(255) NOT NULL default '',
22+
`value` text NOT NULL default '',
2323
PRIMARY KEY (`id`),
2424
KEY `attitem` (`att_id`, `item_id`),
2525
UNIQUE KEY `attitemrowcol` (`att_id`, `item_id`, `row`, `col`, `langcode`)
2626
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
27-
28-
--
29-
-- Table `tl_metamodel_attribute`
30-
--
31-
32-
CREATE TABLE `tl_metamodel_attribute` (
33-
`translatedtabletext_cols` blob NULL,
34-
`tabletext_quantity_cols` varchar(2) NOT NULL default ''
35-
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

contao/config/event_listeners.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,18 @@
1010
* @subpackage AttributeTranslatedTableText
1111
* @author Christian Schiffler <c.schiffler@cyberspectrum.de>
1212
* @copyright 2012-2016 The MetaModels team.
13-
* @license https://github.com/MetaModels/attribute_translatedtabletext/blob/master/LICENSE LGPL-3.0
13+
* @license https://github.com/menatwork/attribute_translatedmulti/blob/master/LICENSE LGPL-3.0
1414
* @filesource
1515
*/
1616

17-
use MetaModels\Attribute\TranslatedTableText\AttributeTypeFactory;
1817
use MetaModels\Attribute\Events\CreateAttributeFactoryEvent;
19-
use MetaModels\DcGeneral\Events\Table\Attribute\TranslatedTableText\Subscriber;
18+
use MetaModels\Attribute\TranslatedMulti\AttributeTypeFactory;
19+
use MetaModels\DcGeneral\Events\Table\Attribute\TranslatedMulti\Subscriber;
2020
use MetaModels\Events\MetaModelsBootEvent;
2121
use MetaModels\MetaModelsEvents;
2222

2323
return array
2424
(
25-
MetaModelsEvents::SUBSYSTEM_BOOT_BACKEND => array(
26-
function (MetaModelsBootEvent $event) {
27-
new Subscriber($event->getServiceContainer());
28-
}
29-
),
3025
MetaModelsEvents::ATTRIBUTE_FACTORY_CREATE => array(
3126
function (CreateAttributeFactoryEvent $event) {
3227
$factory = $event->getFactory();

contao/dca/tl_metamodel_attribute.php

Lines changed: 2 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -13,99 +13,11 @@
1313
* @author David Greminger <david.greminger@1up.io>
1414
* @author Sven Baumann <baumann.sv@gmail.com>
1515
* @copyright 2012-2016 The MetaModels team.
16-
* @license https://github.com/MetaModels/attribute_translatedtabletext/blob/master/LICENSE LGPL-3.0
16+
* @license https://github.com/menatwork/attribute_translatedmulti/blob/master/LICENSE LGPL-3.0
1717
* @filesource
1818
*/
1919

2020
/**
2121
* Table tl_metamodel_attribute
2222
*/
23-
24-
/**
25-
* Add palette configuration.
26-
*/
27-
$GLOBALS['TL_DCA']['tl_metamodel_attribute']['metapalettes']['translatedtabletext extends _complexattribute_'] = array(
28-
'+advanced' => array('tabletext_quantity_cols', 'translatedtabletext_cols'),
29-
);
30-
31-
/**
32-
* Add data provider.
33-
*/
34-
$GLOBALS['TL_DCA']['tl_metamodel_attribute']['dca_config']['data_provider']['tl_metamodel_translatedtabletext'] = array
35-
(
36-
'source' => 'tl_metamodel_translatedtabletext'
37-
);
38-
39-
/**
40-
* Add child condition.
41-
*/
42-
$GLOBALS['TL_DCA']['tl_metamodel_attribute']['dca_config']['childCondition'][] = array
43-
(
44-
'from' => 'tl_metamodel_attribute',
45-
'to' => 'tl_metamodel_translatedtabletext',
46-
'setOn' => array
47-
(
48-
array
49-
(
50-
'to_field' => 'att_id',
51-
'from_field' => 'id',
52-
),
53-
),
54-
'filter' => array
55-
(
56-
array
57-
(
58-
'local' => 'att_id',
59-
'remote' => 'id',
60-
'operation' => '=',
61-
),
62-
)
63-
);
64-
65-
/**
66-
* Add field configuration.
67-
*/
68-
$GLOBALS['TL_DCA']['tl_metamodel_attribute']['fields']['translatedtabletext_cols'] = array(
69-
'label' => &$GLOBALS['TL_LANG']['tl_metamodel_attribute']['tabletext_cols'],
70-
'exclude' => true,
71-
'inputType' => 'multiColumnWizard',
72-
'eval' => array(
73-
'disableSorting' => true,
74-
'tl_class' => 'clr',
75-
'columnFields' => array(
76-
'langcode' => array(
77-
'exclude' => true,
78-
'inputType' => 'justtextoption',
79-
'eval' => array(
80-
'style' => 'min-width:75px;display:block;padding-top:28px;',
81-
'valign' => 'top',
82-
),
83-
),
84-
'rowLabels' => array(
85-
'exclude' => true,
86-
'inputType' => 'multiColumnWizard',
87-
'eval' => array(
88-
'disableSorting' => true,
89-
'tl_class' => 'clr',
90-
'columnFields' => array(
91-
'rowLabel' => array(
92-
'exclude' => true,
93-
'inputType' => 'text',
94-
'eval' => array(
95-
'style' => 'width:400px;',
96-
'rows' => 2,
97-
),
98-
),
99-
'rowStyle' => array(
100-
'inputType' => 'text',
101-
'eval' => array(
102-
'allowHtml' => false,
103-
'style' => 'width: 90px;',
104-
),
105-
),
106-
),
107-
),
108-
),
109-
),
110-
),
111-
);
23+
$GLOBALS['TL_DCA']['tl_metamodel_attribute']['metapalettes']['translatedmulti extends _complexattribute_'] = array();

contao/dca/tl_metamodel_dcasetting.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* @author Andreas Isaak <andy.jared@googlemail.com>
1313
* @author David Greminger <david.greminger@1up.io>
1414
* @copyright 2012-2016 The MetaModels team.
15-
* @license https://github.com/MetaModels/attribute_translatedtabletext/blob/master/LICENSE LGPL-3.0
15+
* @license https://github.com/menatwork/attribute_translatedmulti/blob/master/LICENSE LGPL-3.0
1616
* @filesource
1717
*/
1818

contao/dca/tl_metamodel_filtersetting.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
* @author Andreas Isaak <andy.jared@googlemail.com>
1313
* @author David Greminger <david.greminger@1up.io>
1414
* @copyright 2012-2016 The MetaModels team.
15-
* @license https://github.com/MetaModels/attribute_translatedtabletext/blob/master/LICENSE LGPL-3.0
15+
* @license https://github.com/menatwork/attribute_translatedmulti/blob/master/LICENSE LGPL-3.0
1616
* @filesource
1717
*/
1818

1919
/**
2020
* Table tl_metamodel_filtersetting
2121
*/
2222

23-
$GLOBALS['TL_DCA']['tl_metamodel_filtersetting']['simplelookup_palettes']['translatedtabletext'] = &$GLOBALS['TL_DCA']['tl_metamodel_filtersetting']['simplelookup_palettes']['_translated_'];
23+
$GLOBALS['TL_DCA']['tl_metamodel_filtersetting']['simplelookup_palettes']['translatedmulti'] = &$GLOBALS['TL_DCA']['tl_metamodel_filtersetting']['simplelookup_palettes']['_translated_'];

contao/dca/tl_metamodel_rendersetting.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
* @author Andreas Isaak <andy.jared@googlemail.com>
1313
* @author David Greminger <david.greminger@1up.io>
1414
* @copyright 2012-2016 The MetaModels team.
15-
* @license https://github.com/MetaModels/attribute_translatedtabletext/blob/master/LICENSE LGPL-3.0
15+
* @license https://github.com/menatwork/attribute_translatedmulti/blob/master/LICENSE LGPL-3.0
1616
* @filesource
1717
*/
1818

19-
$GLOBALS['TL_DCA']['tl_metamodel_rendersetting']['metapalettes']['translatedtabletext extends default'] = array();
19+
$GLOBALS['TL_DCA']['tl_metamodel_rendersetting']['metapalettes']['translatedmulti extends default'] = array();

0 commit comments

Comments
 (0)