Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
45987768
Commit
45987768
authored
Feb 03, 2017
by
Carsten Rose
Browse files
AbstractBuildForm.php: accidently a function duplicated - removed
parent
4283fe4d
Changes
1
Hide whitespace changes
Inline
Side-by-side
extension/qfq/qfq/AbstractBuildForm.php
View file @
45987768
...
...
@@ -322,104 +322,6 @@ abstract class AbstractBuildForm {
abstract
public
function
getProcessFilter
();
/**
* Check if there is an explicit 'autofocus' definition in at least one FE.
* Found: do nothing, it will be rendered at the correct position.
* Not found: set 'autofocus' on the first FE.
*
* Accepted misbehaviour on forms with pills: if there is at least one editable element on the first pill,
* the other pills are not checked - independent if there was a definition on the first pill or not.
* Reason: checks happens per pill - if there is no explizit definition on the first pill, take the first editable
* element of that pill.
*/
private
function
checkAutoFocus
()
{
static
$found
=
false
;
$idx
=
false
;
if
(
$found
)
{
return
;
}
// Search if there is an explicit autofocus definition.
for
(
$i
=
0
;
$i
<
count
(
$this
->
feSpecNative
);
++
$i
)
{
// Only check native elements which will be shown
if
(
$this
->
feSpecNative
[
$i
][
FE_CLASS
]
==
FE_CLASS_NATIVE
&&
(
$this
->
feSpecNative
[
$i
][
FE_MODE
]
==
FE_MODE_SHOW
||
$this
->
feSpecNative
[
$i
][
FE_MODE
]
==
FE_MODE_REQUIRED
)
)
{
// Check if there is an explicit definition.
if
(
isset
(
$this
->
feSpecNative
[
$i
][
FE_AUTOFOCUS
]))
{
if
(
$this
->
feSpecNative
[
$i
][
FE_AUTOFOCUS
]
==
''
||
$this
->
feSpecNative
[
$i
][
FE_AUTOFOCUS
]
==
'1'
)
{
$this
->
feSpecNative
[
$i
][
FE_AUTOFOCUS
]
=
'1'
;
// fix to '=1'
}
else
{
unset
(
$this
->
feSpecNative
[
$i
][
FE_AUTOFOCUS
]);
}
$found
=
true
;
return
;
}
if
(
$idx
===
false
)
{
$idx
=
$i
;
}
}
}
// No explicit definition found: take the first found editable element.
if
(
$idx
!==
false
)
{
$found
=
true
;
// No explicit definition found: set autofocus.
$this
->
feSpecNative
[
$idx
][
FE_AUTOFOCUS
]
=
'1'
;
}
}
/**
* Check if there is an explicit 'autofocus' definition in at least one FE.
* Found: do nothing, it will be rendered at the correct position.
* Not found: set 'autofocus' on the first FE.
*
* Accepted misbehaviour on forms with pills: if there is at least one editable element on the first pill,
* the other pills are not checked - independent if there was a definition on the first pill or not.
* Reason: checks happens per pill - if there is no explizit definition on the first pill, take the first editable
* element of that pill.
*/
private
function
checkAutoFocus
()
{
static
$found
=
false
;
$idx
=
false
;
if
(
$found
)
{
return
;
}
// Search if there is an explicit autofocus definition.
for
(
$i
=
0
;
$i
<
count
(
$this
->
feSpecNative
);
++
$i
)
{
// Only check native elements which will be shown
if
(
$this
->
feSpecNative
[
$i
][
FE_CLASS
]
==
FE_CLASS_NATIVE
&&
(
$this
->
feSpecNative
[
$i
][
FE_MODE
]
==
FE_MODE_SHOW
||
$this
->
feSpecNative
[
$i
][
FE_MODE
]
==
FE_MODE_REQUIRED
)
)
{
// Check if there is an explicit definition.
if
(
isset
(
$this
->
feSpecNative
[
$i
][
FE_AUTOFOCUS
]))
{
if
(
$this
->
feSpecNative
[
$i
][
FE_AUTOFOCUS
]
==
''
||
$this
->
feSpecNative
[
$i
][
FE_AUTOFOCUS
]
==
'1'
)
{
$this
->
feSpecNative
[
$i
][
FE_AUTOFOCUS
]
=
'1'
;
// fix to '=1'
}
else
{
unset
(
$this
->
feSpecNative
[
$i
][
FE_AUTOFOCUS
]);
}
$found
=
true
;
return
;
}
if
(
$idx
===
false
)
{
$idx
=
$i
;
}
}
}
// No explicit definition found: take the first found editable element.
if
(
$idx
!==
false
)
{
$found
=
true
;
// No explicit definition found: set autofocus.
$this
->
feSpecNative
[
$idx
][
FE_AUTOFOCUS
]
=
'1'
;
}
}
/**
* Process all FormElements: build corresponding HTML code. Collect and return all HTML code.
*
...
...
@@ -537,6 +439,55 @@ abstract class AbstractBuildForm {
return
$html
;
}
/**
* Check if there is an explicit 'autofocus' definition in at least one FE.
* Found: do nothing, it will be rendered at the correct position.
* Not found: set 'autofocus' on the first FE.
*
* Accepted misbehaviour on forms with pills: if there is at least one editable element on the first pill,
* the other pills are not checked - independent if there was a definition on the first pill or not.
* Reason: checks happens per pill - if there is no explizit definition on the first pill, take the first editable
* element of that pill.
*/
private
function
checkAutoFocus
()
{
static
$found
=
false
;
$idx
=
false
;
if
(
$found
)
{
return
;
}
// Search if there is an explicit autofocus definition.
for
(
$i
=
0
;
$i
<
count
(
$this
->
feSpecNative
);
++
$i
)
{
// Only check native elements which will be shown
if
(
$this
->
feSpecNative
[
$i
][
FE_CLASS
]
==
FE_CLASS_NATIVE
&&
(
$this
->
feSpecNative
[
$i
][
FE_MODE
]
==
FE_MODE_SHOW
||
$this
->
feSpecNative
[
$i
][
FE_MODE
]
==
FE_MODE_REQUIRED
)
)
{
// Check if there is an explicit definition.
if
(
isset
(
$this
->
feSpecNative
[
$i
][
FE_AUTOFOCUS
]))
{
if
(
$this
->
feSpecNative
[
$i
][
FE_AUTOFOCUS
]
==
''
||
$this
->
feSpecNative
[
$i
][
FE_AUTOFOCUS
]
==
'1'
)
{
$this
->
feSpecNative
[
$i
][
FE_AUTOFOCUS
]
=
'1'
;
// fix to '=1'
}
else
{
unset
(
$this
->
feSpecNative
[
$i
][
FE_AUTOFOCUS
]);
}
$found
=
true
;
return
;
}
if
(
$idx
===
false
)
{
$idx
=
$i
;
}
}
}
// No explicit definition found: take the first found editable element.
if
(
$idx
!==
false
)
{
$found
=
true
;
// No explicit definition found: set autofocus.
$this
->
feSpecNative
[
$idx
][
FE_AUTOFOCUS
]
=
'1'
;
}
}
abstract
public
function
fillWrapLabelInputNote
(
$label
,
$input
,
$note
);
abstract
public
function
tail
();
...
...
Write
Preview
Markdown
is supported
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