Skip to content

Commit

Permalink
[TASK] Merge properties to selectCheckbox (#1142)
Browse files Browse the repository at this point in the history
Releases: main, 12.4
  • Loading branch information
linawolf authored Aug 5, 2024
1 parent c481da5 commit fef94ef
Show file tree
Hide file tree
Showing 32 changed files with 774 additions and 124 deletions.
26 changes: 0 additions & 26 deletions Documentation/ColumnsConfig/Type/Select/CheckBox/Examples.rst

This file was deleted.

117 changes: 106 additions & 11 deletions Documentation/ColumnsConfig/Type/Select/CheckBox/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,120 @@ selectCheckBox
==============

This page describes the :ref:`select <columns-select>` type with
renderType='selectCheckBox'.
renderType='selectCheckBox'. For differences to `type="check"` see
:ref:`selectCheckBox-check-compared`.

.. contents:: Table of contents

.. toctree::
:titlesonly:

DifferenceSelectCheckbox

.. _tca_example_select_checkbox_1:

Example: Simple select checkbox with 3 possible values
======================================================

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

The select checkbox stores the values as comma separated values.

.. include:: /CodeSnippets/SelectCheckbox1.rst.txt

.. _tca_example_select_checkbox_7:

Example: Select checkbox with icons and groups
==============================================

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

The select checkbox stores the values as comma separated values.

.. include:: /CodeSnippets/SelectCheckbox7.rst.txt

The field in the database is of type text or varchar.

.. code-block::sql
.. _columns-select-selectCheckBox-properties:

CREATE TABLE tx_styleguide_elements_select (
select_checkbox_7 text,
);
Properties of the TCA column type `select` with renderType `selectCheckBox`
===========================================================================

.. toctree::
:titlesonly:
.. confval-menu::
:display: table
:type:
:Scope:

Examples
DifferenceSelectCheckbox
Properties
.. include:: _Properties/_AllowNonIdValues.rst.txt
:show-buttons:

.. include:: _Properties/_Appearance.rst.txt
:show-buttons:

.. include:: _Properties/_AuthMode.rst.txt
:show-buttons:

.. include:: _Properties/_AuthModeEnforce.rst.txt
:show-buttons:

.. include:: _Properties/_AutoSizeMax.rst.txt
:show-buttons:

.. include:: _Properties/_Behaviour.rst.txt
:show-buttons:

.. include:: _Properties/_DbFieldLength.rst.txt
:show-buttons:

.. include:: _Properties/_Default.rst.txt
:show-buttons:

.. include:: _Properties/_DisableNonMatchingValueElement.rst.txt
:show-buttons:

.. include:: _Properties/_DontRemapTablesOnCopy.rst.txt
:show-buttons:

.. include:: _Properties/_FieldInformation.rst.txt
:show-buttons:

.. include:: _Properties/_FieldWizard.rst.txt
:show-buttons:

.. include:: _Properties/_FileFolderConfig.rst.txt
:show-buttons:

.. include:: _Properties/_ForeignTable.rst.txt
:show-buttons:

.. include:: _Properties/_ForeignTablePrefix.rst.txt
:show-buttons:

.. include:: _Properties/_ForeignTableWhere.rst.txt
:show-buttons:

.. include:: _Properties/_ItemGroups.rst.txt
:show-buttons:

.. include:: _Properties/_Items.rst.txt
:show-buttons:

.. include:: _Properties/_ItemsProcFunc.rst.txt
:show-buttons:

.. include:: _Properties/_Maxitems.rst.txt
:show-buttons:

.. include:: _Properties/_Minitems.rst.txt
:show-buttons:

.. include:: _Properties/_Mm.rst.txt
:show-buttons:

.. include:: _Properties/_Multiple.rst.txt
:show-buttons:

.. include:: _Properties/_ReadOnly.rst.txt
:show-buttons:

.. include:: _Properties/_Size.rst.txt
:show-buttons:
49 changes: 0 additions & 49 deletions Documentation/ColumnsConfig/Type/Select/CheckBox/Properties.rst

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.. confval:: allowNonIdValues
:name: select-checkbox-allowNonIdValues
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']
:type: boolean
:Scope: Proc.
:RenderType: all

Only useful if :confval:`select-checkbox-foreign-table` is enabled.

If set, then values which are not integer ids will be allowed. May be needed
if you use itemsProcFunc or just enter additional items in the items array
to produce some string-value elements for the list.

.. note::
If you mix non-database relations with database relations like this, DO
NOT use integers for values and DO NOT use "\_" (underscore) in values
either! Will not work if you also use "MM" relations!
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

.. _columns-select-properties-appearance-selectCheckBox:

.. confval:: appearance
:name: select-check-appearance

.. confval:: selectCheckBox
:name: select-appearance-selectCheckBox
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['appearance']['selectCheckBox']
:type: array
:Scope: Display

Options for refining the appearance of `selectCheckBox` fields.

expandAll (boolean)
If set, all select groups are initially expanded.

.. _tca_example_select_checkbox_5:

.. rubric:: Example: Select checkbox, all divs expanded

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

.. include:: /CodeSnippets/SelectCheckbox5.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.. _columns-select-checkbox-properties-authmode:

.. confval:: authMode
:name: select-checkbox-authMode
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']
:type: string (keyword)
:Scope: Display / Proc.
:RenderType: all

.. versionchanged:: 12.0
The only valid value for TCA config option :php:`authMode` is now :php:`explicitAllow`.
The values :php:`explicitDeny` and :php:`individual` are obsolete and no longer evaluated.

Authorization mode for the selector box. The only possible option is:

explicitAllow
All static values from the "items" array of the selector box will be added to a matrix in the backend user
configuration where a value must be explicitly selected if a user (other than admin) is allowed to use it!)

