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
4820c4d0
Commit
4820c4d0
authored
Oct 04, 2017
by
Carsten Rose
Browse files
QuickFormQuery.php: validateForm() code refactored.
parent
ebd2bf85
Changes
1
Hide whitespace changes
Inline
Side-by-side
extension/qfq/qfq/QuickFormQuery.php
View file @
4820c4d0
...
@@ -1014,25 +1014,30 @@ class QuickFormQuery {
...
@@ -1014,25 +1014,30 @@ class QuickFormQuery {
throw
new
UserFormException
(
"MultiMode selected, but MultiSQL missing"
,
ERROR_MULTI_SQL_MISSING
);
throw
new
UserFormException
(
"MultiMode selected, but MultiSQL missing"
,
ERROR_MULTI_SQL_MISSING
);
}
}
if
(
$formMode
!==
FORM_DELETE
)
{
if
(
$formMode
===
FORM_DELETE
)
{
$sipArray
=
$this
->
store
->
getStore
(
STORE_SIP
);
return
$sipFound
;
// Check: requiredParameter: '' or 'form' or 'form,grId' or 'form #formname for form,grId'
}
$requiredParameter
=
(
$r
>
0
)
?
$this
->
formSpec
[
F_REQUIRED_PARAMETER_EDIT
]
:
$this
->
formSpec
[
F_REQUIRED_PARAMETER_NEW
];
$sipArray
=
$this
->
store
->
getStore
(
STORE_SIP
);
// Check: requiredParameter: '' or 'form' or 'form,grId' or 'form #formname for form,grId'
$requiredParameter
=
(
$r
>
0
)
?
$this
->
formSpec
[
F_REQUIRED_PARAMETER_EDIT
]
:
$this
->
formSpec
[
F_REQUIRED_PARAMETER_NEW
];
$requiredParameterArr
=
explode
(
'#'
,
$requiredParameter
,
2
);
if
(
trim
(
$requiredParameter
)
==
''
)
{
return
$sipFound
;
}
$param
=
explode
(
','
,
$requiredParameterArr
[
0
]);
$requiredParameterArr
=
explode
(
'#'
,
$requiredParameter
,
2
);
foreach
(
$param
AS
$name
)
{
$name
=
trim
(
$name
[
0
]);
$param
=
explode
(
','
,
$requiredParameterArr
[
0
]);
foreach
(
$param
AS
$name
)
{
if
(
$name
===
''
)
{
$name
=
trim
(
$name
);
continue
;
}
if
(
!
isset
(
$sipArray
[
$name
]))
{
if
(
$name
===
''
)
{
throw
new
UserFormException
(
"Missing required SIP parameter:
$name
"
,
ERROR_MISSING_REQUIRED_PARAMETER
);
continue
;
}
}
if
(
!
isset
(
$sipArray
[
$name
]))
{
throw
new
UserFormException
(
"Missing required SIP parameter:
$name
"
,
ERROR_MISSING_REQUIRED_PARAMETER
);
}
}
}
}
...
...
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