Closed m-vo closed 8 years ago
Hi, I don't really get the issue here. Can you explain a bit more or maybe even provide a pull request fixing the issue?
Sure. :-)
I added that to my list/operations part in the dca:
[...]
'toggle' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_foo]['toggle'],
'attributes' => 'onclick="Backend.getScrollOffset();"',
'haste_ajax_operation' => [
'field' => 'someField',
'options' => [
[
'value' => '',
'icon' => 'invisible.gif'
],
[
'value' => '1',
'icon' => 'visible.gif'
]
]
]
),
The corresponding field looks like this:
[...]
'someField' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_foo']['someField'],
'default' => true,
'inputType' => 'checkbox',
'eval' => array('isBoolean'=>true),
'sql' => "char(1) NOT NULL default ''"
),
Now only administrators can see the 'visible'-icon in the backend and therefore toggle someField
. It's accessible for all users when editing an entry though. To get it working I had to add 'exclude' => true
to the field definition and allow it in the user group (section: allowed fields).
I always thought if exclude
is not set it's allowed for everyone?
Fixed in 5a2767d.
The ajax toggle operation ('eye on/off') is not shown in the backend for non-admins if the dca-column does not have
exclude = true
set and the field is explicitly allowed for the user/group.