<form method="post" name="filters" action="<?php echo Horde::applicationUrl('filters.php') ?>">
<input type="hidden" name="actionID" value="<?php echo FILTER_CREATE ?>" />

<table border="0" align="center" cellpadding="3" cellspacing="0" width="100%">
<tr>
    <td class="header" colspan="2">

<table border="0" width="100%" cellpadding="0">
<tr class="header">
    <td align="left" class="header" nowrap="nowrap"><b><?php echo _("Filter Rules") ?></b></td>
<?php if (is_array($filters) && count($filters)): ?>
    <td align="center" class="header" width="100%"><input type="button" class="button" onclick="<?php echo $apply_js ?>" value="<?php echo _("Apply All Rules") ?>" /></td>
<?php if ($conf['user']['online_help'] && $browser->hasFeature('javascript')): ?>
    <td align="right"><?php echo Help::link('imp', 'filters') ?></td>
<?php endif; ?>
<?php endif; ?>
</tr>
</table>

    </td>
</tr>

<?php if (!is_array($filters) || !count($filters)): ?>
<tr>
    <td class="item" align="left" colspan="2"><i><b>&nbsp;<?php echo _("none") ?></b></i></td>
</tr>
<?php else: ?>
<?php for ($i = 0; $i < count($filters); $i++) { ?>
<tr>
    <td class="light" align="right"><b><?php echo $i + 1 ?>)&nbsp;</b></td>
    <td class="item" align="left">

<table border="0" width="100%" cellpadding="0">
<tr>
    <td align="left">
        <input class="item" type="radio" name="number" value="<?php echo $i ?>" onclick="selectRule(<?php echo $i ?>)" />&nbsp;&nbsp;
<?php if ($filters[$i]['action'] == 'delete'): ?>
        <?php echo _("Delete messages") ?>
<?php else: ?>
        <?php echo sprintf(_("Move messages to the <b>%s</b> folder"), IMP::displayFolder($filters[$i]['folder'])) ?>
<?php endif; ?>
        <?php echo sprintf(_("where the %s field contains <b>%s</b>"), $fieldsDisplay[$i], htmlspecialchars($filters[$i]['text'])) ?>
    </td>
</tr>
</table>

    </td>
</tr>
<?php } ?>
<tr>
    <td>&nbsp;</td>
    <td class="header" valign="middle">

<table border="0" width="100%" cellpadding="0">
<tr class="header">
    <td class="header">
        <input type="button" class="button" onclick="document.filters.actionID.value='<?php echo FILTER_DELETE ?>'; document.filters.submit();" value="<?php echo _("Delete") ?>" />
        <input type="button" class="button" onclick="document.filters.actionID.value='<?php echo FILTER_DOWN ?>'; document.filters.submit();" value="<?php echo _("Move Down") ?>" />
        <input type="button" class="button" onclick="document.filters.actionID.value='<?php echo FILTER_UP ?>'; document.filters.submit();" value="<?php echo _("Move Up") ?>" />
    </td>
<?php if ($conf['user']['online_help'] && $browser->hasFeature('javascript')): ?>
    <td align="right"><?php echo Help::link('imp', 'filters-list') ?></td>
<?php endif; ?>
</tr>
</table>

    </td>
</tr>
<?php endif; ?>
