Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
b86499de
Commit
b86499de
authored
Feb 20, 2017
by
Carsten Rose
Browse files
FE_DYNAMIC_UPDATE: replaced explicit string against constant.
parent
d02ad978
Changes
4
Hide whitespace changes
Inline
Side-by-side
extension/Documentation/AdministratorManual/Index.rst
View file @
b86499de
...
...
@@ -160,7 +160,7 @@ config.qfq.ini
+-----------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| FORM_DATA_ERROR |FORM_DATA_ERROR=generic error | Customizable error message used in validator.js. 'no specific' given |
+-----------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| FORM_BUTTON_ON_CHANGE_CLASS | FORM_BUTTON_ON_CHANGE_CLASS=alert-info btn-info | Color for save button after modification |
| FORM_BUTTON_ON_CHANGE_CLASS | FORM_BUTTON_ON_CHANGE_CLASS=alert-info btn-info | Color for save button after modification
|
+-----------------------------+-----------------------------------------+----------------------------------------------------------------------------+
...
...
extension/Documentation/UsersManual/Index.rst
View file @
b86499de
...
...
@@ -767,7 +767,7 @@ beside every *templateGroup*.
Multiple *templatedGroups* per form are allowed.
The name of the native FormElements, inside the templateGroup, which represents the effective table columns, uses the placeholder
`%d`. E.g. the columns `grade1`, `grade2`, `grade3` needs a *FormElement.name*
=
`grade%d`. The counting will always start with 1.
`%d`. E.g. the columns `grade1`, `grade2`, `grade3` needs a *FormElement.name*
=
`grade%d`. The counting will always start with 1.
Class: Native
-------------
...
...
@@ -1578,7 +1578,7 @@ FormElement the `row`-open is disabled and `/row`-close is enabled.
* First Element of the row:
*
`
FormElement > Layout > Wrap: Row,Label,Input,Note
`
: `row`=on, all other off.
* FormElement > Layout > Wrap: Row,Label,Input,Note: `row`=on, all other off.
* Switch off
Report
...
...
extension/qfq/qfq/AbstractBuildForm.php
View file @
b86499de
...
...
@@ -364,7 +364,7 @@ abstract class AbstractBuildForm {
if
((
$filter
===
FORM_ELEMENTS_NATIVE
&&
$fe
[
FE_TYPE
]
===
'subrecord'
)
||
(
$filter
===
FORM_ELEMENTS_SUBRECORD
&&
$fe
[
FE_TYPE
]
!==
'subrecord'
)
// || ($filter === FORM_ELEMENTS_DYNAMIC_UPDATE && $fe[
'dynamicUpdate'
] === 'no')
// || ($filter === FORM_ELEMENTS_DYNAMIC_UPDATE && $fe[
FE_DYNAMIC_UPDATE
] === 'no')
)
{
continue
;
// skip this FE
}
...
...
@@ -418,7 +418,7 @@ abstract class AbstractBuildForm {
}
}
else
{
// for non container elements: just add the current json status
if
(
$modeCollectFe
===
FLAG_ALL
||
(
$modeCollectFe
==
FLAG_DYNAMIC_UPDATE
&&
$fe
[
'dynamicUpdate'
]
==
'yes'
))
{
if
(
$modeCollectFe
===
FLAG_ALL
||
(
$modeCollectFe
==
FLAG_DYNAMIC_UPDATE
&&
$fe
[
FE_DYNAMIC_UPDATE
]
==
'yes'
))
{
if
(
isset
(
$jsonElement
[
0
])
&&
is_array
(
$jsonElement
[
0
]))
{
// Checkboxes are delivered as array of arrays: unnest them and append them to the existing json array.
$json
=
array_merge
(
$json
,
$jsonElement
);
...
...
@@ -707,7 +707,7 @@ abstract class AbstractBuildForm {
$attribute
.
=
$this
->
getAttributeList
(
$formElement
,
[
'autocomplete'
,
'autofocus'
,
'placeholder'
]);
$attribute
.
=
$this
->
getAttributeList
(
$formElement
,
[
F_FE_DATA_PATTERN_ERROR
,
F_FE_DATA_REQUIRED_ERROR
,
F_FE_DATA_MATCH_ERROR
,
F_FE_DATA_ERROR
]);
$attribute
.
=
Support
::
doAttribute
(
'data-load'
,
(
$formElement
[
'dynamicUpdate'
]
===
'yes'
)
?
'data-load'
:
''
);
$attribute
.
=
Support
::
doAttribute
(
'data-load'
,
(
$formElement
[
FE_DYNAMIC_UPDATE
]
===
'yes'
)
?
'data-load'
:
''
);
$attribute
.
=
Support
::
doAttribute
(
'title'
,
$formElement
[
'tooltip'
]);
$attribute
.
=
$this
->
getInputCheckPattern
(
$formElement
[
'checkType'
],
$formElement
[
'checkPattern'
]);
...
...
@@ -1160,7 +1160,7 @@ abstract class AbstractBuildForm {
$attribute
.
=
Support
::
doAttribute
(
'name'
,
$htmlFormElementId
);
$attribute
.
=
Support
::
doAttribute
(
'value'
,
$formElement
[
'checked'
],
false
);
$attribute
.
=
Support
::
doAttribute
(
'title'
,
$formElement
[
'tooltip'
]);
$attribute
.
=
Support
::
doAttribute
(
'data-load'
,
(
$formElement
[
'dynamicUpdate'
]
===
'yes'
)
?
'data-load'
:
''
);
$attribute
.
=
Support
::
doAttribute
(
'data-load'
,
(
$formElement
[
FE_DYNAMIC_UPDATE
]
===
'yes'
)
?
'data-load'
:
''
);
if
(
$formElement
[
'checked'
]
===
$value
)
{
$attribute
.
=
Support
::
doAttribute
(
'checked'
,
'checked'
);
...
...
@@ -1207,7 +1207,7 @@ abstract class AbstractBuildForm {
$values
=
explode
(
','
,
$value
);
// $attributeBase .= Support::doAttribute('name', $htmlFormElementId);
$attributeBase
.
=
Support
::
doAttribute
(
'data-load'
,
(
$formElement
[
'dynamicUpdate'
]
===
'yes'
)
?
'data-load'
:
''
);
$attributeBase
.
=
Support
::
doAttribute
(
'data-load'
,
(
$formElement
[
FE_DYNAMIC_UPDATE
]
===
'yes'
)
?
'data-load'
:
''
);
$attributeBase
.
=
$this
->
getAttributeList
(
$formElement
,
[
F_FE_DATA_PATTERN_ERROR
,
F_FE_DATA_REQUIRED_ERROR
,
F_FE_DATA_MATCH_ERROR
,
F_FE_DATA_ERROR
]);
$html
=
$this
->
buildNativeHidden
(
HelperFormElement
::
prependFormElementIdCheckBoxMulti
(
$htmlFormElementId
,
'h'
),
''
);
...
...
@@ -1326,7 +1326,7 @@ abstract class AbstractBuildForm {
$attributeBase
.
=
$this
->
getAttributeList
(
$formElement
,
[
F_FE_DATA_PATTERN_ERROR
,
F_FE_DATA_REQUIRED_ERROR
,
F_FE_DATA_MATCH_ERROR
,
F_FE_DATA_ERROR
]);
$attributeBase
.
=
Support
::
doAttribute
(
'name'
,
$htmlFormElementId
);
$attributeBase
.
=
Support
::
doAttribute
(
'type'
,
$formElement
[
FE_TYPE
]);
$attributeBase
.
=
Support
::
doAttribute
(
'data-load'
,
(
$formElement
[
'dynamicUpdate'
]
===
'yes'
)
?
'data-load'
:
''
);
$attributeBase
.
=
Support
::
doAttribute
(
'data-load'
,
(
$formElement
[
FE_DYNAMIC_UPDATE
]
===
'yes'
)
?
'data-load'
:
''
);
$jj
=
0
;
$flagFirst
=
true
;
...
...
@@ -1407,7 +1407,7 @@ abstract class AbstractBuildForm {
$attribute
.
=
Support
::
doAttribute
(
'class'
,
'form-control'
);
$attribute
.
=
Support
::
doAttribute
(
'title'
,
$formElement
[
'tooltip'
]);
$attribute
.
=
$this
->
getAttributeList
(
$formElement
,
[
'autofocus'
]);
$attribute
.
=
Support
::
doAttribute
(
'data-load'
,
(
$formElement
[
'dynamicUpdate'
]
===
'yes'
)
?
'data-load'
:
''
);
$attribute
.
=
Support
::
doAttribute
(
'data-load'
,
(
$formElement
[
FE_DYNAMIC_UPDATE
]
===
'yes'
)
?
'data-load'
:
''
);
$attribute
.
=
$this
->
getAttributeList
(
$formElement
,
[
F_FE_DATA_PATTERN_ERROR
,
F_FE_DATA_REQUIRED_ERROR
,
F_FE_DATA_MATCH_ERROR
,
F_FE_DATA_ERROR
]);
if
(
isset
(
$formElement
[
'size'
])
&&
$formElement
[
'size'
]
>
1
)
{
...
...
@@ -1879,7 +1879,7 @@ abstract class AbstractBuildForm {
$attribute
.
=
Support
::
doAttribute
(
'type'
,
'file'
);
$attribute
.
=
Support
::
doAttribute
(
'title'
,
$formElement
[
'tooltip'
]);
$attribute
.
=
$this
->
getAttributeList
(
$formElement
,
[
'autofocus'
,
'accept'
]);
$attribute
.
=
Support
::
doAttribute
(
'data-load'
,
(
$formElement
[
'dynamicUpdate'
]
===
'yes'
)
?
'data-load'
:
''
);
$attribute
.
=
Support
::
doAttribute
(
'data-load'
,
(
$formElement
[
FE_DYNAMIC_UPDATE
]
===
'yes'
)
?
'data-load'
:
''
);
$attribute
.
=
Support
::
doAttribute
(
'data-sip'
,
$sipUpload
);
if
(
$value
===
''
||
$value
===
false
)
{
...
...
@@ -1992,7 +1992,7 @@ abstract class AbstractBuildForm {
}
$attribute
.
=
$this
->
getAttributeList
(
$formElement
,
[
'autocomplete'
,
'autofocus'
,
'placeholder'
]);
$attribute
.
=
Support
::
doAttribute
(
'data-load'
,
(
$formElement
[
'dynamicUpdate'
]
===
'yes'
)
?
'data-load'
:
''
);
$attribute
.
=
Support
::
doAttribute
(
'data-load'
,
(
$formElement
[
FE_DYNAMIC_UPDATE
]
===
'yes'
)
?
'data-load'
:
''
);
$attribute
.
=
Support
::
doAttribute
(
'title'
,
$formElement
[
'tooltip'
]);
$attribute
.
=
$this
->
getInputCheckPattern
(
$formElement
[
'checkType'
],
$formElement
[
'checkPattern'
]);
...
...
@@ -2078,7 +2078,7 @@ abstract class AbstractBuildForm {
// $attribute .= Support::doAttribute('data-placeholder', $formElement['placeholder']);
$attribute
.
=
Support
::
doAttribute
(
'data-value'
,
htmlentities
(
$value
),
false
);
// $attribute .= Support::doAttribute('data-autofocus', $formElement['autofocus']);
$attribute
.
=
Support
::
doAttribute
(
'data-load'
,
(
$formElement
[
'dynamicUpdate'
]
===
'yes'
)
?
'data-load'
:
''
);
$attribute
.
=
Support
::
doAttribute
(
'data-load'
,
(
$formElement
[
FE_DYNAMIC_UPDATE
]
===
'yes'
)
?
'data-load'
:
''
);
$attribute
.
=
Support
::
doAttribute
(
'data-title'
,
$formElement
[
'tooltip'
]);
// if (is_array($arrMinMax)) {
...
...
@@ -2120,7 +2120,7 @@ abstract class AbstractBuildForm {
$attribute
.
=
Support
::
doAttribute
(
'data-control-name'
,
"
$htmlFormElementId
"
);
$attribute
.
=
Support
::
doAttribute
(
'data-placeholder'
,
$formElement
[
'placeholder'
]);
// $attribute .= Support::doAttribute('data-autofocus', $formElement['autofocus']);
$attribute
.
=
Support
::
doAttribute
(
'data-load'
,
(
$formElement
[
'dynamicUpdate'
]
===
'yes'
)
?
'data-load'
:
''
);
$attribute
.
=
Support
::
doAttribute
(
'data-load'
,
(
$formElement
[
FE_DYNAMIC_UPDATE
]
===
'yes'
)
?
'data-load'
:
''
);
$attribute
.
=
Support
::
doAttribute
(
'data-title'
,
$formElement
[
'tooltip'
]);
$formElement
=
$this
->
setEditorConfig
(
$formElement
,
$htmlFormElementId
);
...
...
@@ -2288,7 +2288,7 @@ abstract class AbstractBuildForm {
$tmpStore
=
$this
->
feSpecNative
;
$attribute
.
=
Support
::
doAttribute
(
'name'
,
$htmlFormElementId
);
$attribute
.
=
Support
::
doAttribute
(
'data-load'
,
(
$formElement
[
'dynamicUpdate'
]
===
'yes'
)
?
'data-load'
:
''
);
$attribute
.
=
Support
::
doAttribute
(
'data-load'
,
(
$formElement
[
FE_DYNAMIC_UPDATE
]
===
'yes'
)
?
'data-load'
:
''
);
// <fieldset>
$html
=
'<fieldset '
.
$attribute
.
'>'
;
...
...
@@ -2344,7 +2344,7 @@ abstract class AbstractBuildForm {
$tmpStore
=
$this
->
feSpecNative
;
// $attribute .= Support::doAttribute('name', $htmlFormElementId);
// $attribute .= Support::doAttribute('data-load', ($formElement[
'dynamicUpdate'
] === 'yes') ? 'data-load' : '');
// $attribute .= Support::doAttribute('data-load', ($formElement[
FE_DYNAMIC_UPDATE
] === 'yes') ? 'data-load' : '');
// <fieldset>
// $html = '<fieldset ' . $attribute . '>';
...
...
extension/qfq/tests/phpunit/BuildFormPlainTest.php
View file @
b86499de
...
...
@@ -200,9 +200,9 @@ class BuildFormPlainTest extends AbstractDatabaseTest {
$formElement
=
[
'id'
=>
123
,
'formId'
=>
1
,
'feIdContainer'
=>
0
,
'dynamicUpdate'
=>
'no'
,
FE_ID
=>
1
,
FE_ID_CONTAINER
=>
0
,
FE_DYNAMIC_UPDATE
=>
'no'
,
'enabled'
=>
'yes'
,
FE_NAME
=>
'name'
,
FE_LABEL
=>
'Name'
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment