Commit 5edbea52 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Feature #4511 / Form: URL Forward - mode dynamic computed - implemented

parent 5eb78cfb
...@@ -1644,9 +1644,9 @@ Definition ...@@ -1644,9 +1644,9 @@ Definition
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
|Show button | 'new, delete, close, save' (Default: 'new,delete,close,save'): Shown named buttons in the upper right corner of the form. See `form-showButton`_ | |Show button | 'new, delete, close, save' (Default: 'new,delete,close,save'): Shown named buttons in the upper right corner of the form. See `form-showButton`_ |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
|Forward | 'client | no | url | url-skip-history' (Default: client): See `form-forward`_. | |Forward Mode | 'client | no | url | url-skip-history' (Default: client): See `form-forward`_. |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
|Forward Page | URL or Typo3 page id/alias. See `form-forward`_. | |Forward (Mode) Page | a) URL / Typo3 page id/alias or b) Forward Mode (via '{{...}}') or combination of a) & b). See `form-forward`_. |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
|Parameter | Misc additional parameters. See `form-parameter`_. | |Parameter | Misc additional parameters. See `form-parameter`_. |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
...@@ -1774,12 +1774,27 @@ Only with `Forward` == `url` | `url-skip-history`, the definition of `Forward UR ...@@ -1774,12 +1774,27 @@ Only with `Forward` == `url` | `url-skip-history`, the definition of `Forward UR
Forward URL / Page Forward URL / Page
'''''''''''''''''' ''''''''''''''''''
Possible values: Type: dynamic URL/Page
^^^^^^^^^^^^^^^^^^^^^^
* `forwardPage=http://john-doe.com` - fix URL.
* `forwardPage=?thanks` - fix Typo3 alias or page id, inside current Typo3 installation.
* `forwardPage=?id=thanks` - same as above, but more complete notation.
* `forwardPage={{SELECT ... }}` - dynamically calculated, after all processing is done. This is very usefull, to redirect to different
targets, depending on user input or other dependency/ies.
Type: dynamic Mode
^^^^^^^^^^^^^^^^^^
* Specify in `forwardPage` any of the forward modes: `forwardPage=no | client | url | url-skip-history`,
* Or vua an SQL statement: `forwardPage={{SELECT IF('{{formModeGlobal:S:anumx)}}'='requiredOff', 'no', 'client') }}`
Type: combined dynamic mode & URL/page
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Syntax: `forwardPage=<mode>|<page>`
* `http://john-doe.com` - fix URL. * `forwardPage={{SELECT IF(a.url='','no','url'), '|', a.url FROM address AS a }}`
* `?thanks` - fix URL, inside current Typo3 installation.
* `{{SELECT ... }}` - dynamically calculated, after all processing is done. This is very usefull, to redirect to different
targets, depending on user input or whatever.
.. _form-parameter: .. _form-parameter:
......
...@@ -169,6 +169,21 @@ class QuickFormQuery { ...@@ -169,6 +169,21 @@ class QuickFormQuery {
public function getForwardMode() { public function getForwardMode() {
$forwardPage = $this->eval->parse($this->formSpec[F_FORWARD_PAGE]); $forwardPage = $this->eval->parse($this->formSpec[F_FORWARD_PAGE]);
// Format: [mode/url][|url]
$forwardArray = explode('|', $forwardPage, 2);
switch ($forwardArray[0]) {
case F_FORWARD_MODE_CLIENT:
case F_FORWARD_MODE_NO:
case F_FORWARD_MODE_URL:
case F_FORWARD_MODE_URL_SKIP_HISTORY:
case F_FORWARD_MODE_URL_SIP:
$this->formSpec[F_FORWARD_MODE] = $forwardArray[0];
if (isset($forwardArray[1])) {
$forwardPage = $forwardArray[1];
}
}
if ($this->formSpec[F_FORWARD_MODE] == F_FORWARD_MODE_URL_SIP) { if ($this->formSpec[F_FORWARD_MODE] == F_FORWARD_MODE_URL_SIP) {
$forwardPage = store::getSipInstance()->queryStringToSip($forwardPage, RETURN_URL); $forwardPage = store::getSipInstance()->queryStringToSip($forwardPage, RETURN_URL);
// F_FORWARD_MODE_URL_SIP is not defined in API PROTOCOL. At the moment it's only used for 'copyForm'. // F_FORWARD_MODE_URL_SIP is not defined in API PROTOCOL. At the moment it's only used for 'copyForm'.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment