$update_tree_access =
$taxonomy_vocabulary->
access('reset all weights', NULL, TRUE
);
$form['help'
] =
[ '#type' => 'container',
'message' =>
['#markup' =>
$help_message],
];
$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'
] =
[