Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 251 | Go to most recent revision | Blame | Last modification | View Log | RSS feed

<ul id="ef-resultats-determination">
        <?php if ($noms) : ?>
                <? foreach ($noms as $nnTaxon => $nom) : ?>
                        <li class="zone-resultat">
                                <a href="<?=$nom['urlFiche']?>">
                                        <strong class="nom-sci-retenu"><?=$nom['nomSciRetenu']?></strong>
                                </a>
                                <?php if (isset($imagesUrls[$nnTaxon])) : ?>
                                <img src="<?=$imagesUrls[$nnTaxon][0]?>" style="width:100px;height:100px;display:block;float:right;"/>
                                <?php else : ?>
                                <div class="absent">PAS DE PHOTO<br /><br /><br />
                                        <a href="http://www.tela-botanica.org/appli:cel2#81722" title="Ajouter une photographie au moyen du Carnet en Ligne" onclick="window.open(this.href); return false;">Contribuez <br />à l'album</a>
                                        <br />
                                </div>
                                <?php endif; ?>
                                <?php if (isset($synonymes[$nnTaxon])) : ?>
                                        <?php $nbrSynonymes = count($synonymes[$nnTaxon]) ?>
                                        <ul class="synonymes" style="width:100%;">
                                                <?php for ($i = 0; ($i < 3); $i++) : ?>
                                                        <?php if (isset($synonymes[$nnTaxon][$i])) : ?>
                                                                <li><b>syn.</b> <?=$synonymes[$nnTaxon][$i]['nomSci']?></li>
                                                        <?php endif; ?>
                                                <? endfor; ?>
                                                <?php if ($nbrSynonymes === 4) : ?>
                                                        <?php if (isset($synonymes[$nnTaxon][3])) : ?>
                                                                <li><b>syn.</b> <?=$synonymes[$nnTaxon][3]['nomSci']?></li>
                                                        <?php endif; ?>
                                                <?php endif; ?>
                                                <?php if ($nbrSynonymes > 3 && $nbrSynonymes != 4) : ?>
                                                        <li class="synonymes-autres">
                                                                <ul>
                                                                        <?php for ($i = 3; $i < $nbrSynonymes; $i++) : ?>
                                                                                <li><b>syn.</b> <?=$synonymes[$nnTaxon][$i]['nomSci']?></li>
                                                                        <? endfor; ?>
                                                                </ul>
                                                        </li>
                                                <?php endif; ?>
                                        </ul>
                                <?php endif; ?>
                        </li>
                <? endforeach; ?>
        <?php endif; ?>
        <?php if ($nomsSansCorrespondance) : ?>
                <li class="zone-resultat" title="Aucun nom retenu n'a été trouvé pour ces noms scientifiques">
                        <strong>Noms sans correspondance</strong>
                        <ul class="noms-ss-correspondance">
                                <?php foreach ($nomsSansCorrespondance as $nomSC) : ?>
                                        <li><?=$nomSC?></li>
                                <?php endforeach; ?>
                        </ul>
                </li>
        <?php endif; ?>
</ul>
<script type="text/javascript">
        //<![CDATA[
        $(document).ready(function() {
                ajouterToggleSynonymesAutres();
        });
        function ajouterToggleSynonymesAutres() {
                $("ul#ef-resultats-determination li").each(function(index) {
                        $(this).find('.synonymes-autres').prepend('<a id="bascule-'+index+'" href="#">et plus...</a>');
                        $(this).find('.synonymes-autres ul').css('display', 'none');
                        $(this).find('.synonymes-autres ul').attr('id', 'sa-'+index);
                        
                        $('#bascule-'+index).on('click', function() {
                                $('#sa-'+index).toggle('blind', {}, 500);
                                return false;
                        });
                });
        }
        //]]>
</script>