<div class="block">
    <h4><?php echo __('com.txt.shoutbox'); ?></h4>

    <div class="block-content">
        <div>
            <?php echo v('formulaire'); ?>
            <div class="err_small"><?php echo v('Shouts_error'); ?></div>
            <ul class="shoutbox unstyled">
                <?php
                $i = 0;
                foreach (( array )v('Shouts') as $id => $Shout) {
                    ?>
                    <li <?php
                        echo $i++ % 2 == 0 ? '' : 'class="odd"';
                        ?>>
            <span class="shout_nick"><i class="icon-user"></i><?php
                echo href($Shout ['login'], array('controleur' => 'profil', 'action' => 'joueur', 'params' => $Shout['login'] . '-' . $Shout['JOU_CLE']), array()); ?></span>
	        <span class="shout_date"><?php
                echo date_avec_delai($Shout ['date']);
                if ( is_admin() ){
                    echo href(img('icons/cross.png'), array('controleur' => 'tribunelibre', 'action' => 'supprimer', 'params' => $id, 'class' => 'shout_delete', 'onclick' => 'return false'));
                }

                ?></span>

                        <div class="shout_msg"><?php echo $Shout ['message']; ?></div>
                    </li>

                    <?php
                }
                ?>
                <li class="tar"><?php echo href(__('com.bloc.afficher'), array('controleur' => 'tribunelibre', 'action' => 'affichertout', 'class' => 'btn btn-mini btn-primary')); ?></li>
            </ul>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function () {
        $('a.shout_delete').click(function () {
            if (confirm("<?php echo __('com.action.shout.del'); ?>")) {
                var lien = $(this);
                $.ajax({
                    url:lien.attr('href'),
                    type:'GET',
                    timeout:1000,
                    success:function (xml) {
                        lien.parent().parent("li").hide();
                    }
                });
            }
        });
    });
    <?php if ( v('shoutbox_error') ){ ?>
    alert('<?php echo v('shoutbox_error'); ?>');
    <?php } ?>
</script>