<form method="post" name="export" action="<?php echo $GLOBALS['registry']->downloadUrl(_("tasks.csv")) ?>">
<?php Horde_Util::pformInput() ?>
<input type="hidden" name="actionID" value="export" />

<h1 class="header">
 <?php echo _("Export Tasks") ?>
</h1>

<div class="horde-content">
 <p>
  <?php echo Horde::label('exportID', _("Select the export format:")) ?><br />
  <select id="exportID" name="exportID">
   <option value="<?php echo Horde_Data::EXPORT_ICALENDAR ?>">iCalendar (vTodo)</option>
   <option value="<?php echo Horde_Data::EXPORT_CSV ?>">CSV</option>
  </select>
 </p>

 <?php if (count($export_tasklists) > 1): ?>
 <p>
  <?php echo Horde::label('exportList', _("Select the task list(s) to export from:")) ?><br />
  <select id="exportList" name="exportList[]" multiple="multiple">
    <?php foreach ($export_tasklists as $id => $tasklist) {
        printf('<option value="%s">%s</option>', htmlspecialchars($id), htmlspecialchars(Nag::getLabel($tasklist))) . "\n";
    } ?>
  </select>
 </p>
 <?php else: ?>
 <input type="hidden" name="exportList[]" value="<?php echo htmlspecialchars(Nag::getDefaultTasklist(Horde_Perms::READ)) ?>" />
 <?php endif; ?>

 <p>
  <?php echo Horde::label('exportTasks', _("Select the task states to export:")) ?><br />
  <select id="exportTasks" name="exportTasks">
   <option value="1"><?php echo _("All tasks") ?></option>
   <option value="0"><?php echo _("Incomplete tasks") ?></option>
   <option value="3"><?php echo _("Future tasks") ?></option>
   <option value="2"><?php echo _("Completed tasks") ?></option>
  </select>
 </p>
</div>

<div class="horde-form-buttons">
 <input type="submit" value="<?php echo _("Export") ?>" class="horde-default" />
</div>

</form>
