$operations_access = !
empty($pending_term_ids) ||
$vocabulary_hierarchy === VocabularyInterface::HIERARCHY_MULTIPLE;
if ($operations_access) { $form['help'
]['#attributes'
]['class'
] =
['messages', 'messages--warning'
];
} $errors =
$form_state->
getErrors();
$row_position = 0;
// Build the actual form.
$access_control_handler =
$this->entityTypeManager->
getAccessControlHandler('taxonomy_term'
);
$create_access =
$access_control_handler->
createAccess($taxonomy_vocabulary->
id(), NULL,
[], TRUE
);
if ($create_access->
isAllowed()) { $empty =
$this->
t('No terms available. <a href=":link">Add term</a>.',
[':link' => Url::
fromRoute('entity.taxonomy_term.add_form',
['taxonomy_vocabulary' =>
$taxonomy_vocabulary->
id()])->
toString()]);
} else { $empty =
$this->
t('No terms available.'
);
} $form['terms'
] =
[ '#type' => 'table',
'#empty' =>
$empty,
'#header' =>
[ 'term' =>
$this->
t('Name'
),