<?php
$translate = $this->plugin('translate');
$escape = $this->plugin('escapeHtml');
$this->htmlElement('body')->appendAttribute('class', 'edit item-sets');
$deleteButton = $itemSet->userIsAllowed('delete')
    ? '<a href="#" class="delete button">' . $translate('Delete') . '</a>'
    : null;
?>

<script type='text/javascript'>
var valuesJson = <?php echo json_encode($itemSet->values()); ?>;
</script>

<?php echo $this->pageTitle($itemSet->displayTitle(), 1, $translate('Item sets'), $translate('Edit')); ?>
<?php $this->trigger('view.edit.before'); ?>
<?php
echo $this->partial('omeka/admin/item-set/form.phtml', [
    'form' => $form,
    'itemSet' => $itemSet,
    'submitLabel' => $translate('Save'),
    'deleteButton' => $deleteButton,
    'sectionNavEvent' => 'view.edit.section_nav',
    'action' => 'edit',
]);
?>

<?php echo $this->deleteConfirm($itemSet, 'item set'); ?>

<?php $this->trigger('view.edit.after'); ?>
