Skip to content

Commit

Permalink
[TASK] Overhaul color type (#998)
Browse files Browse the repository at this point in the history
* Correct indentation,
* add names for confvals

releases: main, 12.4
  • Loading branch information
linawolf authored Mar 26, 2024
1 parent 1c03d51 commit 8c0ec09
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 98 deletions.
22 changes: 11 additions & 11 deletions Documentation/ColumnsConfig/Type/Color/Index.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
.. include:: /Includes.rst.txt
.. include:: /Includes.rst.txt

.. _columns-input-renderType-colorpicker:
.. _columns-color:
.. _columns-input-renderType-colorpicker:
.. _columns-color:

=====
Color
=====

.. versionadded:: 12.0
The TCA type :php:`color` has been introduced. It replaces the
:php:`renderType=colorpicker` of TCA type :php:`input`.
.. versionadded:: 12.0
The TCA type :php:`color` has been introduced. It replaces the
:php:`renderType=colorpicker` of TCA type :php:`input`.

.. versionadded:: 13.0
When using the `color` type, TYPO3 takes care of
Expand All @@ -30,7 +30,7 @@ Examples

A simple color picker:

.. code-block:: php
.. code-block:: php
'a_color_field' => [
'label' => 'Color field',
Expand All @@ -46,7 +46,7 @@ Migration
A complete migration from :php:`renderType=colorpicker` to :php:`type=color`
looks like the following:

.. code-block:: php
.. code-block:: php
// Before
Expand Down Expand Up @@ -87,7 +87,7 @@ An automatic TCA migration is performed on the fly, migrating all occurrences
to the new TCA type and triggering a PHP :php:`E_USER_DEPRECATED` error
where code adoption has to take place.

.. toctree::
:titlesonly:
.. toctree::
:titlesonly:

Properties/Index
Properties/Index
36 changes: 18 additions & 18 deletions Documentation/ColumnsConfig/Type/Color/Properties/Index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. include:: /Includes.rst.txt
.. _columns-color-properties:
.. include:: /Includes.rst.txt
.. _columns-color-properties:

==========
Properties
Expand All @@ -8,26 +8,26 @@ Properties
Special properties
==================

.. toctree::
:titlesonly:
:glob:
.. toctree::
:titlesonly:
:glob:

*
*

Common properties
=================

* :ref:`behaviour > allowLanguageSynchronization <tca_property_behaviour_allowLanguageSynchronization>`
* :ref:`default <tca_property_default>`
* :ref:`fieldControl <tca_property_fieldControl>`
* :ref:`fieldInformation <tca_property_fieldInformation>`
* :ref:`fieldWizard <tca_property_fieldWizard>` with the following options
* :ref:`behaviour > allowLanguageSynchronization <tca_property_behaviour_allowLanguageSynchronization>`
* :ref:`default <tca_property_default>`
* :ref:`fieldControl <tca_property_fieldControl>`
* :ref:`fieldInformation <tca_property_fieldInformation>`
* :ref:`fieldWizard <tca_property_fieldWizard>` with the following options

* :ref:`defaultLanguageDifferences <tca_property_fieldwizard>`
* :ref:`localizationStateSelector <tca_property_fieldWizard_localizationStateSelector>`
* :ref:`otherLanguageContent <tca_property_fieldWizard_otherLanguageContent>`
* :ref:`defaultLanguageDifferences <tca_property_fieldwizard>`
* :ref:`localizationStateSelector <tca_property_fieldWizard_localizationStateSelector>`
* :ref:`otherLanguageContent <tca_property_fieldWizard_otherLanguageContent>`

* :ref:`mode <tca_property_mode>`
* :ref:`placeholder <tca_property_placeholder>`
* :ref:`readOnly <tca_property_readOnly>`
* :ref:`required <tca_property_required>`
* :ref:`mode <tca_property_mode>`
* :ref:`placeholder <tca_property_placeholder>`
* :ref:`readOnly <tca_property_readOnly>`
* :ref:`required <tca_property_required>`
56 changes: 28 additions & 28 deletions Documentation/ColumnsConfig/Type/Color/Properties/Nullable.rst
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
.. include:: /Includes.rst.txt
.. _columns-color-properties-nullable:
.. include:: /Includes.rst.txt
.. _columns-color-properties-nullable:

========
nullable
========

.. versionchanged:: 12.0
This option was introduced to replace the TCA :php:`eval` option with
:php:`null` as value.
.. versionchanged:: 12.0
This option was introduced to replace the TCA :php:`eval` option with
:php:`null` as value.

.. confval:: nullable (type => color)
.. confval:: nullable
:name: color-nullable
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']
:type: boolean
:Default: false
:Scope: Proc

:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']
:type: boolean
:Default: false
:Scope: Proc
If set to true, a checkbox will appear, which by default deactivates the
field. In the deactivated state the field is saved as :sql:`NULL` in the
database. By activating the checkbox it is possible to set a value.
If nothing is entered into the field, then an empty string will be saved and not a :sql:`NULL`.

If set to true, a checkbox will appear, which by default deactivates the
field. In the deactivated state the field is saved as :sql:`NULL` in the
database. By activating the checkbox it is possible to set a value.
If nothing is entered into the field, then an empty string will be saved and not a :sql:`NULL`.

The database field must allow the :sql:`NULL` value.
The database field must allow the :sql:`NULL` value.

Example:

.. code-block:: php
:caption: EXT:some_extension/Configuration/TCA/tx_sometable.php
'columns' => [
'nullable_column' => [
'title' => 'A nullable field',
'config' => [
'type' => 'color',
'nullable' => true,
],
],
],
.. code-block:: php
:caption: EXT:some_extension/Configuration/TCA/tx_sometable.php
'columns' => [
'nullable_column' => [
'title' => 'A nullable field',
'config' => [
'type' => 'color',
'nullable' => true,
],
],
],
20 changes: 10 additions & 10 deletions Documentation/ColumnsConfig/Type/Color/Properties/Size.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
.. include:: /Includes.rst.txt
.. _columns-color-properties-size:
.. include:: /Includes.rst.txt
.. _columns-color-properties-size:

====
size
====

.. confval:: size (type => color)
.. confval:: size
:name: color-size
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']
:type: integer
:Scope: Display

:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']
:type: integer
:Scope: Display

Abstract value for the width of the :code:`<input>` field. To set the
field to the full width of the form area, use the value 50. Minimum is 10.
Default is 30.
Abstract value for the width of the :code:`<input>` field. To set the
field to the full width of the form area, use the value 50. Minimum is 10.
Default is 30.
62 changes: 31 additions & 31 deletions Documentation/ColumnsConfig/Type/Color/Properties/ValuePicker.rst
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
.. include:: /Includes.rst.txt
.. _columns-color-properties-valuePicker:
.. include:: /Includes.rst.txt
.. _columns-color-properties-valuePicker:

===========
valuePicker
===========

.. confval:: valuePicker (type => color)
.. confval:: valuePicker
:name: color-valuePicker
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']
:type: array
:Scope: Display

:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']
:type: array
:Scope: Display
Renders a select box with static values next to the input field. When a
value is selected in the box, the value is transferred to the field. Keys:

Renders a select box with static values next to the input field. When a
value is selected in the box, the value is transferred to the field. Keys:
items (array)
An array with selectable items. Each item is an array with the first value being the label in the select
drop-down (LLL reference possible) the second being the hex-value transferred to the input field.
The value should have exactly 7 characters, as this is the maximum for a hex-value.

items (array)
An array with selectable items. Each item is an array with the first value being the label in the select
drop-down (LLL reference possible) the second being the hex-value transferred to the input field.
The value should have exactly 7 characters, as this is the maximum for a hex-value.
.. note::

.. note::

The :php:`valuePicker` allows to define default color codes via :php:`items`
for a TCA type :php:`color` field.
The :php:`valuePicker` allows to define default color codes via :php:`items`
for a TCA type :php:`color` field.

Example
=======

.. code-block:: php
'a_color_field' => [
'label' => 'Color field',
'config' => [
'type' => 'color',
'required' => true,
'size' => 20,
'valuePicker' => [
'items' => [
['typo3 orange', '#FF8700'],
],
],
]
]
.. code-block:: php
'a_color_field' => [
'label' => 'Color field',
'config' => [
'type' => 'color',
'required' => true,
'size' => 20,
'valuePicker' => [
'items' => [
['typo3 orange', '#FF8700'],
],
],
],
],

0 comments on commit 8c0ec09

Please sign in to comment.