<?php
/************************************************************************/
/*                                WEBSHARE                              */
/************************************************************************/
//
// Copyright (c) 2008 by Virginie Vivancos
// http://www.webshare.fr
//
// This program is free software. You can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License.
//
// =======================================================================
// Fonction : XSL d'affichage des dossiers en mode liste
// Nom      : liste.xsl.php
// Version  : 0.6.5
// Date     : 28/05/08
// =======================================================================
session_start();
header('Content-Type: application/xml');
echo '<'.'?xml version="1.0" encoding="UTF-8"'.'?>';
include_once "../fonctions.php";

?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" version="4.0" encoding="UTF-8" indent="yes"
                doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
                doctype-system="declarations.dtd"
    />
<xsl:template match="/" name="document">
<xsl:apply-templates/>
  </xsl:template>


  <xsl:template match="repGalerie">
   <xsl:variable name="commentGlobal" select="commentGlobal"/>
   <xsl:if test='(commentGlobal != "")'>
     <div id="headerDetails">
        <xsl:value-of select='commentGlobal'/>
     </div>
   </xsl:if>
   <ul class='v2' name="dragLayer" id="dragLayer">
   <xsl:for-each select="ent">
    <xsl:variable name="nom" select="nom"/>
    <xsl:variable name="num" select="num"/>
    <xsl:variable name="lnk" select="lnk"/>
    <xsl:variable name="vis" select="vis"/>
    <xsl:variable name="tai" select="tai"/>
    <xsl:variable name="ext" select="ext"/>
    <xsl:variable name="prm" select="prm"/>
    <xsl:variable name="cmt" select="cmt"/>
    <xsl:variable name="dtm" select="dtm"/>
    <xsl:variable name="pro" select="pro"/>
    <xsl:variable name="web" select="web"/>
    <xsl:if test='(pro = "sup")'>
       <script language="javascript">boutonUp="<xsl:value-of select='lnk'/>";</script>
    </xsl:if>
    <xsl:variable name="action">
      <xsl:choose>
        <xsl:when test='(prm = "R") or (prm = "RW")'>
          initAction("")
        </xsl:when>
      <xsl:otherwise>
        rien()
        </xsl:otherwise>
      </xsl:choose>
    </xsl:variable>

    <li class='cible' onclick='if (altClick==0) {$action}' onmouseover='this.className="cadre";if ((typeof(chargeContext)!="undefined")&amp;&amp;(attenteClic==false)) chargeContext({$num});' onmouseout='this.className="cible";if ((typeof(chargeContext)!="undefined")&amp;&amp;(attenteClic==false)) chargeContext(0);'>
    <form name='param{$num}'>
      <input type='hidden' name='num' value="{$num}" />
      <input type='hidden' name='lnk' value="{$lnk}" />
      <input type='hidden' name='nom' value="{$nom}" />
      <input type='hidden' name='ext' value="{$ext}" />
      <input type='hidden' name='tai' value="{$tai}" />
      <input type='hidden' name='prm' value="{$prm}" />
      <input type='hidden' name='pro' value="{$pro}" />
      <input type='hidden' name='dtm' value="{$dtm}" />
    <input type='hidden' name='web' value="{$web}" />
    <input type='hidden' name='srv' value="" />
    </form>

      <span class='caseimg'>
       <u>
      <xsl:if test='(pro!= "url")'>
          <xsl:if test='(ext= "jpg") or  (ext= "jpeg") or  (ext= "gif") or  (ext= "png") or  (ext= "JPG") or  (ext= "JPEG") or  (ext= "GIF") or  (ext= "PNG")'>
          <img src='<?php echo $_SESSION["ws"]["cheminIcn"]?>{vis}' width='32' height='32' title="{$nom}"/>
        </xsl:if>
          <xsl:if test='(ext!="ico") and (ext!="jpg") and (ext!="jpeg") and (ext!="gif") and (ext!="png") and (ext!="JPG") and (ext!="JPEG") and (ext!="GIF") and (ext!="PNG")'>
          <img src='<?php echo $_SESSION["ws"]["cheminIcn"]?>minis/{vis}' width='32' height='32' title="{$nom}"/>
        </xsl:if>
          <xsl:if test='(ext = "ico")'>
            <img src='<?php echo $_SESSION["ws"]["cheminIcn"]?>{vis}' title="{$nom}" style="width:32px;height:32px"/>
         </xsl:if>
      </xsl:if>
      <xsl:if test='(pro= "url")'>
         <img src='<?php echo $_SESSION["ws"]["cheminIcn"]?>minis/{ext}.<?php echo $_SESSION["ws"]["formatExt"]?>' title="{$nom}"/>
      </xsl:if>
       </u>
     </span>
      <span class='nom'>
        <u>
        <xsl:value-of select="nom"/>
        <xsl:if test='(prm = "R") and ("1" = "<?php echo $_SESSION["ws"]["typeUser"]?>")'>
              <img src='<?php echo $_SESSION["ws"]["cheminImg"]?>verrou1.<?php echo $_SESSION["ws"]["formatExt"]?>' title='<?php echo $_SESSION["ws"]["dia"]["readOnly"]?>'/>
             </xsl:if>
          <xsl:if test='(prm = "W")'>
              <img src='<?php echo $_SESSION["ws"]["cheminImg"]?>verrou2.<?php echo $_SESSION["ws"]["formatExt"]?>' title='<?php echo $_SESSION["ws"]["dia"]["writeOnly"]?>'/>
          </xsl:if>
           <xsl:if test='(prm = "N")'>
              <img src='<?php echo $_SESSION["ws"]["cheminImg"]?>verrou3.<?php echo $_SESSION["ws"]["formatExt"]?>' title='<?php echo $_SESSION["ws"]["dia"]["locked"]?>'/>
          </xsl:if>
          </u>
         <xsl:if test='(cmt != "")'>
          <img src='<?php echo $_SESSION["ws"]["cheminImg"]?>infocomment.<?php echo $_SESSION["ws"]["formatExt"]?>' title="{$cmt}"  onmouseover="altClick=1;" onmouseout="altClick=0;"  onclick="memoContext();montrerCommentaire(iciLien)"/>
         </xsl:if>
         <xsl:if test='(pro = "url")'>
          <img src='<?php echo $_SESSION["ws"]["cheminImg"]?>infolien.<?php echo $_SESSION["ws"]["formatExt"]?>' title="{$web}"/>
         </xsl:if>
         <?php if ($navig=="OP") { ?>
            <img src='<?php echo $_SESSION["ws"]["cheminImg"]?>menuContext.<?php echo $_SESSION["ws"]["formatExt"]?>' onclick="reloadContext()" title="<?php echo $_SESSION["ws"]["dia"]["menuContext"]?>"/>
         <?php } ?>
      </span>
    </li>
   </xsl:for-each>
   </ul>
  </xsl:template>

</xsl:stylesheet>
