Skip to content
GitLab
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
6fa1fff3
Commit
6fa1fff3
authored
Dec 11, 2018
by
Carsten Rose
Browse files
B6467: 'element-update' now get's 'pattern=<pattern>|false' on element-update. Refs #6467
parent
4e2a07fc
Pipeline
#1133
passed with stage
in 1 minute and 42 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
extension/qfq/qfq/AbstractBuildForm.php
View file @
6fa1fff3
...
...
@@ -997,14 +997,24 @@ abstract class AbstractBuildForm {
$json
[
API_ELEMENT_UPDATE
][
$key
][
API_ELEMENT_CONTENT
]
=
$value
;
}
$statusHidden
=
(
$formElement
[
FE_MODE
]
==
'hidden'
);
$pattern
=
null
;
if
(
$formElement
[
FE_CHECK_PATTERN
]
!=
''
)
{
$pattern
=
$statusHidden
?
false
:
$formElement
[
FE_CHECK_PATTERN
];
}
// Check show/hide: only FE with FE_MODE_SQL given, might change.
if
(
!
empty
(
$formElement
[
FE_MODE_SQL
]))
{
$class
=
is_numeric
(
$formElement
[
FE_BS_INPUT_COLUMNS
])
?
(
'col-md-'
.
$formElement
[
FE_BS_INPUT_COLUMNS
])
:
$formElement
[
FE_BS_INPUT_COLUMNS
];
// $class = 'col-md-' . $formElement[FE_BS_INPUT_COLUMNS] . ' ';
$class
.
=
(
$formElement
[
FE_MODE
]
==
FE_MODE_HIDDEN
)
?
' hidden'
:
''
;
$json
[
API_ELEMENT_UPDATE
][
$key
][
API_ELEMENT_ATTRIBUTE
][
'class'
]
=
$class
;
$json
[
API_ELEMENT_UPDATE
][
$key
][
API_ELEMENT_ATTRIBUTE
][
'required'
]
=
$formElement
[
FE_MODE
]
==
'required'
;
$json
[
API_ELEMENT_UPDATE
][
$key
][
API_ELEMENT_ATTRIBUTE
][
'hidden'
]
=
$formElement
[
FE_MODE
]
==
'hidden'
;
$json
[
API_ELEMENT_UPDATE
][
$key
][
API_ELEMENT_ATTRIBUTE
][
'required'
]
=
(
$formElement
[
FE_MODE
]
==
'required'
);
$json
[
API_ELEMENT_UPDATE
][
$key
][
API_ELEMENT_ATTRIBUTE
][
'hidden'
]
=
$statusHidden
;
if
(
$pattern
!==
null
)
{
$json
[
API_ELEMENT_UPDATE
][
$key
][
API_ELEMENT_ATTRIBUTE
][
'pattern'
]
=
$pattern
;
}
}
// #3647
...
...
@@ -1014,8 +1024,12 @@ abstract class AbstractBuildForm {
//TODO #5016 - exception for FE_TYPE_CHECKBOX should be removed ASAP
if
(
$formElement
[
FE_TYPE
]
!=
FE_TYPE_SELECT
&&
$formElement
[
FE_TYPE
]
!=
FE_TYPE_UPLOAD
&&
$formElement
[
FE_TYPE
]
!=
FE_TYPE_CHECKBOX
)
{
$json
[
API_ELEMENT_UPDATE
][
$formElement
[
FE_HTML_ID
]][
API_ELEMENT_ATTRIBUTE
][
'value'
]
=
$value
;
$json
[
API_ELEMENT_UPDATE
][
$formElement
[
FE_HTML_ID
]][
API_ELEMENT_ATTRIBUTE
][
'required'
]
=
$formElement
[
FE_MODE
]
==
'required'
;
$json
[
API_ELEMENT_UPDATE
][
$formElement
[
FE_HTML_ID
]][
API_ELEMENT_ATTRIBUTE
][
'hidden'
]
=
$formElement
[
FE_MODE
]
==
'hidden'
;
$json
[
API_ELEMENT_UPDATE
][
$formElement
[
FE_HTML_ID
]][
API_ELEMENT_ATTRIBUTE
][
'required'
]
=
(
$formElement
[
FE_MODE
]
==
'required'
);
$json
[
API_ELEMENT_UPDATE
][
$formElement
[
FE_HTML_ID
]][
API_ELEMENT_ATTRIBUTE
][
'hidden'
]
=
$statusHidden
;
if
(
$pattern
!==
null
)
{
$json
[
API_ELEMENT_UPDATE
][
$formElement
[
FE_HTML_ID
]][
API_ELEMENT_ATTRIBUTE
][
'pattern'
]
=
$pattern
;
}
}
}
...
...
@@ -1277,8 +1291,8 @@ abstract class AbstractBuildForm {
$attribute
.
=
$this
->
getAttributeList
(
$formElement
,
[
FE_INPUT_AUTOCOMPLETE
,
'autofocus'
,
'placeholder'
]);
$
pattern
=
Sanitize
::
getInputCheckPattern
(
$formElement
[
FE_CHECK_TYPE
],
$formElement
[
FE_CHECK_PATTERN
],
$formElement
[
FE_DECIMAL_FORMAT
],
$sanitizeMessage
);
$attribute
.
=
(
$
pattern
===
''
)
?
''
:
'pattern="'
.
$
pattern
.
'" '
;
$
formElement
[
FE_CHECK_PATTERN
]
=
Sanitize
::
getInputCheckPattern
(
$formElement
[
FE_CHECK_TYPE
],
$formElement
[
FE_CHECK_PATTERN
],
$formElement
[
FE_DECIMAL_FORMAT
],
$sanitizeMessage
);
$attribute
.
=
(
$
formElement
[
FE_CHECK_PATTERN
]
===
''
)
?
''
:
'pattern="'
.
$
formElement
[
FE_CHECK_PATTERN
]
.
'" '
;
if
(
empty
(
$formElement
[
F_FE_DATA_PATTERN_ERROR
]))
{
$formElement
[
F_FE_DATA_PATTERN_ERROR
]
=
empty
(
$sanitizeMessage
)
?
F_FE_DATA_PATTERN_ERROR_DEFAULT
:
$sanitizeMessage
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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