Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
qfq
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
typo3
qfq
Commits
ee8e46e5
Commit
ee8e46e5
authored
9 years ago
by
Carsten Rose
Browse files
Options
Downloads
Patches
Plain Diff
Form.php: renamed formDef to formSpec to be more descriptive
parent
755ea8ce
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
qfq/Form.php
+14
-12
14 additions, 12 deletions
qfq/Form.php
with
14 additions
and
12 deletions
qfq/Form.php
+
14
−
12
View file @
ee8e46e5
...
...
@@ -42,9 +42,9 @@ class Form {
protected
$store
=
null
;
protected
$db
=
null
;
protected
$form
Def
=
array
();
// Form Definition: copy of the loaded form
protected
$fe
Def
Action
=
array
();
// FormEelement Definition: all formElement.class='action' of the loaded form
protected
$fe
Def
Native
=
array
();
// FormEelement Definition: all formElement.class='native' of the loaded form
protected
$form
Spec
=
array
();
// Form Definition: copy of the loaded form
protected
$fe
Spec
Action
=
array
();
// FormEelement Definition: all formElement.class='action' of the loaded form
protected
$fe
Spec
Native
=
array
();
// FormEelement Definition: all formElement.class='native' of the loaded form
/*
* TODO:
...
...
@@ -89,18 +89,20 @@ class Form {
// Form action: load or save?
$mode
=
(
$this
->
store
->
getVar
(
CLIENT_POST_SIP
,
STORE_CLIENT
)
===
false
)
?
FORM_LOAD
:
FORM_SAVE
;
$formName
=
$this
->
loadForm
Defini
tion
();
$formName
=
$this
->
loadForm
Specifica
tion
();
$sipFound
=
$this
->
validateForm
();
if
(
!
$sipFound
)
{
$this
->
store
->
createSipAfterFormLoad
(
$formName
);
}
$this
->
store
->
fillStoreTableDefinition
(
$this
->
formSpec
[
'tableName'
]);
// TODO: replace switch() by Marschaller
// render: FormPlain | FormBootstrap
switch
(
$this
->
form
Def
[
'render'
])
{
switch
(
$this
->
form
Spec
[
'render'
])
{
case
'Plain'
:
$build
=
new
FormBuildPlain
(
$this
->
form
Def
,
$this
->
fe
Def
Action
,
$this
->
fe
Def
Native
);
$build
=
new
FormBuildPlain
(
$this
->
form
Spec
,
$this
->
fe
Spec
Action
,
$this
->
fe
Spec
Native
);
break
;
case
'Bootstrap'
:
//TODO: implement bootstrap rendering: FormBuildBootstrap
...
...
@@ -143,14 +145,14 @@ class Form {
* @throws DbException
* @throws UserException
*/
private
function
loadForm
Defini
tion
()
{
private
function
loadForm
Specifica
tion
()
{
$formName
=
$this
->
getFormName
();
$this
->
form
Def
=
$this
->
db
->
sql
(
"SELECT * FROM Form AS f WHERE f.name LIKE ? AND f.deleted='no'"
,
ROW_EXACT_1
,
[
$formName
]);
$this
->
form
Spec
=
$this
->
db
->
sql
(
"SELECT * FROM Form AS f WHERE f.name LIKE ? AND f.deleted='no'"
,
ROW_EXACT_1
,
[
$formName
]);
$sql
=
"SELECT * FROM FormElement AS fe WHERE fe.formId = ? AND fe.deleted='no' AND fe.class = ? AND fe.enabled='yes' ORDER BY fe.order, fe.id"
;
$this
->
fe
Def
Action
=
$this
->
db
->
sql
(
$sql
,
ROW_REGULAR
,
[
$this
->
form
Def
[
"id"
],
'action'
]);
$this
->
fe
Def
Native
=
$this
->
db
->
sql
(
$sql
,
ROW_REGULAR
,
[
$this
->
form
Def
[
"id"
],
'native'
]);
$this
->
fe
Spec
Action
=
$this
->
db
->
sql
(
$sql
,
ROW_REGULAR
,
[
$this
->
form
Spec
[
"id"
],
'action'
]);
$this
->
fe
Spec
Native
=
$this
->
db
->
sql
(
$sql
,
ROW_REGULAR
,
[
$this
->
form
Spec
[
"id"
],
'native'
]);
return
$formName
;
}
...
...
@@ -182,7 +184,7 @@ class Form {
$r
=
$this
->
store
->
getVar
(
SIP_RECORD_ID
,
STORE_SIP
.
STORE_CLIENT
);
// If there is a record_id>0: EDIT else NEW
$mode
=
(
$r
>
0
)
?
$this
->
form
Def
[
'permitEdit'
]
:
$this
->
form
Def
[
'permitNew'
];
$mode
=
(
$r
>
0
)
?
$this
->
form
Spec
[
'permitEdit'
]
:
$this
->
form
Spec
[
'permitNew'
];
$feUserLoggedIn
=
isset
(
$GLOBALS
[
"TSFE"
]
->
fe_user
->
user
[
"uid"
])
&&
$GLOBALS
[
"TSFE"
]
->
fe_user
->
user
[
"uid"
]
>
0
;
...
...
@@ -213,7 +215,7 @@ class Form {
}
// Form Definition valid?
if
(
$this
->
form
Def
[
'multiMode'
]
!==
'none'
&&
$this
->
form
Def
[
'multiSql'
]
===
''
)
{
if
(
$this
->
form
Spec
[
'multiMode'
]
!==
'none'
&&
$this
->
form
Spec
[
'multiSql'
]
===
''
)
{
throw
new
UserException
(
"MultiMode selected, but MultiSQL missing"
,
ERROR_MULTI_SQL_MISSING
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment