<form method="post" name="import_form" enctype="multipart/form-data" action="<?php echo Horde::applicationUrl('data.php') ?>">
<?php Horde::pformInput() ?>
<input type="hidden" name="actionID" value="<?php echo $next_step ?>" />
<input type="hidden" name="import_step" value="<?php echo $import_step ?>" />
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
  <td>
    <table cellpadding="3" cellspacing="0" border="0" width="100%">
    <tr><td class="header"><?php echo sprintf(_("Import Calendar, Step %d"), $import_step) ?></td>
    </tr></table>
  </td>
</tr>
<tr>
  <td class="item">
  <table border="0"><tr><td>
<?php if ($conf['calendar']['driver'] == 'mcal'): ?>
    <?php echo _("Notice: Importing is not possible with this configuration due to a bug in the underlying calendar driver.") ?>
<?php else: ?>
    <?php echo _("Select the source to import from:") ?><br />
    <select name="import_format">
      <option value="csv"><?php echo _("Comma separated values") ?></option>
      <!--<option value="pdb"><?php echo _("Palm DateBook") ?></option>-->
      <option value="icalendar"><?php echo _("vCalendar/iCalendar") ?></option>
    </select><br />

    <?php if (!$prefs->isLocked('default_share') && count($calendars = Kronolith::listCalendars())): ?>
    <?php echo _("Select the calendar to import to:") ?><br />
    <select name="importCal">
      <?php
      foreach ($calendars as $id => $cal) {
          if ($cal->hasPermission(Auth::getAuth(), _PERMS_EDIT)) {
              echo sprintf('<option value="%s">%s</option>', $id, $cal->getShareName()) . "\n";
          }
      } ?>
    </select><br /><br />
    <?php else: ?>
    <input type="hidden" name="importCal" value="<?php echo htmlspecialchars($prefs->getValue('default_share')) ?>" />
    <?php endif; ?>
    <?php echo _("Select the file to import:") ?><br />
    <input type="file" name="import_file" class="fixed" size="40" />
    <input type="submit" value="<?php echo _("Import") ?>" class="button" />
<?php endif; ?>
  </td></tr></table>
  </td>
</tr>
</table>
</form>
