<table border="0" align="center" width="100%" cellspacing="0" cellpadding="2">
<tr class="control">
<td align="left">
<?php if ($h->Deleted == 'D'): ?>
<?php echo Horde::link(Horde::applicationUrl($form_link . '&actionID=' . UNDELETE_MESSAGES), _("Undelete"), 'widget') . _("Undelete") ?></a>
<?php else: ?>
<?php echo Horde::link(Horde::applicationUrl($form_link . '&actionID=' . DELETE_MESSAGES), _("Delete"), 'widget', '', $delete_warning) . _("Delete") ?></a>
<?php endif; ?>
| <?php echo Horde::link(IMP::composeLink(array(), array('actionID' => REPLY, 'index' => $index, 'bodypart' => $bodypart, 'identity' => $identity)), _("Reply"), 'widget') . _("Reply") ?></a>
| <?php echo Horde::link(IMP::composeLink(array(), array('actionID' => REPLY_ALL, 'index' => $index, 'bodypart' => $bodypart, 'identity' => $identity)), _("Reply to All"), 'widget') . _("Reply to All") ?></a>
| <?php echo Horde::link(IMP::composeLink(array(), array('actionID' => FORWARD, 'index' => $index, 'bodypart' => $bodypart, 'identity' => $identity)), _("Forward"), 'widget') . _("Forward") ?></a>
| <?php echo Horde::link(IMP::composeLink(array(), array('actionID' => BOUNCE_COMPOSE, 'index' => $index)), _("Redirect"), 'widget') . _("Redirect") ?></a>
<?php if (($conf['prefs']['driver'] != '') && ($conf['prefs']['driver'] != 'none') && !$prefs->isLocked('filters')): ?>
| <?php echo Horde::link(Horde::applicationUrl($form_link . '&actionID=' . IMP_BLACKLIST), _("Blacklist"), 'widget') . _("Blacklist") ?></a>
<?php endif; ?>
<?php if ($conf['user']['allow_view_source']): ?>
| <?php echo Horde::link('', _("Message Source"), 'widget', null, "view('" . VIEW_SOURCE . "', '0', ''); return false;") . _("Message Source") ?></a>
<?php endif; ?>
<?php if ($conf['user']['allow_resume_all'] || ($conf['user']['allow_resume_all_in_drafts'] && $imp['mailbox'] == IMP::preambleString() . $prefs->getValue('drafts_folder')) || (isset($h->Draft) && $h->Draft == 'X')): ?>
| <?php echo Horde::link(IMP::composeLink(array(), array('actionID' => DRAFT, 'mailbox' => $imp['mailbox'], 'bodypart' => $bodypart, 'index' => $index)), _("Resume"), 'widget') . _("Resume") ?></a>
<?php endif; ?>
| <?php require_once IMP_BASE . '/lib/Browser.php'; echo Horde::link(IMP_Browser::downloadUrl($sub, array('actionID' => SAVE_MESSAGE, 'index' => $index, 'start' => $msgindex, 'thismailbox' => urlencode(IMP::getThisMailbox()))), _("Save as"), 'widget') . _("Save as") ?></a>
| <?php echo Horde::link('', _("Print"), 'widget', '', "open_print_win('actionID=" . PRINT_MESSAGE . '&amp;mailbox=' . urlencode($imp['mailbox']) . "&amp;bodypart=$bodypart&amp;index=$index&thismailbox=" . urlencode(IMP::getThisMailbox()) . "'); return false;") . _("Print") ?></a>
<?php if ($conf['spam']['reporting']): ?>
| <?php echo Horde::link(Horde::applicationUrl('message.php?actionID=' . SPAM_REPORT . '&index=' . $index . '&identity=' . $identity), _("Report as Spam"), 'widget') . _("Report as Spam") ?></a>
<?php endif; ?>
</td>
<td align="right">
<?php echo Horde::link($mailbox_link, sprintf(_("Back to %s"), $imp['label']), 'widget') . sprintf(_("Back to %s"), $imp['label']) ?></a>&nbsp;&nbsp;
<link href="<?php echo $mailbox_link ?>" rel="Up" />
<?php if ($array_index != 0): ?>
<?php echo Horde::link($prev_link, _("Previous Message"), 'widget') . Horde::img('prev.gif', 'alt="' . _("Previous Message") . '" width="12" height="13"') ?></a>
<link href="<?php echo $prev_link ?>" rel="Previous" />
<?php else: ?>
<?php echo Horde::img('prev-grey.gif', 'width="12" height="13"') ?>
<?php endif; ?>
<?php if ($array_index != count($sorted) - 1): ?>
<?php echo Horde::link($next_link, _("Next Message"), 'widget') . Horde::img('next.gif', 'alt="' . _("Next Message") . '" width="12" height="13"') ?></a>
<link href="<?php echo $next_link ?>" rel="Next" />
<?php else: ?>
<?php echo Horde::img('next-grey.gif', 'width="12" height="13"') ?>
<?php endif; ?>
</td>
</tr>
<?php if (substr($GLOBALS['language'], 0, 3) == 'ru_'): ?>
<tr class="control">
<td align="right" colspan="2">
<?php echo _("Select charset:") ?>
 <?php echo Horde::link(Horde::url("message.php?index=" . $index), _('Automatic charset'), 'widget') . 'Automatic</a>' ?>
 | <?php echo Horde::link(Horde::url("message.php?index=" . $index . '&charset=win'), _('WIN charset'), 'widget') . 'WIN</a>' ?>
 | <?php echo Horde::link(Horde::url("message.php?index=" . $index . '&charset=koi'), _('KOI charset'), 'widget') . 'KOI</a>' ?>
 | <?php echo Horde::link(Horde::url("message.php?index=" . $index . '&charset=dos'), _('DOS charset'), 'widget') . 'DOS</a>' ?>
 | <?php echo Horde::link(Horde::url("message.php?index=" . $index . '&charset=iso'), _('ISO charset'), 'widget') . 'ISO</a>' ?>
 | <?php echo Horde::link(Horde::url("message.php?index=" . $index . '&charset=mac'), _('MAC charset'), 'widget') . 'MAC</a>' ?>
</td>
</tr>
<?php endif; ?>
</table>
