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
b1a60df4
Commit
b1a60df4
authored
Mar 30, 2017
by
Carsten Rose
Browse files
#3466 / Input Typeahead: optional only allow specified input
Implementation started - code is broken
parent
eec448c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
extension/qfq/qfq/Constants.php
View file @
b1a60df4
...
...
@@ -399,6 +399,7 @@ const MODE_DB_NO_LOG = 'noLog';
// PHP class Typeahead
const
TYPEAHEAD_API_QUERY
=
'query'
;
// Name of parameter in API call of typeahead.php?query=...&s=... - See also FE_TYPE_AHEAD_SQL
const
TYPEAHEAD_API_PREFETCH
=
'prefetch'
;
// Name of parameter in API call of typeahead.php?prefetch=...&s=... - See also FE_TYPE_AHEAD_SQL
const
TYPEAHEAD_API_SIP
=
'sip'
;
// Name of parameter in API call of typeahead.php?query=...&s=...
const
TYPEAHEAD_DEFAULT_LIMIT
=
20
;
const
TYPEAHEAD_SQL_KEY_NAME
=
'id'
;
...
...
extension/qfq/qfq/form/TypeAhead.php
View file @
b1a60df4
...
...
@@ -34,11 +34,12 @@ class TypeAhead {
*/
public
function
__construct
(
$phpUnit
=
false
)
{
if
(
!
isset
(
$_GET
[
TYPEAHEAD_API_QUERY
])
||
!
isset
(
$_GET
[
TYPEAHEAD_API_SIP
]))
{
throw
new
CodeException
(
'Missing GET parameter "'
.
TYPEAHEAD_API_SIP
.
'" or "'
.
TYPEAHEAD_API_QUERY
.
'"'
);
if
(
(
!
isset
(
$_GET
[
TYPEAHEAD_API_QUERY
])
&&
!
isset
(
$_GET
[
TYPEAHEAD_API_PREFETCH
]))
||
!
isset
(
$_GET
[
TYPEAHEAD_API_SIP
]))
{
throw
new
CodeException
(
'Missing GET parameter "'
.
TYPEAHEAD_API_SIP
.
'" or "'
.
TYPEAHEAD_API_QUERY
.
'" or "'
.
TYPEAHEAD_API_PREFETCH
.
'"'
);
}
$this
->
vars
[
TYPEAHEAD_API_QUERY
]
=
$_GET
[
TYPEAHEAD_API_QUERY
];
$this
->
vars
[
TYPEAHEAD_API_QUERY
]
=
isset
(
$_GET
[
TYPEAHEAD_API_QUERY
])
?
$_GET
[
TYPEAHEAD_API_QUERY
]
:
''
;
$this
->
vars
[
TYPEAHEAD_API_PREFETCH
]
=
isset
(
$_GET
[
TYPEAHEAD_API_PREFETCH
])
?
$_GET
[
TYPEAHEAD_API_PREFETCH
]
:
''
;
$this
->
vars
[
TYPEAHEAD_API_SIP
]
=
$_GET
[
TYPEAHEAD_API_SIP
];
$session
=
Session
::
getInstance
(
$phpUnit
);
...
...
@@ -66,6 +67,7 @@ class TypeAhead {
$arr
=
$this
->
typeAheadSql
(
$sipVars
,
$this
->
vars
[
TYPEAHEAD_API_QUERY
]);
}
elseif
(
isset
(
$sipVars
[
FE_LDAP_SERVER
]))
{
$ldap
=
new
Ldap
();
//TODO hier weiter machen mit Implementierung PREFETCH
$arr
=
$ldap
->
process
(
$sipVars
,
$this
->
vars
[
TYPEAHEAD_API_QUERY
]);
}
...
...
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