<div class="btn-group pull-right">
    <?php //echo href(__('com.action.new.mp'), array('controleur' => 'messagerie', 'action' => 'nouveau', 'class' => 'ajax btn btn-primary btn-small'));
    ?>
    <?php if (sizeof((array)v('Messages')) > 0) { ?>
    <?php echo href(__('com.action.vider'), array('controleur' => 'messagerie', 'action' => 'viderboitereception', 'class' => 'awesome awesome-small red btn btn-danger btn-small', 'onclick' => 'return confirm(\'' . __('com.action.vider') . ' ?\');')); ?>
    <?php } ?>
</div>
<h2><?php
    echo __('mess.boite_reception');
    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 class="table table-striped" id="mes-messages" cellpadding="0" cellspacing="0">
    <?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 $Message->getAuteur(); ?></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(\'' . __('com.action.shout.del') . '\');')); ?></td>
    </tr>

    <?php } ?>
</table>

<?php echo Paginate::getLinks();

}