more additions to the eTemplate 2.0 DTD: adding option children to et2-select and size attribute to et2-textbox and -textarea

This commit is contained in:
ralf 2024-04-23 18:14:14 +02:00
parent 160de9446b
commit d967bb7f66
3 changed files with 60 additions and 6 deletions

View File

@ -60,6 +60,7 @@ $overwrites = [
'.attrs' => [ '.attrs' => [
'placeholder' => 'string', 'placeholder' => 'string',
'maxlength' => 'int', 'maxlength' => 'int',
'size' => 'int',
], ],
], ],
'Et2InvokerMixin' => 'Et2TextBox', 'Et2InvokerMixin' => 'Et2TextBox',
@ -73,6 +74,7 @@ $overwrites = [
'maxlength' => 'int', 'maxlength' => 'int',
'rows' => 'int', 'rows' => 'int',
'resizeRatio' => 'number', // is this correct 'resizeRatio' => 'number', // is this correct
'size' => 'int',
], ],
], ],
'et2-date' => [ 'et2-date' => [
@ -136,6 +138,9 @@ $overwrites = [
'allowFreeEntries' => 'boolean', 'allowFreeEntries' => 'boolean',
], ],
], ],
'et2-select' => [
'.children' => ['.quantity' => 'zeroOrMore', 'option'],
],
'et2-email' => [ 'et2-email' => [
'.attrs' => [ '.attrs' => [
'onTagClick' => 'function', 'onTagClick' => 'function',
@ -172,6 +177,7 @@ $missing_legacy_attributes = [
'minWidth' => 'column', 'minWidth' => 'column',
'onchange' => 'customfields-types', 'onchange' => 'customfields-types',
'onselect' => 'nextmatch', 'onselect' => 'nextmatch',
'value' => 'option',
'readonly' => 'customfields-types', 'readonly' => 'customfields-types',
'sortmode' => [ 'sortmode' => [
'.values' => ['ASC', 'DESC'], '.values' => ['ASC', 'DESC'],
@ -179,7 +185,7 @@ $missing_legacy_attributes = [
'nextmatch-sortheader', 'nextmatch-sortheader',
], ],
'span' => ['nextmatch', 'nextmatch-header', 'nextmatch-customfields', 'nextmatch-sortheader', 'customfields-types'], 'span' => ['nextmatch', 'nextmatch-header', 'nextmatch-customfields', 'nextmatch-sortheader', 'customfields-types'],
'statustext' => ['tab', 'customfields-types'], 'statustext' => ['tab', 'customfields-types', 'option'],
'template' => ['.optional' => false, 'nextmatch'], 'template' => ['.optional' => false, 'nextmatch'],
'tab' => 'customfields', 'tab' => 'customfields',
]; ];
@ -292,9 +298,11 @@ foreach($data['modules'] as $module)
} }
else else
{ {
$list = $element->addChild('oneOrMore'); // zeroOrMore for e.g. empty boxes? $children = (array)$overwrites[$export['name']]['.children'];
$list = $element->addChild($children['.quantity'] ?? 'oneOrMore'); // zeroOrMore for e.g. empty boxes?
unset($children['.quantity']);
// add allowed children // add allowed children
foreach((array)$overwrites[$export['name']]['.children'] as $child) foreach($children as $child)
{ {
$list->addChild('ref')->addAttribute('name', $child); $list->addChild('ref')->addAttribute('name', $child);
} }

View File

@ -452,7 +452,9 @@
<!ELEMENT option EMPTY> <!ELEMENT option EMPTY>
<!ATTLIST option <!ATTLIST option
value CDATA #IMPLIED> value CDATA #IMPLIED
value CDATA #IMPLIED
statustext CDATA #IMPLIED>
<!ELEMENT radio EMPTY> <!ELEMENT radio EMPTY>
@ -2326,7 +2328,7 @@
span CDATA #IMPLIED span CDATA #IMPLIED
slot CDATA #IMPLIED> slot CDATA #IMPLIED>
<!ELEMENT et2-select EMPTY> <!ELEMENT et2-select (option)*>
<!ATTLIST et2-select <!ATTLIST et2-select
placeholder CDATA '' placeholder CDATA ''
@ -2440,6 +2442,7 @@
maxlength CDATA #IMPLIED maxlength CDATA #IMPLIED
rows CDATA #IMPLIED rows CDATA #IMPLIED
resizeRatio CDATA #IMPLIED resizeRatio CDATA #IMPLIED
size CDATA #IMPLIED
tabindex CDATA #IMPLIED> tabindex CDATA #IMPLIED>
<!ELEMENT et2-number EMPTY> <!ELEMENT et2-number EMPTY>
@ -2474,6 +2477,7 @@
slot CDATA #IMPLIED slot CDATA #IMPLIED
placeholder CDATA #IMPLIED placeholder CDATA #IMPLIED
maxlength CDATA #IMPLIED maxlength CDATA #IMPLIED
size CDATA #IMPLIED
tabindex CDATA #IMPLIED> tabindex CDATA #IMPLIED>
<!ELEMENT et2-password EMPTY> <!ELEMENT et2-password EMPTY>
@ -2506,6 +2510,7 @@
slot CDATA #IMPLIED slot CDATA #IMPLIED
placeholder CDATA #IMPLIED placeholder CDATA #IMPLIED
maxlength CDATA #IMPLIED maxlength CDATA #IMPLIED
size CDATA #IMPLIED
tabindex CDATA #IMPLIED> tabindex CDATA #IMPLIED>
<!ELEMENT et2-searchbox EMPTY> <!ELEMENT et2-searchbox EMPTY>
@ -2538,6 +2543,7 @@
slot CDATA #IMPLIED slot CDATA #IMPLIED
placeholder CDATA #IMPLIED placeholder CDATA #IMPLIED
maxlength CDATA #IMPLIED maxlength CDATA #IMPLIED
size CDATA #IMPLIED
tabindex CDATA #IMPLIED> tabindex CDATA #IMPLIED>
<!ELEMENT et2-textbox EMPTY> <!ELEMENT et2-textbox EMPTY>
@ -2568,6 +2574,7 @@
slot CDATA #IMPLIED slot CDATA #IMPLIED
placeholder CDATA #IMPLIED placeholder CDATA #IMPLIED
maxlength CDATA #IMPLIED maxlength CDATA #IMPLIED
size CDATA #IMPLIED
tabindex CDATA #IMPLIED> tabindex CDATA #IMPLIED>
<!ELEMENT et2-tree EMPTY> <!ELEMENT et2-tree EMPTY>
@ -2706,6 +2713,7 @@
slot CDATA #IMPLIED slot CDATA #IMPLIED
placeholder CDATA #IMPLIED placeholder CDATA #IMPLIED
maxlength CDATA #IMPLIED maxlength CDATA #IMPLIED
size CDATA #IMPLIED
tabindex CDATA #IMPLIED> tabindex CDATA #IMPLIED>
<!ELEMENT et2-url-email EMPTY> <!ELEMENT et2-url-email EMPTY>
@ -2737,6 +2745,7 @@
emailDisplay CDATA #IMPLIED emailDisplay CDATA #IMPLIED
placeholder CDATA #IMPLIED placeholder CDATA #IMPLIED
maxlength CDATA #IMPLIED maxlength CDATA #IMPLIED
size CDATA #IMPLIED
tabindex CDATA #IMPLIED> tabindex CDATA #IMPLIED>
<!ELEMENT et2-url-fax EMPTY> <!ELEMENT et2-url-fax EMPTY>
@ -2767,6 +2776,7 @@
slot CDATA #IMPLIED slot CDATA #IMPLIED
placeholder CDATA #IMPLIED placeholder CDATA #IMPLIED
maxlength CDATA #IMPLIED maxlength CDATA #IMPLIED
size CDATA #IMPLIED
tabindex CDATA #IMPLIED> tabindex CDATA #IMPLIED>
<!ELEMENT et2-url-phone EMPTY> <!ELEMENT et2-url-phone EMPTY>
@ -2797,6 +2807,7 @@
slot CDATA #IMPLIED slot CDATA #IMPLIED
placeholder CDATA #IMPLIED placeholder CDATA #IMPLIED
maxlength CDATA #IMPLIED maxlength CDATA #IMPLIED
size CDATA #IMPLIED
tabindex CDATA #IMPLIED> tabindex CDATA #IMPLIED>
<!ELEMENT et2-vfs-mime EMPTY> <!ELEMENT et2-vfs-mime EMPTY>

View File

@ -1579,6 +1579,12 @@
<optional> <optional>
<attribute name="value"/> <attribute name="value"/>
</optional> </optional>
<optional>
<attribute name="value"/>
</optional>
<optional>
<attribute name="statustext"/>
</optional>
</define> </define>
<define name="radio"> <define name="radio">
<element name="radio"> <element name="radio">
@ -8820,7 +8826,9 @@
<define name="et2-select"> <define name="et2-select">
<element name="et2-select"> <element name="et2-select">
<ref name="attlist.et2-select"/> <ref name="attlist.et2-select"/>
<empty/> <zeroOrMore>
<ref name="option"/>
</zeroOrMore>
</element> </element>
</define> </define>
<define name="attlist.et2-select" combine="interleave"> <define name="attlist.et2-select" combine="interleave">
@ -9289,6 +9297,9 @@
<optional> <optional>
<attribute name="resizeRatio"/> <attribute name="resizeRatio"/>
</optional> </optional>
<optional>
<attribute name="size"/>
</optional>
<optional> <optional>
<attribute name="tabindex"/> <attribute name="tabindex"/>
</optional> </optional>
@ -9423,6 +9434,9 @@
<optional> <optional>
<attribute name="maxlength"/> <attribute name="maxlength"/>
</optional> </optional>
<optional>
<attribute name="size"/>
</optional>
<optional> <optional>
<attribute name="tabindex"/> <attribute name="tabindex"/>
</optional> </optional>
@ -9557,6 +9571,9 @@
<optional> <optional>
<attribute name="maxlength"/> <attribute name="maxlength"/>
</optional> </optional>
<optional>
<attribute name="size"/>
</optional>
<optional> <optional>
<attribute name="tabindex"/> <attribute name="tabindex"/>
</optional> </optional>
@ -9697,6 +9714,9 @@
<optional> <optional>
<attribute name="maxlength"/> <attribute name="maxlength"/>
</optional> </optional>
<optional>
<attribute name="size"/>
</optional>
<optional> <optional>
<attribute name="tabindex"/> <attribute name="tabindex"/>
</optional> </optional>
@ -9819,6 +9839,9 @@
<optional> <optional>
<attribute name="maxlength"/> <attribute name="maxlength"/>
</optional> </optional>
<optional>
<attribute name="size"/>
</optional>
<optional> <optional>
<attribute name="tabindex"/> <attribute name="tabindex"/>
</optional> </optional>
@ -10403,6 +10426,9 @@
<optional> <optional>
<attribute name="maxlength"/> <attribute name="maxlength"/>
</optional> </optional>
<optional>
<attribute name="size"/>
</optional>
<optional> <optional>
<attribute name="tabindex"/> <attribute name="tabindex"/>
</optional> </optional>
@ -10528,6 +10554,9 @@
<optional> <optional>
<attribute name="maxlength"/> <attribute name="maxlength"/>
</optional> </optional>
<optional>
<attribute name="size"/>
</optional>
<optional> <optional>
<attribute name="tabindex"/> <attribute name="tabindex"/>
</optional> </optional>
@ -10650,6 +10679,9 @@
<optional> <optional>
<attribute name="maxlength"/> <attribute name="maxlength"/>
</optional> </optional>
<optional>
<attribute name="size"/>
</optional>
<optional> <optional>
<attribute name="tabindex"/> <attribute name="tabindex"/>
</optional> </optional>
@ -10772,6 +10804,9 @@
<optional> <optional>
<attribute name="maxlength"/> <attribute name="maxlength"/>
</optional> </optional>
<optional>
<attribute name="size"/>
</optional>
<optional> <optional>
<attribute name="tabindex"/> <attribute name="tabindex"/>
</optional> </optional>