<div class="right pull-right">
    <?php if (sizeof((array)v('Messages')) > 0) { ?>
    <?php echo href(__('com.action.vider'), array('controleur' => 'messagerie', 'action' => 'viderboiteenvoi', 'class' => 'awesome awesome-small red btn btn-danger')); ?>
    <?php } ?>
</div>
<h2><?php
    echo __('mess.boite_envoi');
    if (Paginate::getCount() > 0) {
        echo ' - ';
        echo Paginate::getCount();
        echo ' ';
        echo Paginate::getCount() > 1 ? __('mess.messages') : __('mess.message');
    }
    ?>
</h2>


<?php if (sizeof((array)v('Messages')) == 0) { ?>
<p><?php echo __('mess.vide'); ?></p>
<?php } else { ?>
<table id="mes-messages" cellpadding="0" cellspacing="0" class="table table-striped">
    <?php foreach (v('Messages') as $Message) { ?>
    <tr class="<?php echo $Message->get_MES_LU() == 1 ? 'lu' : 'nonlu'; ?>">
        <td class="date">
            <span class="date"><?php echo date_fr($Message->get_MES_DATE(), false); ?></span>
        </td>
        <td class="nom">
            <span class="auteur"><?php echo zK_joueur($Message); ?></span>
        </td>

        <td class="message"><?php
            $icon = $Message->get_MES_LU() ? img('icons/email_open.png', 'opened') : img('icons/email.png', 'unread');
            echo href($icon . ' ' . $Message->get_MES_CONTENU_EXTRAIT(), '/messagerie/lire/' . $Message->get_MES_CLE());
            ?></td>
        <td class="s">
            <?php echo href(img('icons/cross.png'), array('controleur' => 'messagerie', 'action' => 'supprimer', 'params' => $Message->get_MES_CLE(), 'onclick' => 'return confirm(\'' . __('mess.supprimer') . ' ?\');')); ?>
        </td>
    </tr>

    <?php } ?>
</table>

<?php echo Paginate::getLinks();

}