<?php
$translate = $this->plugin('translate');
$escape = $this->plugin('escapeHtml');
$this->htmlElement('body')->appendAttribute('class', 'sites add');
$form->prepare();
$sectionNavs = [
    'info' => $translate('Info'),
    'theme' => $translate('Theme'),
];
$fallbackThumbnailUrl = $this->assetUrl('img/theme.jpg', 'Omeka');
?>
<?php echo $this->pageTitle($translate('New site'), 1, $translate('Sites')); ?>
<?php $this->trigger('view.add.before'); ?>
<?php echo $this->form()->openTag($form); ?>

<div id="page-actions">
    <?php if ($this->setting('default_to_private')) : ?>
    <?php echo $this->hyperlink('', '#', [
        'class' => 'o-icon-private button',
        'title' => $translate('Make public'),
    ]); ?>
    <input type="hidden" name="o:is_public" value="0">
    <?php else: ?>
    <?php echo $this->hyperlink('', '#', [
        'class' => 'o-icon-public button',
        'title' => $this->translate('Make private'),
    ]); ?>
    <input type="hidden" name="o:is_public" value="1">
    <?php endif; ?>
    <?php echo $this->cancelButton(); ?>
    <button><?php echo $translate('Add'); ?></button>
</div>

<?php echo $this->sectionNav($sectionNavs, 'view.add.section_nav'); ?>
<?php $this->trigger('view.add.form.before', ['form' => $form]); ?>
<fieldset id="info" class="section active" aria-labelledby="admin-label">
    <?php echo $this->formCollection($form, false); ?>
</fieldset>

<fieldset id="theme" class="section" aria-labelledby="theme-label">
    <?php
    echo $this->partial('omeka/site-admin/index/theme-selector.phtml', [
        'themes' => $themes,
        'defaultThemeId' => 'default',
        'fallbackThumbnailUrl' => $fallbackThumbnailUrl
    ]);
    ?>
</fieldset>

<?php $this->trigger('view.add.form.after', ['form' => $form]); ?>
<?php echo $this->form()->closeTag(); ?>
<?php $this->trigger('view.add.after'); ?>
