<?php
$translate = $this->plugin('translate');
$escape = $this->plugin('escapeHtml');
$mediaInput = null;
$altLabelInput = null;
$headingInput = null;
$descriptionInput = null;
$form->prepare();
$selectedAssetTemplate = '
<h3><span class="selected-asset-name">' . $translate('No Asset') . '</span></h3>
<span class="selected-asset">
<img class="selected-asset-image">
<div class="selected-asset-name"></div>
<input type="hidden" name="selected-asset-id" class="selected-asset-id">
<span class="none-selected">' . $translate('[No asset selected]') . '</span>
</span>
';
$selectedPageTemplate = '
<span class="selected-page"></span><a href="" target="_blank" class="o-icon-external" aria-label="' . $translate('Preview') . '" title="' . $translate('Preview') . '"></a>
<span class="none-selected">' . $translate('[No page selected]') . '</span>
<input type="hidden" name="asset-page-id" id="asset-page-id" value="" class="asset-option">
';
?>
<div class="sidebar" id="asset-options">
  <a href="#" class="sidebar-close o-icon-close"><span class="screen-reader-text"><?php echo $translate('Close'); ?></span></a>
  <div class="sidebar-content confirm-main">
    <div class="asset-form-element" data-default-html="<?php echo $escape($selectedAssetTemplate); ?>">
      <div class="asset-option-selection"><?php echo $selectedAssetTemplate; ?></div>
      <button type="button" class="asset-form-select" data-sidebar-content-url="<?php echo $escape($this->url('admin/default', ['controller' => 'asset', 'action' => 'sidebar-select'])); ?>"><?php echo $translate('Select'); ?></button>
    </div>
    <div class="page-link" data-default-html="<?php echo $escape($selectedPageTemplate); ?>">
      <h3><?php echo $translate('Page link'); ?></h3>
      <div class="page-status" data-site-url="<?php echo $escape($site->siteUrl()); ?>">
        <div class="asset-option-selection"><?php echo $selectedPageTemplate; ?></div>
      </div>
      <button type="button" class="page-select"><?php echo $translate('Select'); ?></button>
      <button type="button" class="page-clear"><?php echo $translate('Clear'); ?></button>
    </div>
    <div class="alternative-link-name">
        <h3 id="alternative-link-title-label"><?php echo $translate('Alternative link title'); ?></h3>
        <input type="text" name="alternative-link-title" aria-labelledby="alternative-link-title-label" class="asset-option">
    </div>
    <div class="description">
        <h3 id="caption-label"><?php echo $translate('Caption'); ?></h3>
        <textarea name="asset-caption" aria-labelledby="caption-label" class="asset-option"></textarea>
    </div>
  </div>

  <div id="asset-options-confirm-panel" class="confirm-panel">
    <button><?php echo $translate('Apply changes'); ?></button>
  </div>
</div>