|
@@ -33,10 +33,24 @@ class AclMatrixType extends AbstractType
|
|
|
$aclValueType = $options['acl_value'] instanceof UserInterface ? 'user' : 'role';
|
|
|
$aclValueData = $options['acl_value'] instanceof UserInterface ? $options['acl_value']->getUsername() : $options['acl_value'];
|
|
|
|
|
|
- $builder->add($aclValueType, 'hidden', array('data' => $aclValueData));
|
|
|
+ $builder->add(
|
|
|
+ $aclValueType,
|
|
|
+ // NEXT_MAJOR: remove when dropping Symfony <2.8 support
|
|
|
+ method_exists('Symfony\Component\Form\AbstractType', 'getBlockPrefix')
|
|
|
+ ? 'Symfony\Component\Form\Extension\Core\Type\HiddenType'
|
|
|
+ : 'hidden',
|
|
|
+ array('data' => $aclValueData)
|
|
|
+ );
|
|
|
|
|
|
foreach ($options['permissions'] as $permission => $attributes) {
|
|
|
- $builder->add($permission, 'checkbox', $attributes);
|
|
|
+ $builder->add(
|
|
|
+ $permission,
|
|
|
+ // NEXT_MAJOR: remove when dropping Symfony <2.8 support
|
|
|
+ method_exists('Symfony\Component\Form\AbstractType', 'getBlockPrefix')
|
|
|
+ ? 'Symfony\Component\Form\Extension\Core\Type\CheckboxType'
|
|
|
+ : 'checkbox',
|
|
|
+ $attributes
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
|