<script language="JavaScript" type="text/javascript">
<!--
function deleteCal(id)
{
    document.prefs.remote_action.value = 'delete';
    document.prefs.remote_url.value = id;
    document.prefs.submit();
}
-->
</script>
<table border="0">

<tr>
  <th colspan="3" align="left">
    <?php echo _("Existing Remote Calendars:") ?><br/>
    <br/>
  </th>
</tr>

<tr>
  <th align="left"><?php echo _("Name") ?></th>
  <th align="left" colspan="2">
    <?php echo _("URL") ?>
  </th>
</tr>

<?php
$cals = unserialize($prefs->getValue('remote_cals'));
foreach ($cals as $key => $cal):
?>
<tr>
  <td><?php echo $cal['name'] ?></td>
  <td><?php echo $cal['url'] ?></td>
  <td><a href='#' onclick="deleteCal('<?php echo $cal['url'] ?>'); return false;"><?php echo _("Delete") ?></a></td>
</tr>
<?php endforeach; ?>

<tr>
  <td colspan="3">
    <br/>
    <?php echo _("Add New Remote Calendar:") ?>
    <input type="hidden" name="remote_action" value="add">
    <br/><br/>
    <table>
      <tr>
        <td>
          <?php echo _("Name:") ?> &nbsp;&nbsp;
        </td>
        <td>
          <input type="text" name="remote_name" value="">
        </td>
      </tr>
      <tr>
        <td>
          <?php echo _("URL:") ?> &nbsp;&nbsp;
        </td>
        <td>
          <input size="50" type="text" name="remote_url" value="">
        </td>
      </tr>
    </table>
  </td>
</tr>
</table>
