Skip to content

Commit

Permalink
[Backport 12.4] [TASK] Overhaul fieldwizard and fieldcontroll (#994)
Browse files Browse the repository at this point in the history
[TASK] Overhaul fieldwizard and fieldcontroll

* Correct indentation,
* add names for confvals

releases: main, 12.4, 11.5

Co-authored-by: lina.wolf <[email protected]>
  • Loading branch information
github-actions[bot] and linawolf authored Mar 26, 2024
1 parent 6c7027d commit 1fa97b3
Show file tree
Hide file tree
Showing 10 changed files with 346 additions and 346 deletions.
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
.. include:: /Includes.rst.txt
.. _tca_property_fieldControl_addRecord:
.. include:: /Includes.rst.txt
.. _tca_property_fieldControl_addRecord:

=========
addRecord
=========

.. confval:: addRecord
.. confval:: addRecord
:name: fieldControl-addRecord
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']
:type: array
:Scope: fieldControl
:Types: :ref:`group <columns-group>`

:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']
:type: array
:Scope: fieldControl
:Types: :ref:`group <columns-group>`
Control button to directly add a related record. Leaves the current view and opens a new form to add
a new record. On 'Save and close', the record is directly selected as referenced element
in the `type='group'` field. If multiple tables are :ref:`allowed <columns-group-properties-allowed>`, the
first table from the allowed list is selected, if no specific `table` option is given.

Control button to directly add a related record. Leaves the current view and opens a new form to add
a new record. On 'Save and close', the record is directly selected as referenced element
in the `type='group'` field. If multiple tables are :ref:`allowed <columns-group-properties-allowed>`, the
first table from the allowed list is selected, if no specific `table` option is given.
.. note::

.. note::

The add record control is disabled by default, enable it if needed. It
is shown below the `edit popup` control if not changed by `below` or
`after` settings.
The add record control is disabled by default, enable it if needed. It
is shown below the `edit popup` control if not changed by `below` or
`after` settings.

Examples
========

Select field
------------

.. include:: /Images/Rst/SelectMultiplesidebyside6.rst.txt
.. include:: /Images/Rst/SelectMultiplesidebyside6.rst.txt

.. include:: /CodeSnippets/SelectMultiplesidebyside6.rst.txt
.. include:: /CodeSnippets/SelectMultiplesidebyside6.rst.txt


Group field
-----------

.. include:: /Images/Rst/GroupDb1.rst.txt
.. include:: /Images/Rst/GroupDb1.rst.txt

.. include:: /CodeSnippets/GroupDb1.rst.txt
.. include:: /CodeSnippets/GroupDb1.rst.txt


Select field with options
Expand All @@ -48,73 +48,73 @@ Select field with options
The field controls are also used in the core. The following example is from
the table :sql:`be_groups`:

.. include:: /Images/Rst/FileMountpoints.rst.txt
.. include:: /Images/Rst/FileMountpoints.rst.txt

.. include:: /CodeSnippets/FileMountpoints.rst.txt
.. include:: /CodeSnippets/FileMountpoints.rst.txt

Options
=======

.. confval:: disabled

:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['addRecord']
:type: boolean
:Scope: fieldControl -> addRecord
:Default: true

Disables the field control. Needs to be set to :php:`false` to enable the
:guilabel:`Create new` button

.. confval:: options[pid]

:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['addRecord']
:type: string
:Scope: fieldControl -> addRecord
:Values: marker or an integer
:Default: ###CURRENT_PID###

pid of the new record. Can be an hard pid setting, or one of these markers,
see :ref:`select foreign_table_where
<columns-select-properties-foreign-table-where>`.

Falls back to "current pid" if not set, forces pid=0 if records of this
table are only allowed on root level.

- :code:`###CURRENT_PID###`
- :code:`###THIS_UID###`
- :code:`###SITEROOT###`

.. confval:: options[table]

:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['addRecord']
:type: string
:Scope: fieldControl -> addRecord
:Values: name of the table
:Default: First table from property `allowed` / `foreign_table`

Add a record to this table, falls back to first table from
:ref:`allowed <columns-group-properties-allowed>` list if not set for
`type='group'` fields and to :ref:`foreign_table
<columns-select-properties-foreign-table>` for `type='select'` fields.

.. confval:: options[title]

:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['addRecord']
:type: string
:Scope: fieldControl -> addRecord
:Values: string or LLL reference
:Default: LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.createNew

Allows to set a different 'title' attribute to the popup icon.

.. confval:: options[setValue]

:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['addRecord']
:type: string
:Scope: fieldControl -> addRecord
:Values: string
:Default: append

Can be one of 'set', 'prepend' or 'append'. With 'set' the given selection
is substituted with the new record, 'prepend' adds the new record on top of
the list, 'append' adds it at the bottom.
.. confval:: disabled
:name: fieldControl-addRecord-disabled
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['addRecord']
:type: boolean
:Scope: fieldControl -> addRecord
:Default: true

Disables the field control. Needs to be set to :php:`false` to enable the
:guilabel:`Create new` button

.. confval:: options[pid]
:name: fieldControl-addRecord-options-pid
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['addRecord']
:type: string
:Scope: fieldControl -> addRecord
:Values: marker or an integer
:Default: ###CURRENT_PID###

pid of the new record. Can be an hard pid setting, or one of these markers,
see :ref:`select foreign_table_where
<columns-select-properties-foreign-table-where>`.

Falls back to "current pid" if not set, forces pid=0 if records of this
table are only allowed on root level.

- :code:`###CURRENT_PID###`
- :code:`###THIS_UID###`
- :code:`###SITEROOT###`

.. confval:: options[table]
:name: fieldControl-addRecord-options-table
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['addRecord']['options']
:type: string
:Scope: fieldControl -> addRecord
:Values: name of the table
:Default: First table from property `allowed` / `foreign_table`

Add a record to this table, falls back to first table from
:ref:`allowed <columns-group-properties-allowed>` list if not set for
`type='group'` fields and to :ref:`foreign_table
<columns-select-properties-foreign-table>` for `type='select'` fields.

.. confval:: options[title]
:name: fieldControl-addRecord-options-title
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['addRecord']['options']
:type: string
:Scope: fieldControl -> addRecord
:Values: string or LLL reference
:Default: LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.createNew

Allows to set a different 'title' attribute to the popup icon.

.. confval:: options[setValue]
:name: fieldControl-addRecord-options-setValue
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['addRecord']['options']
:type: string
:Scope: fieldControl -> addRecord
:Values: string
:Default: append

Can be one of 'set', 'prepend' or 'append'. With 'set' the given selection
is substituted with the new record, 'prepend' adds the new record on top of
the list, 'append' adds it at the bottom.
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
.. include:: /Includes.rst.txt
.. _tca_property_fieldControl_editPopup:
.. include:: /Includes.rst.txt
.. _tca_property_fieldControl_editPopup:

=========
editPopup
=========

.. confval:: editPopup
.. confval:: editPopup
:name: fieldControl-editPopup
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']
:type: array
:Scope: fieldControl
:Types: :ref:`group <columns-group>`

:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']
:type: array
:Scope: fieldControl
:Types: :ref:`group <columns-group>`
The edit popup field control shows a pencil icon to edit an element directly in a popup window.
When a record is selected and the edit button is clicked, that record opens in a new window for modification.

The edit popup field control shows a pencil icon to edit an element directly in a popup window.
When a record is selected and the edit button is clicked, that record opens in a new window for modification.

.. note::
The edit popup control is pre-configured, but disabled by default. Enable it if you need it, the button
is by default shown below `element browser` and `insert clipboard`.
.. note::
The edit popup control is pre-configured, but disabled by default. Enable it if you need it, the button
is by default shown below `element browser` and `insert clipboard`.

Options
=======

.. confval:: editPopup disabled

:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['editPopup']
:type: boolean
:Scope: fieldControl -> editPopup
:Default: true

Disables the field control. Needs to be set to :php:`false` to enable the
:guilabel:`Create new` button

.. confval:: editPopup options[title]
.. confval:: disabled
:name: fieldControl-editPopup-disabled
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['editPopup']
:type: boolean
:Scope: fieldControl -> editPopup
:Default: true

:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['editPopup']
:type: string
:Scope: fieldControl -> editPopup
:Values: string or LLL reference
:Default: LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.edit
Disables the field control. Needs to be set to :php:`false` to enable the
:guilabel:`Create new` button

Allows to set a different 'title' attribute to the popup icon.
.. confval:: options[title]
:name: fieldControl-editPopup-options-title
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['editPopup']
:type: string
:Scope: fieldControl -> editPopup
:Values: string or LLL reference
:Default: LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.edit

.. confval:: editPopup options[windowOpenParameters]
Allows to set a different 'title' attribute to the popup icon.

:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['editPopup']
:type: string
:Scope: fieldControl -> editPopup
:Values: string or LLL reference
:Default: height=800,width=600,status=0,menubar=0,scrollbars=1
.. confval:: options[windowOpenParameters]
:name: fieldControl-editPopup-options-windowOpenParameters
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['editPopup']
:type: string
:Scope: fieldControl -> editPopup
:Values: string or LLL reference
:Default: height=800,width=600,status=0,menubar=0,scrollbars=1

Allows to set a different size of the popup, defaults
Allows to set a different size of the popup, defaults

Examples
========

Select field
------------

.. include:: /Images/Rst/SelectMultiplesidebyside6.rst.txt
.. include:: /Images/Rst/SelectMultiplesidebyside6.rst.txt

.. include:: /CodeSnippets/SelectMultiplesidebyside6.rst.txt
.. include:: /CodeSnippets/SelectMultiplesidebyside6.rst.txt

Group field
-----------

.. include:: /Images/Rst/GroupDb1.rst.txt
.. include:: /Images/Rst/GroupDb1.rst.txt

.. include:: /CodeSnippets/GroupDb1.rst.txt
.. include:: /CodeSnippets/GroupDb1.rst.txt
44 changes: 22 additions & 22 deletions Documentation/ColumnsConfig/CommonProperties/FieldControl/Index.rst
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
.. include:: /Includes.rst.txt
.. _tca_property_fieldControl:
.. include:: /Includes.rst.txt
.. _tca_property_fieldControl:

============
fieldControl
============

.. confval:: fieldControl
.. confval:: fieldControl
:name: fieldControl
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']
:type: array
:Scope: Display
:Types: :ref:`group <columns-group>`,
:ref:`imageManipulation <columns-imageManipulation>`,
:ref:`input <columns-input>`, :ref:`radio <columns-radio>`

:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']
:type: array
:Scope: Display
:Types: :ref:`group <columns-group>`,
:ref:`imageManipulation <columns-imageManipulation>`,
:ref:`input <columns-input>`, :ref:`radio <columns-radio>`
Show action buttons next to the element. This is used in various type's to
add control buttons right next to the main element. They can open popups,
switch the entire view and other things. All must provide a "button" icon
to click on, see :ref:`FormEngine docs
<t3coreapi:FormEngine-Rendering-NodeExpansion>` for more details.
See :ref:`type=group <columns-group-properties-fieldControl>` for examples.

Show action buttons next to the element. This is used in various type's to
add control buttons right next to the main element. They can open popups,
switch the entire view and other things. All must provide a "button" icon
to click on, see :ref:`FormEngine docs
<t3coreapi:FormEngine-Rendering-NodeExpansion>` for more details.
See :ref:`type=group <columns-group-properties-fieldControl>` for examples.

.. include:: /Images/Rst/SelectMultiplesidebyside6.rst.txt

.. include:: /Images/Rst/SelectMultiplesidebyside6.rst.txt

.. toctree::
AddRecord
EditPopup
ListModule
ResetSelection
.. toctree::
AddRecord
EditPopup
ListModule
ResetSelection
Loading

0 comments on commit 1fa97b3

Please sign in to comment.