<?php $rule_url = Horde::applicationUrl('rule.php');
    if (!is_null($edit_number)) {
        $rule_url = Util::addParameter($rule_url, 'edit', $edit_number);
    }
?>
<script type="text/javascript">
<!--
function delete_condition(num)
{
    document.rule.actionID.value = 'rule_delete';
    document.rule.conditionnumber.value = num;
    document.rule.submit();
    return true;
}
//-->
</script>

<form method="post" name="rule" action="<?php echo $rule_url ?>">
<?php Util::pformInput() ?>
<input type="hidden" name="actionID" value="rule_update" />
<input type="hidden" name="conditionnumber" value="-1" />
<input type="hidden" name="new_folder_name" value="" />

<div class="header">
 <?php echo _("Filter Rule") ?>
 <?php if (!empty($rule['disable'])): ?>[<span style="form-error"><?php echo _("Disabled") ?></span>]<?php endif; ?>
 <?php echo Help::link('ingo', 'rule') ?>
</div>

<table width="100%" cellspacing="0">
  <tr class="control">
    <td>
      <?php echo _("Rule Name") ?> : <input class="input" name="name" size="50" value="<?php echo (isset($rule['name'])) ? @htmlspecialchars($rule['name'], ENT_COMPAT, NLS::getCharset()) : '' ?>" />
    </td>
    <td width="40" class="rightAlign">
      <?php echo Help::link('ingo', 'rule-name') ?>&nbsp;
    </td>
  </tr>

  <tr class="item0">
    <td>
      <em><?php echo _("For an incoming message that matches:") ?></em>
      <br />
      <input id="all" onclick="document.rule.submit(); return true;" type="radio" name="combine" value="<?php echo INGO_STORAGE_COMBINE_ALL ?>"<?php echo ($rule['combine'] == INGO_STORAGE_COMBINE_ALL) ? ' checked="checked"' : '' ?> /><?php echo Horde::label('all', _("All of the following")) ?>&nbsp;
      <input id="any" onclick="document.rule.submit(); return true;" type="radio" name="combine" value="<?php echo INGO_STORAGE_COMBINE_ANY ?>"<?php echo ($rule['combine'] == INGO_STORAGE_COMBINE_ANY) ? ' checked="checked"' : '' ?> /><?php echo Horde::label('any', _("Any of the following")) ?>
    </td>
    <td width="40" class="rightAlign">
      <?php echo Help::link('ingo', 'rule-combine') ?>&nbsp;
    </td>
  </tr>

  <tr class="item0">
    <td>
      <table width="100%" cellspacing="0">
