Reputation: 1593
How can I disable or hide the Hide/Unhide button in the TYPO3 backend list module for certain tables? I want to prevent the BE user from clicking it.
Only thing i found is options.disableDelete.[tableName]
which only disables the delete button.
Upvotes: 0
Views: 1190
Reputation: 10790
You could disable the possibility to edit the field for a user by disabling the field or make it readonly. Change the TCA of this record with a condition for this user/usergroup. alternative you can add the required TSconfig to the be_usergroup.
BUT: your users won't be able to add active records. by default new records are disabled/hidden. trying to enable them would require edit option for this field.
If you only do not display the field the users would be able to disable the records with the record options (record context menu or icon in list view)
Upvotes: 1
Reputation: 789
You can do that by removing the "disabled" field of the enablecolumns configuration in the TCA for the table.
To do that, add a TCA override configuration file in your extension for the table you want to override. In my example I'm using "tt_content" (though you should probably not do this for core tables; it might have unintended side effects).
Create the php file your_ext/Configuration/TCA/Overrides/tt_content.php
and add into it the following lines:
if (isset ($GLOBALS['TCA']['tt_content']['ctrl']['enablecolumns']['disabled'])) {
unset($GLOBALS['TCA']['tt_content']['ctrl']['enablecolumns']['disabled']);
}
Or if it's a custom extension with your own tables, simply choose the correct TCA file e.g. Configuration/TCA/tx_some_table_name.php
and remove the 'disabled' => 'hidden',
line.
A look into the TCA of the tt_content table in the Configuration module ("lowlevel" extension needs to be enabled if you can't find it), should now have the "disabled" key removed.
Note however, that this is a global setting and applies to the whole of TYPO3, for all users and all sites.
Upvotes: 0