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
b54975ba
Commit
b54975ba
authored
Sep 06, 2020
by
Carsten Rose
Browse files
Variable.rst: udpate doc
parent
bba98731
Pipeline
#3775
passed with stages
in 3 minutes and 58 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Documentation/Variable.rst
View file @
b54975ba
...
...
@@ -105,7 +105,7 @@ Example::
* If no store is specified, the default for the searched stores are: **FSRVD** (=FORM > SIP > RECORD > VARS > DEFAULT).
* If the VarName is not found in one store, the next store is searched, up to the last specified store.
* If the VarName is not found and a default value is given, the default is returned.
* If no value is found, nothing is replaced - the string
'
{{<VarName>}}
'
remains.
* If no value is found, nothing is replaced - the string
``
{{<VarName>}}
``
remains.
* If anywhere along the line an empty string is found, this **is** a value: therefore, the search will stop.
.. _`sanitize-class`:
...
...
@@ -117,7 +117,7 @@ Values in STORE_CLIENT *C* (Client=Browser) and STORE_FORM *F* (Form, HTTP 'post
sanitize class. Values from other stores are *not* checked against any sanitize class, even if a sanitize class is specified.
* Variables get by default the sanitize class defined in the corresponding `FormElement`. If not defined,
the default class is
'
digit
'
.
the default class is
``
digit
``
.
* A default sanitize class can be overwritten by individual definition: *{{a:C:alnumx}}*
* If a value violates the specific sanitize class, see :ref:`variable-type-message-violate` for default or customized message.
By default the value becomes `!!<name of sanitize class>!!`. E.g. `!!digit!!`.
...
...
@@ -133,7 +133,7 @@ For QFQ variables and FormElements:
+------------------+------+-------+-----------------------------------------------------------------------------------------+
| **numerical** | Form | Query | [0-9.-+] |
+------------------+------+-------+-----------------------------------------------------------------------------------------+
| **allbut** | Form | Query | All characters allowed, but not [ ] { } % \ #. The used regexp:
'
^[^\[\]{}%\\#]+$',
|
| **allbut** | Form | Query | All characters allowed, but not [ ] { } % \ #. The used regexp:
``
^[^\[\]{}%\\#]+$',
``
|
+------------------+------+-------+-----------------------------------------------------------------------------------------+
| **all** | Form | Query | no sanitizing |
+------------------+------+-------+-----------------------------------------------------------------------------------------+
...
...
@@ -158,8 +158,8 @@ Rules for CheckType Auto (by priority):
* integer type: **digit**
* floating point number: **numerical**
* FE Type
*
'
password
', '
note
'
: **all**
*
'
editor
', '
text
'
and encode =
'
specialchar
'
: **all**
*
``
password
``, ``
note
``
: **all**
*
``
editor
``, ``
text
``
and encode =
``
specialchar
``
: **all**
* None of the above: **alnumx**
...
...
@@ -216,9 +216,9 @@ The following `escape` & `action` types are available:
Escape
^^^^^^
To
'
escape
'
a character typically means: a character, which have a special meaning/function, should not treated as a special
To
*
escape
*
a character typically means: a character, which have a special meaning/function, should not treated as a special
character.
E.g. a string is surrounded by single ticks
'
. If such a string should contain the same single tick inside,
E.g. a string is surrounded by single ticks
``'``
. If such a string should contain the same single tick inside,
the inside single tick has to be escaped - if not, the string end's at the second tick, not the third. This is typically
done by a backlash: \\
...
...
@@ -229,21 +229,21 @@ Especially variables used in SQL statements might cause trouble when using: NUL
Action
^^^^^^
* *password* -
'p'
: transforms the value of the variable into a Typo3 salted password hash. The hash function is the one
* *password* -
``p``
: transforms the value of the variable into a Typo3 salted password hash. The hash function is the one
used by Typo3 to encrypt and salt a password. This is useful to manipulate FE user passwords via QFQ. See :ref:`setFeUserPassword`
* *stop replace* -
'S'
: typically QFQ will replace nested variables as long as there are variables to replace. This options
* *stop replace* -
``S``
: typically QFQ will replace nested variables as long as there are variables to replace. This options
stops this
* *exception* -
'X'
: If a variable is not found in any given store, it's replace by a default value or an error message.
* *exception* -
``X``
: If a variable is not found in any given store, it's replace by a default value or an error message.
In special situation it might be useful to do a full stop on all current actions (no further procession). A custom
message can be defined via: :ref:`variable-type-message-violate`.
.. _`variable-escape-wipe-key`:
* *wipe* -
'w'
: In special cases it might be useful to get a value via SIP only one time and after retrieving the value
it will be deleted in STORE SIP . Further access to the variable will return
'
variable undefined
'
. At time of writing
only the STORE SIP supports the feature
'
wipe
'
. This is useful to suppress any repeating events by using the browser history.
* *wipe* -
``w``
: In special cases it might be useful to get a value via SIP only one time and after retrieving the value
it will be deleted in STORE SIP . Further access to the variable will return
*
variable undefined
*
. At time of writing
only the STORE SIP supports the feature
*
wipe
*
. This is useful to suppress any repeating events by using the browser history.
The following example will send a mail only the first when it is called with a given SIP::
10.sql = SELECT '...' AS _sendmail FROM Person AS p WHERE '{{action:S::w}}'='send' AND p.id={{pId:S}}
...
...
@@ -258,7 +258,7 @@ Default
* Any string can be given to define a default value.
* If a default value is given, it makes no sense to define more than one store: with a default value given, only the
first store is considered.
* If the default value contains a
':'
, that one needs to be escaped by ``\``
* If the default value contains a
``:``
, that one needs to be escaped by ``\``
* For dedicated variables this value has a special meaning. E.g. ``{{randomUniq:V}}`` uses this as ``expire`` argument.
.. _`variable-type-message-violate`:
...
...
@@ -268,11 +268,11 @@ Type message violate
If a value violates the sanitize class, the following actions are possible:
*
'c'
- The violated class will be set as content, surrounded by
'
!!
'
. E.g.
'
!!digit!!
'
. This is the default.
*
'e'
- Instead of the value an empty string will be set as content.
*
'0'
- Instead of the value the string
'0'
will be set as content.
*
'
custom text ...
'
- Instead of the value, the custom text will be set as content. If the text contains a
':'
, that one
needs to be escaped by \\ . Check :ref:`variable-escape` qualifier
'C'
to let QFQ do the colon escaping.
*
``c``
- The violated class will be set as content, surrounded by
*
!!
*
. E.g.
*
!!digit!!
*
. This is the default.
*
``e``
- Instead of the value an empty string will be set as content.
*
``0``
- Instead of the value the string
*0*
will be set as content.
*
*
custom text ...
*
- Instead of the value, the custom text will be set as content. If the text contains a
``:``
, that one
needs to be escaped by \\ . Check :ref:`variable-escape` qualifier
``C``
to let QFQ do the colon escaping.
.. _`sql-variables`:
...
...
@@ -301,7 +301,7 @@ Result: row
"""""""""""
A few functions needs more than a returned string, instead separate columns are necessary. To indicate an array
result, specify those with an
'!':
::
result, specify those with an
``!``
::
{{!SELECT ...}}
...
...
@@ -330,7 +330,7 @@ Example
::
{{SELECT id, name FROM Person}}
{{SELECT id, name, IF({{feUser:T0}}=0,'Yes','No') FROM Person WHERE id={{r:S}} }}
{{SELECT id, name, IF({{feUser:T0}}=0,
'Yes',
'No') FROM Person WHERE id={{r:S}} }}
{{SELECT id, city FROM Address AS adr WHERE adr.accId={{SELECT id FROM Account AS acc WHERE acc.name={{feUser:T0}} }} }}
{{!SELECT id, name FROM Person}}
{{[2]SELECT id, name FROM Form}}
...
...
@@ -345,8 +345,8 @@ Syntax: *{{<level>.<column>}}*
Only used in report to access outer columns. See :ref:`access-column-values` and :ref:`syntax-of-report`.
There might be name conflicts between VarName / SQL keywords and <line identifier>. QFQ checks first for
'
<level>
'
,
than for
'
SQL keywords
'
and than for
'
VarNames
'
in stores.
There might be name conflicts between VarName / SQL keywords and <line identifier>. QFQ checks first for
*
<level>
*
,
than for
*
SQL keywords
*
and than for
*
VarNames
*
in stores.
All types might be nested with each other. There is no limit of nesting variables.
...
...
@@ -364,7 +364,7 @@ Link column variables
^^^^^^^^^^^^^^^^^^^^^
These variables return a link, completely rendered in HTML. The syntax and all features of :ref:`column-link` are available.
The following code will render a
'
new person
'
button::
The following code will render a
*
new person
*
button::
{{p:form&form=Person|s|N|t:new person AS link}}
...
...
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