<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Feuille de transformation INCLUDE
Ce ficher est choisi automatiquement par les XSL
     Author: Loic Pénet, lpenet@poleuniv-lille-npdc.fr
     Equipe : Claude Vieville, Brigitte Wallaert. CRI Université des Sciences et Technologies de Lille
     Version $Revision: 1.5 $
     -->
	 
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:ns2="http://cdm-fr.fr/2011/CDM-frSchema">
    <!--  -->
    <xsl:template name="lienVersProgram">
        <div class="p">
            <b>
                <xsl:value-of
                    select="$variablesExt/variables/titreVar/titreRub[@type='44']/value[@lang=$_lang]"
                />
            </b>
            <xsl:text> </xsl:text>
            <span class="invisible">
                <xsl:text> | </xsl:text>
            </span>
            <a accesskey=" " title=" "
                href="{$baseActionURL}?_cmd=getFormation&amp;_oid={$oidFormation}&amp;_redirect=voir_fiche_program&amp;_oidProgramAnnexe=&amp;_lang={$_lang}">
                <xsl:value-of select="/CDM/program[position()=1]/ns2:programName/ns2:text"/>
            </a>
            <span class="invisible">
                <xsl:text> | </xsl:text>
            </span>
            <br/>
        </div>
    </xsl:template>
    <!--  -->
    <xsl:template name="lienVersSubProgram">
        <xsl:param name="program" />
		<xsl:for-each select="/CDM//*[@ident=$program]/ns2:programStructure//ns2:refProgram">
            <xsl:variable name="oidSubProgram" select="./@ref"/>
			<!-- oidSubProgram=<xsl:value-of select="$oidSubProgram" />__ -->
			<xsl:variable name="title"
                select="concat($variablesExt/variables/navigationVar/link[@type='2']/linkTitle/value[@lang=$_lang],'
				',position())"/>
			<!-- ____<xsl:value-of select="$title" /> -->
            <li><!-- _oidProgramAnnexe=<xsl:value-of select="$_oidProgramAnnexe" />__ -->
                <xsl:choose>
                    <xsl:when test="$oidSubProgram = $_oidProgramAnnexe">
                        <b>
                            <span class="uportal-channel-warning">
                                <xsl:value-of
                                    select="/CDM//*[@ident=$oidSubProgram ]/ns2:programName/ns2:text[last()]"
                                />
                            </span>
                        </b>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:choose>
                            <xsl:when
                                test="not(/CDM//*[@ident=$oidSubProgram ]/ns2:programStructure//ns2:refProgram)">
								<!-- Quand un programme n'a pas de fils programme, il a donc des courses -->
				<!-- SUBPROGRAM__ -->
								<!-- ORIGINAL -->
								<xsl:variable name="ue"
                                    select="//subProgram[@ident=$oidSubProgram ]/ns2:programStructure//ns2:refCourse/@ref"/>
								<xsl:variable name="annexe">
                                    <xsl:choose>
                                        <xsl:when
                                            test="ancestor::subProgram[../subProgram/ns2:programDescription]/@ident">
											<xsl:value-of select="ancestor::subProgram/@ident"/>
                                        </xsl:when>
                                        <xsl:otherwise>
                                            <xsl:value-of select="ancestor::program/@ident"/>
                                        </xsl:otherwise>
                                    </xsl:choose>
                                </xsl:variable>
                                <xsl:variable name="subProgram">
                                    <xsl:choose>
                                        <xsl:when
                                            test="not(/CDM//subProgram[@ident=$oidSubProgram]/ns2:programStructure/ns2:refProgram)">
											<xsl:value-of select="$program"/>
                                        </xsl:when>
                                        <xsl:otherwise>
                                            <xsl:value-of select="$oidSubProgram"/>
                                        </xsl:otherwise>
                                    </xsl:choose>
                                </xsl:variable>
								
								<!--
								<xsl:for-each select="/CDM/program[@ident=$oidSubProgram ]/ns2:programStructure//ns2:refCourse">
									<li>
										course=<xsl:value-of select="@ref"/>
									</li>
								</xsl:for-each>
								
								<xsl:variable name="ue"
                                    select="//program[@ident=$oidSubProgram ]/ns2:programStructure//ns2:refCourse/@ref"/>
                                <xsl:variable name="annexe" select="$oidSubProgram"/>
                                <xsl:variable name="subProgram" select="$oidSubProgram"/>
 								-->
                                <a accesskey=" " title="{title}"
                                    href="{$baseActionURL}?_cmd=getUe&amp;_oidUe={$ue}&amp;_oid={$_oid}&amp;_oid_subProgram={$subProgram}&amp;_oidProgramAnnexe={$annexe}&amp;_redirect=voir_fiche_course&amp;_semestre={position()}&amp;_lang={$_lang}#AncreUe">
                                    <xsl:value-of
                                        select="//*[@ident=$oidSubProgram]/ns2:programName/ns2:text[last()]"
                                    />
                                </a>
								<!--
								annexe=<xsl:value-of select="$annexe"/>__subProgram=<xsl:value-of select="$subProgram"/>
								-->
				<!-- __SUBPROGRAM -->
                            </xsl:when>
                            <xsl:otherwise>
								<!-- Quand un programm a un refProgram fils -->
								<xsl:choose>
                                    <xsl:when
                                        test="/CDM//*[@ident=$program]/subProgram[@ident=$oidSubProgram][not(ns2:programDescription)]/ns2:programStructure//ns2:refProgram">
                                        <xsl:value-of
                                            select="/CDM//*[@ident=$oidSubProgram]/ns2:programName/ns2:text[last()]"
                                        />
										<!-- CAS_1 -->
                                    </xsl:when>
                                    <xsl:when
                                        test="/CDM//*[@ident=$oidSubProgram]/ns2:programStructure//ns2:refProgram">
										<!-- CAS_2 -->
                                        <a accesskey=" " title="{title}"
                                            href="{$baseActionURL}?_cmd=getFormation&amp;_oid={$oidFormation}&amp;_oid_subProgram={$oidSubProgram}&amp;_oidProgramAnnexe={$oidSubProgram}&amp;_redirect=voir_fiche_program&amp;_lang={$_lang}">
                                            <xsl:value-of
                                                select="//*[@ident=$oidSubProgram]/ns2:programName/ns2:text[last()]"
                                            />
                                        </a>
                                    </xsl:when>
                                    <xsl:otherwise>
										<!-- CAS_3 -->
                                        <xsl:value-of
                                            select="/CDM//*[@ident=$oidSubProgram]/ns2:programName/ns2:text[last()]"
                                        />
                                    </xsl:otherwise>
                                </xsl:choose>
				<!-- ROT___RECHERCHE_DE_PROGRAM___ROT -->
                            </xsl:otherwise>
                        </xsl:choose>

                    </xsl:otherwise>
                </xsl:choose>
                <xsl:if test="/CDM//*[@ident=$oidSubProgram]/ns2:programStructure//ns2:refProgram">
                    <ol>
                        <xsl:call-template name="lienVersSubProgram">
                            <xsl:with-param name="program" select="$oidSubProgram"/>
                        </xsl:call-template>
                    </ol>
                </xsl:if>
                <span class="invisible">
                    <xsl:text> | </xsl:text>
                </span>
            </li>
        </xsl:for-each>
        <xsl:for-each select="/CDM//*[@ident=$program]/ns2:programStructure//ns2:refCourse">
            <xsl:variable name="ue" select="@ref"/>
            <xsl:variable name="annexe">
                <xsl:choose>
                    <xsl:when test="ancestor::subProgram/@ident">
                        <xsl:value-of select="ancestor::subProgram/@ident"/>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="ancestor::program/@ident"/>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