.. rubric:: Migration: Using authMode='explicitDeny'

The "deny list" approach for single field values has been removed, the only allowed option
for :php:`authMode` is :php:`explicitAllow`. Extensions using config value :php:`explicitDeny`
should be adapted to switch to :php:`explicitAllow` instead. The upgrade wizard
"Migrate backend groups "explicit_allowdeny" field to simplified format." that transfers
existing :sql:`be_groups` rows to the new format, **drops** any :sql:`DENY` fields and instructs
admins to not set new access rights of affected backend groups.

.. rubric:: Migration: Using authMode='individual'

Handling of :php:`authMode` being set to :php:`individual` has been fully dropped.
The Core provides no alternative. This has been an obscure setting ever since and there is no
direct migration. Extensions that rely on this handling need to find a substitution based on
Core hooks, Core events or other existing Core API functionality.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

.. _columns-select-checkbox-properties-authmode-enforce:

.. versionchanged:: 12.0
Handling of TCA config option :php:`authMode_enforce` has been removed.

Migration: Using authMode_enforce='strict'

Extensions with select fields using :php:`authMode` previously had different handling
if :php:`authMode_enforce => 'strict'` has been set: Let us say an editor accesses a record
with an :php:`authMode` field being set to a value it has no access to. With :php:`authMode_enforce`
**not** being set to :php:`strict`, the editor was still able to edit the record and set the value
to something it had access to. With :php:`authMode_enforce` being set to :php:`strict`, the editor
was not allowed to access the record. This has been streamlined: The backend interface no longer
renders those records for the editor and an "access denied" message is rendered instead. To
prevent this, a group this editor is member of needs to be adapted to allow access to this
particular value in the "Explicitly allow field values" (:sql:`explicit_allowdeny`) field.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

.. confval:: autoSizeMax
:name: select-checkbox-autoSizeMax
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']
:type: integer
:Scope: Display

The maximum size (height) of the select field.

The size of the select field will be automatically adjusted based on
the number of selected items. The select field will never be smaller than
the specified :confval:`size <select-checkbox-size>` and never larger than
the value of `autoSizeMax`.

.. note::
Only has an effect if :confval:`maxitems <select-checkbox-maxitems>` is
greater than 1.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.. confval:: behaviour
:name: select-checkbox-behaviour

.. confval:: allowLanguageSynchronization
:type: boolean
:name: select-checkbox-behaviour-allowLanguageSynchronization
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['behaviour']['allowLanguageSynchronization']
:Scope: Proc.
:default: false

Allows an editor to select in a localized record whether the value is copied
over from default or source language record, or if the field has an own value
in the localization. If set to true and if the table supports localization
and if a localized record is edited, this setting enables FieldWizard
:ref:`LocalizationStateSelector <columns-input-properties-fieldWizard-localizationStateSelector>`:
Two or three radio buttons shown below the field input. The state of this is
stored in a json encoded array in the database table called :code:`l10n_state`.
It tells the DataHandler which fields of the localization records should be kept
in sync if the underlying default or source record changes.

.. literalinclude:: _Snippets/_AllowLanguageSynchronization.php
:caption: EXT:my_extension/Configuration/TCA/Overrides/someTable.php

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

.. confval:: dbFieldLength
:name: select-checkbox-dbFieldLength
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']
:type: integer
:Default: 255
:Scope: Proc.

.. versionadded:: 13.0
As TYPO3 takes care of
:ref:`generating the according database field <t3coreapi:auto-generated-db-structure>`
for `select` fields since TYPO3 v13, a developer can adjust the length
of the database field with this option in TCA directly.

The TCA config option :php:`dbFieldLength` contains an integer value
that is applied to :sql:`varchar` fields (not :sql:`text`) and defines the
length of the database field. It will not be respected for fields that
resolve to an integer type. Developers who wish to optimize field length can
use :php:`dbFieldLength` for :php:`type=select` fields to increase or
decrease the default length.

.. rubric:: Example: Increase the dbFieldLength for a select field

.. literalinclude:: _Snippets/_DbFieldLength.php
:caption: Excerpt from EXT:my_extension/Configuration/TCA/myextension_domain_model_mytable.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.. _columns-select-checkbox-properties-default:

.. confval:: default
:name: select-checkbox-default
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']
:type: string
:Scope: Display / Proc.
:RenderType: all

Default value set if a new record is created. If empty, the first element in
the items array is selected.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.. _columns-select-checkbox-properties-disablenomatchingvalueelement:

.. confval:: disableNoMatchingValueElement
:name: select-checkbox-disableNoMatchingValueElement
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']
:type: boolean
:Scope: Display
:RenderType: all

If set, then no element is inserted if the current value does not match
any of the existing elements. A corresponding options is also found in Page
TSconfig.
Loading

0 comments on commit fef94ef

Please sign in to comment.