editlock¶
-
editlock
¶ -
- Type
- string (field name)
- Path
- $GLOBALS['TCA'][$table]['ctrl']
- Scope
- Proc. / Display
Changed in version 13.3
The column definition is auto-created.
Field name, which – if set – will prevent all editing of the record for non-admin users.
The field should be configured as a checkbox type. Non-admins could be allowed to edit the checkbox but if they set it, they will effectively lock the record so they cannot edit it again – and they need an Admin-user to remove the lock.
Note that this flag is cleared when a new copy or version of the record is created.
This feature is used on the pages table, where it also prevents editing of records on that page (except other pages)! Also, no new records (including pages) can be created on the page.
Warning
Columns created automatically by being defined by this property still need to be added manually to the palettes and types definition.
Due to the TCA loading order these columns are only created if the according ctrl property was added in the original definition in
Configuration/TCA/<tablename>.php
, not if they were defined in the overrides likeConfiguration/TCA/Overrides/something.php
.
Example: A table with editlock¶
If the checkbox is set, the affected record can only be edited by admins.
<?php
return [
'ctrl' => [
'enablecolumns' => [
'editlock' => 'editlock',
],
// ...
],
'palettes' => [
'access' => [
'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.access',
'showitem' => '
editlock
',
],
],
'types' => [
0 => [
'showitem' => '
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
[...],
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access,
--palette--;;access,
',
],
],
];