<!-- second XSL-forEACH -->
            <li>
                <a accesskey=" " title="{title}"
                    href="{$baseActionURL}?_cmd=getUe&amp;_oidUe={$ue}&amp;_oid={$_oid}&amp;_oid_subProgram={$program}&amp;_oidProgramAnnexe={$annexe}&amp;_redirect=voir_fiche_course&amp;_semestre=&amp;_lang={$_lang}#AncreUe">
                    <xsl:value-of select="//*[@ident=$ue]/courseName/text"/>
                </a>
            </li>
        </xsl:for-each>
    </xsl:template>

    <!-- 		
	-->
    <!--  -->
    <xsl:template name="version">
        <!-- Indication de modification de version XSL -->
        <br/>
        <span class="uportal-copyright">Uniform v 3.0</span>
        <br/>
        <!-- fin Indication de modification de version XSL -->
    </xsl:template>
    <!--  -->
    <xsl:template name="liens">
        <xsl:param name="navigationPied"/>
        <!--_______________________debut liens  bas droite____________________________-->
        <xsl:if test="$navigationPied  &gt;= 1">
            <span class="invisible">
                <xsl:text> | </xsl:text>
            </span>
        </xsl:if>
        <!-- Rechercher par le Schema des etudes -->
        <a accesskey=""
            title="{$variablesExt/variables/navigationVar/link[@type='8']/linkTitle/value[@lang=$_lang]}"
            href="{$baseActionURL}?_cmd=getLastCatalog&amp;_redirect=voir_liste_program&amp;_recherche=0&amp;_oidProgramAnnexe=">
            <xsl:value-of
                select="$variablesExt/variables/navigationVar/link[@type='8']/navigationItem/value[@lang=$_lang]"
            />
        </a>
        <xsl:if test="$navigationPied  &gt;= 1">
            <span class="invisible">
                <xsl:text> | </xsl:text>
            </span>
        </xsl:if>
        <xsl:if test="not($navigationPied  &gt;=1)">
            <br/>
        </xsl:if>
        <!-- Lien vers la recherche par Types de diplomes -->
        <a accesskey=""
            title="{$variablesExt/variables/navigationVar/link[@type='9']/linkTitle/value[@lang=$_lang]}"
            href="{$baseActionURL}?_cmd=getLastCatalog&amp;_redirect=voir_liste_program&amp;_recherche=1&amp;_oidProgramAnnexe=">
            <xsl:value-of
                select="$variablesExt/variables/navigationVar/link[@type='9']/navigationItem/value[@lang=$_lang]"
            />
        </a>
    </xsl:template>
    <!--  -->
    <xsl:template name="navigation">
        <xsl:param name="navigationPied"/>
        <xsl:param name="choixLang"/>
        <xsl:param name="memoSelection"/>
        <xsl:param name="_oid"/>
        <xsl:param name="typeXSL"/>
        <!-- debut nav haut droit -->
        <xsl:choose>
            <xsl:when test="$navigationPied  &gt;= 1">
                <xsl:call-template name="liens">
                    <xsl:with-param name="navigationPied" select="$navigationPied"/>
                </xsl:call-template>
            </xsl:when>
            <xsl:otherwise>
                <div id="menuLien">
                    <xsl:call-template name="liens">
                        <xsl:with-param name="navigationPied" select="$navigationPied"/>
                    </xsl:call-template>
                </div>
            </xsl:otherwise>
        </xsl:choose>
        <!--  -->
        <xsl:if test="$navigationPied  &gt;= 1">
            <span class="invisible">
                <xsl:text> | </xsl:text>
            </span>
        </xsl:if>
        <!-- Lien vers la derniere recherche -->
        <a accesskey="" class="mini"
            title="{$variablesExt/variables/navigationVar/link[@type='3']/linkTitle/value[@lang=$_lang]}"
            href="{$baseActionURL}?_cmd=back&amp;_redirect=voir_liste_program&amp;_oidProgramAnnexe=">
            <xsl:value-of
                select="$variablesExt/variables/navigationVar/link[@type='3']/navigationItem/value[@lang=$_lang]"
            />
        </a>
        <xsl:if test="not($navigationPied  &gt;=1)">
            <br/>
        </xsl:if>
        <!--  Mémoriser ma sélection -->
        <xsl:if test="$memoSelection='1'">
            <xsl:if test="$navigationPied &gt;=1">
                <span class="invisible">
                    <xsl:text> | </xsl:text>
                </span>
            </xsl:if>
            <a accesskey="" class="mini"
                title="{$variablesExt/variables/navigationVar/link[@type='4']/linkTitle/value[@lang=$_lang]}"
                href="{$baseActionURL}?_cmd=addToBasket&amp;_oid={$_oid}&amp;_redirect=voir_liste_program&amp;_oidProgramAnnexe=&amp;_lang={$_lang}">
                <xsl:value-of
                    select="$variablesExt/variables/navigationVar/link[@type='4']/navigationItem/value[@lang=$_lang]"
                />
            </a>
            <xsl:if test="not($navigationPied  &gt;= 1)">
                <br/>
            </xsl:if>
        </xsl:if>
        <xsl:if test="$navigationPied  &gt;= 1">
            <span class="invisible">
                <xsl:text> | </xsl:text>
            </span>
        </xsl:if>
        <!--  Visualiser Ma sélection -->
        <xsl:if test="$basket &gt; 0">
            <a accesskey="" class="mini"
                title="{$variablesExt/variables/navigationVar/link[@type='5']/linkTitle/value[@lang=$_lang]}"
                href="{$baseActionURL}?_cmd=listBasket&amp;_redirect=voir_liste_program&amp;_oidProgramAnnexe=">
                <xsl:value-of
                    select="$variablesExt/variables/navigationVar/link[@type='5']/navigationItem/value[@lang=$_lang]"
                />
            </a>
            <br/>
        </xsl:if>
        <xsl:if test="$navigationPied &gt;= 2">
            <span class="invisible">
                <xsl:text> | </xsl:text>
            </span>
            <!--  Lien vers le site de l'universite-->
            <xsl:choose>
                <xsl:when test="$typeXSL=1">
                    <a class="mini"
                        title="{$variablesExt/variables/navigationVar/link[@type='7']/linkTitle/value[@lang=$_lang]}"
                        accesskey="">
                        <xsl:attribute name="href">
                            <xsl:value-of
                                select="/CDM/orgUnit[orgUnitKind/@orgType='universitet']/webLink[@role='homepage']/href"
                            />
                        </xsl:attribute>
                        <xsl:attribute name="onclick">return nleFenetre('<xsl:value-of
                                select="/CDM/orgUnit[orgUnitKind/@orgType='universitet']/webLink[@role='homepage']/href"
                            />')</xsl:attribute>
                        <xsl:value-of
                            select="$variablesExt/variables/navigationVar/link[@type='7']/navigationItem/value[@lang=$_lang]"
                        />
                    </a>
                </xsl:when>
                <xsl:otherwise>
                    <a class="mini"
                        title="{$variablesExt/variables/navigationVar/link[@type='7']/linkTitle/value[@lang=$_lang]}"
                        accesskey="">
                        <xsl:attribute name="href">
                            <xsl:value-of
                                select="/catalogueLocal/fragment[@type='orgUnit']/contenus/orgUnit[orgUnitKind/@orgType='universitet']/webLink[@role='homepage']/href"
                            />
                        </xsl:attribute>
                        <xsl:attribute name="onclick">return nleFenetre('<xsl:value-of
                                select="/CDM/orgUnit[orgUnitKind/@orgType='universitet']/webLink[@role='homepage']/href"
                            />')</xsl:attribute>
                        <xsl:value-of
                            select="/CDM/orgUnit[orgUnitKind/@orgType='universitet']/orgUnitName/text"
                        />
                    </a>
                </xsl:otherwise>
            </xsl:choose>
            <span class="invisible">
                <xsl:text> | </xsl:text>
            </span>
            <!--  Haut de la page -->
            <a class="mini" accesskey="t"
                title="{$variablesExt/variables/navigationVar/link[@type='6']/linkTitle/value[@lang=$_lang]}"
                href="#haut">
                <xsl:value-of
                    select="$variablesExt/variables/navigationVar/link[@type='6']/navigationItem/value[@lang=$_lang]"
                />
            </a>
        </xsl:if>
        <!-- Fin nav haut droit -->
    </xsl:template>
    <!--  -->
    <xsl:template name="infoColonne">
        <div id="zoneLiens">
            <!--extra div pour rendre flexible -->
            <div id="zoneLiens2">
                <div id="navigation">
                    <xsl:call-template name="navigation">
                        <xsl:with-param name="navigationPied" select="0"/>
                        <xsl:with-param name="_oid">
                            <xsl:value-of select="$_oid"/>
                        </xsl:with-param>
                        <xsl:with-param name="choixLang">1</xsl:with-param>
                        <xsl:with-param name="memoSelection">1</xsl:with-param>
                    </xsl:call-template>
                </div>
                <!--  le traitement de la mise a jour se fera par le code ANNU en attente -->
                <!-- Mis à jour
					<div id="misAJour">
					<div class="p">
					<span class="uportal-copyright">
					<xsl:value-of select="$variablesExt/variables/titreVar/titreRub[@type='27']/value[@lang=$_lang]"/>
					<xsl:text> </xsl:text>
					<xsl:call-template name="traitdate">
					<xsl:with-param name="date">
					<xsl:value-of select="number(normalize-space(/CDM/program/infoBlock/subBlock[(@blockLang=$_lang)and
					(header='Dernière  modification')]/text()[2]))"/>
					</xsl:with-param>
					</xsl:call-template>
					</span>
					</div>
					</div>
				-->
                <div id="menuDroite">
                    <!-- Lieu de la formation -->
                    <xsl:apply-templates select="./teachingPlace"/>
                    <!--a voir  il peut y avoir un element /CDM/person ??????
						<xsl:apply-templates select="../person"/>
					-->
                    <!-- debut contact de la Formation et coordonnees-->
                    <xsl:if test="$page = 'program'">
                        <xsl:apply-templates select="./contacts"/>
                    </xsl:if>
                    <!-- debut contact de l' UE et coordonnees-->
                    <xsl:if test="$page = 'course'">
                        <xsl:apply-templates select="/CDM/course[@ident=$_oid]/contacts"/>
                    </xsl:if>
                    <!-- ****************** menu en savoir plus ********************* -->
                    <xsl:if test="($page = 'program') or ($page = 'course')">
                        <h3 class="TitreTD"> &gt;<xsl:text> </xsl:text>
                            <xsl:value-of
                                select="$variablesExt/variables/titreVar/titreRub[@type='30']/value[@lang=$_lang]"
                            />
                        </h3>
                        <!-- Lien vers le URL web de la formation -->
                        <xsl:apply-templates select="./webLink">
                            <xsl:with-param name="lienExterieur" select="1"/>
                            <xsl:with-param name="menu" select="1"/>
                        </xsl:apply-templates>
                        <!-- Lien vers le dossier PDF de la formation -->
                        <p class="aDoc">
                            <a accesskey=""
                                title="{$variablesExt/variables/navigationVar/link[@type='12']/linkTitle/value[@lang=$_lang]}"
                                href="{$baseActionURL}?_cmd=getPdf&amp;_oid={$oidFormation}&amp;_oidProgramAnnexe=&amp;_lang={$_lang}"
                                onclick="return
								nleFenetre('{$baseActionURL}?_cmd=getPdf&amp;_oid={$oidFormation}&amp;_lang={$_lang}')">
                                <xsl:value-of
                                    select="$variablesExt/variables/navigationVar/link[@type='12']/navigationItem/value[@lang=$_lang]"
                                />
                            </a>
                        </p>
                    </xsl:if>
                    <!-- FIN **********************************************************************menu en savoir plus -->
                    <!-- version uniform Fiche : -->
                    <xsl:call-template name="version"/>
                    <span class="mini">
                        <xsl:value-of
                            select="$variablesExt/variables/titreVar/titreRub[@type='33']/value[@lang=$_lang]"/>
                        <xsl:text> </xsl:text>
                        <xsl:value-of select="./programID"/>
                    </span>
                    <br/>
                    <!--_______________________fin liens  bas droite____________________________-->
                </div>
                <div id="mentions">
                    <!-- copyright-->
                    <xsl:value-of
                        select="$variablesExt/variables/titreVar/titreRub[@type='34']/value[@lang=$_lang]"
                    />
                </div>
            </div>
        </div>
    </xsl:template>
    <!-- dans ce cas pas de colonne a droite -->
    <xsl:template name="infoPage">
        <!--  -->
        <!--a voir  il peut y avoir un element /CDM/person ??????
			<xsl:apply-templates select="../person"/>
		-->
        <xsl:if test="$page = 'program'">
            <!-- Lieu de la formation -->
            <xsl:apply-templates select="./teachingPlace"/>
            <!-- debut contact de la Formation et coordonnees-->
            <xsl:apply-templates select="./contacts"/>
        </xsl:if>
        <!-- debut contact de l' UE et coordonnees-->
        <xsl:if test="$page = 'course'">
            <xsl:apply-templates select="/CDM/course[@ident=$_oid]/contacts"/>
        </xsl:if>
        <!-- ****************** menu en savoir plus ********************* -->
        <xsl:if test="($page = 'program') or ($page = 'course')">
            <h3 class="TitreTD"> &gt;<xsl:text> </xsl:text>
                <xsl:value-of
                    select="$variablesExt/variables/titreVar/titreRub[@type='30']/value[@lang=$_lang]"
                />
            </h3>
            <!-- Lien vers le URL web de la formation -->
            <xsl:apply-templates select="./webLink">
                <xsl:with-param name="lienExterieur" select="1"/>
                <xsl:with-param name="menu" select="1"/>
            </xsl:apply-templates>
            <!-- Lien vers le dossier PDF de la formation -->
            <p class="aDoc">
                <a accesskey=""
                    title="{$variablesExt/variables/navigationVar/link[@type='12']/linkTitle/value[@lang=$_lang]}"
                    href="{$baseActionURL}?_cmd=getPdf&amp;_oid={$oidFormation}&amp;_oidProgramAnnexe=&amp;_lang={$_lang}"
                    onclick="return
					nleFenetre('{$baseActionURL}?_cmd=getPdf&amp;_oid={$oidFormation}&amp;_oidProgramAnnexe=&amp;_lang={$_lang}')">
                    <xsl:value-of
                        select="$variablesExt/variables/navigationVar/link[@type='12']/navigationItem/value[@lang=$_lang]"
                    />
                </a>
            </p>
        </xsl:if>
        <!-- FIN **********************************************************************menu en savoir plus -->
        <!-- version uniform Fiche : -->
        <xsl:call-template name="version"/>
        <span class="mini">
            <xsl:value-of
                select="$variablesExt/variables/titreVar/titreRub[@type='33']/value[@lang=$_lang]"/>
            <xsl:text> </xsl:text>
            <xsl:value-of select="./programID"/>
        </span>
        <br/>
        <!--_______________________fin liens  bas droite____________________________-->
    </xsl:template>
    <xsl:template name="logo">
        <div id="logo">
            <a
                title="$variablesExt/variables/navigationVar/link[@type='19']/linkTitle/value[@lang=$_lang]"
                accesskey=""
                onclick="return
				nleFenetre('{$variablesExt/variables/affichageVar/optionAffichage[@type='logo']/@http}')">
                <xsl:attribute name="href">
                    <xsl:value-of
                        select="$variablesExt/variables/affichageVar/optionAffichage[@type='logo']/@http"
                    />
                </xsl:attribute>
                <img
                    src="{$baseMediaURL}{$baseCanalURL}/images/{$variablesExt/variables/affichageVar/optionAffichage[@type='logo']/@select}"
                    alt="{$variablesExt/variables/navigationVar/link[@type='19']/linkTitle/value[@lang=$_lang]}"
                />
            </a>
        </div>
    </xsl:template>
</xsl:stylesheet>
