<?php
    switch ($actionID) {
    case 'import_personal_certs':
        $title = _("Import Personal S/MIME Certificates");
        break;

    case 'import_public_key':
        $title = _("Import Public S/MIME Key");
        $insert_text = _("Insert Certificate Here");
        break;
    }
    $certimport = ($actionID == 'import_personal_certs');
?>
<form enctype="multipart/form-data" method="post" name="import_smime_key" action="<?php echo $selfURL ?>">
<?php if ($GLOBALS['browser']->hasQuirk('broken_multipart_form')): ?>
<input type="hidden" name="msie_formdata_is_broken" value="" />
<?php endif; ?>
<input type="hidden" name="reload" value="<?php echo Util::getFormData('reload'); ?>" />
<input type="hidden" name="actionID" value="<?php echo $target ?>" />
<?php Util::pformInput(); ?>

<table border="0" cellspacing="0" cellpadding="2" width="100%">
 <tr>
  <td align="left" class="header" nowrap="nowrap"><b><?php echo $title ?></b></td>
<?php if ($certimport): ?>
  <td align="right" class="header" nowrap="nowrap"><?php echo Help::link('imp', 'smime-import-personal-certs') ?></td>
<?php endif; ?>
 </tr>

<?php if (isset($insert_text)): ?>
 <tr>
  <td class="item" align="left">
   <table border="0" cellpadding="0" width="100%">
    <tr>
     <td class="item" align="left"><b><?php echo $insert_text ?>:</b></td>
    </tr>
    <tr>
     <td class="item" align="left">
      <textarea name="import_key" rows="6" cols="80" class="fixed"></textarea>
     </td>
    </tr>
   </table>
  </td>
 </tr>

 <tr>
  <td class="item" align="left"><font color="red"><b>--<?php echo _("OR") ?>--</b></font></td>
 </tr>
<?php endif; ?>

 <tr>
  <td class="item" align="left"<?php if ($certimport): ?> colspan="2"<?php endif; ?>>
   <table border="0" cellpadding="0" width="100%">
    <tr>
     <td class="item" align="left">
      <b><?php echo _("Upload") ?>:</b>&nbsp;<input name="upload_key" type="file" size="40" class="fixed" />
     </td>
    </tr>
   </table>
  </td>
 </tr>

<?php if ($certimport): ?>
 <tr>
  <td class="item" align="left" colspan="2">
   <table border="0" cellpadding="0" width="100%">
    <tr>
     <td class="item" align="left">
      <b><?php echo _("Password") ?>:</b>&nbsp;<input name="upload_key_pass" type="password" size="30" class="fixed" />
     </td>
    </tr>
    <tr>
     <td class="item" align="left">
      <b><?php echo _("Private Key Password") ?>:</b>&nbsp;<input name="upload_key_pk_pass" type="password" size="30" class="fixed" />
     </td>
    </tr>
   </table>
  </td>
 </tr>
<?php endif; ?>

 <tr>
  <td nowrap="nowrap" align="center" class="header" valign="middle"<?php if ($certimport): ?> colspan="2"<?php endif; ?>>
   <input type="submit" name="import" class="button" value="<?php echo _("Import Key") ?>" />
   <input type="submit" name="import" class="button" onclick="window.close();" value="<?php echo _("Cancel") ?>" />
  </td>
 </tr>
</table>

</form>
</body>
</html>
