public function EventTypeAccessDefaultsForm::actionRows in RNG - Events and Registrations 3.x
Same name and namespace in other branches
- 8.2 src/Form/EventTypeAccessDefaultsForm.php \Drupal\rng\Form\EventTypeAccessDefaultsForm::actionRows()
- 8 src/Form/EventTypeAccessDefaultsForm.php \Drupal\rng\Form\EventTypeAccessDefaultsForm::actionRows()
1 call to EventTypeAccessDefaultsForm::actionRows()
- EventTypeAccessDefaultsForm::buildForm in src/
Form/ EventTypeAccessDefaultsForm.php - Form constructor.
File
- src/
Form/ EventTypeAccessDefaultsForm.php, line 256
Class
- EventTypeAccessDefaultsForm
- Form for event type access defaults.
Namespace
Drupal\rng\FormCode
public function actionRows($rule, array $operations, $scope_all, $supports_create) {
$rowspan = count($rule
->getConditions());
// Actions.
if ($action = $rule
->getAction('registration_operations')) {
$row = [];
// Operations granted.
$config = $action['configuration'];
foreach ($operations as $op => $t) {
$disabled = $op == 'create' && $supports_create != count($rule
->getConditions());
if ($disabled) {
$row[] = [
'#plain_text' => $this
->t('N/A'),
'#wrapper_attributes' => [
'class' => [
'checkbox',
],
],
];
}
else {
$row[] = [
'#type' => 'checkbox',
'#title' => $this
->t('@operation', [
'@operation' => $t,
]),
'#title_display' => 'invisible',
'#default_value' => !empty($config['operations'][$op]),
'#parents' => [
'actions',
'operations',
$rule
->getMachineName(),
$op,
],
'#wrapper_attributes' => [
'class' => [
'checkbox',
],
'rowspan' => $rowspan,
],
];
}
}
return $row;
}
}