home *** CD-ROM | disk | FTP | other *** search
/ com!online 2002 June / comonline0602.iso / software / cogitum / CoTracker.exe / store.___ < prev    next >
Encoding:
Extensible Markup Language  |  2000-10-30  |  9.2 KB  |  264 lines

  1. <?xml version="1.0"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
  3.  
  4. <xsl:template match="/">
  5.     
  6.     <xsl:apply-templates select="root"/>
  7. </xsl:template>
  8.  
  9. <xsl:template match="root">
  10. <xsl:eval>Init(this)</xsl:eval>
  11.  
  12. <xsl:for-each select="BANNERBASE/BANNER[(/root/CTLIST/@CurrentCategory = @ID_CATEGORY) or (/root/CTLIST/@CurrentCategory = '0000000000000000')]" order-by="-@UIN">  
  13.  <xsl:if expr="IsInSequence()">
  14.     <xsl:eval>InitBanner(this)</xsl:eval>
  15.     <DIV>
  16.     <xsl:attribute name="ID"><xsl:value-of select="@ID_CATEGORY" /></xsl:attribute>    
  17.     <xsl:if expr="IsRowDisplay(128)">
  18.         <TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="3">        
  19.             <TR BGCOLOR="#FFFFFF"> 
  20.                 <TD ALIGN="LEFT" VALIGN="MIDDLE" COLSPAN="4">
  21.                     <xsl:if expr="gMap"><DIV><xsl:attribute name="MapName">MAP<xsl:value-of select="@UIN" /></xsl:attribute><MAPTOCHANGE><MAP><xsl:attribute name="name">MAP<xsl:value-of select="@UIN" /></xsl:attribute><xsl:value-of select="@Map" /></MAP></MAPTOCHANGE></DIV></xsl:if>
  22.                     <A><xsl:attribute name="NAME"><xsl:value-of select="@UIN" /></xsl:attribute>
  23.                         <xsl:attribute name="ID"><xsl:value-of select="@UIN" />-URL</xsl:attribute>                    
  24.                         <xsl:attribute name="TARGET">_blank</xsl:attribute>
  25.                         <xsl:if test="@Url[.!='']"><xsl:attribute name="HREF"><xsl:eval>((this.selectSingleNode("@Url").text.length == 0)?("#"+this.selectSingleNode("@UIN").text):this.selectSingleNode("@Url").text)</xsl:eval></xsl:attribute></xsl:if>
  26.                         <IMG>                                        
  27.                         <xsl:attribute name="ID"><xsl:value-of select="@UIN" />-IMG</xsl:attribute>                                        
  28.                         <xsl:choose>
  29.                           <xsl:when expr="!gMap">
  30.                           <xsl:attribute name="SRC"></xsl:attribute>                         
  31.                           </xsl:when>
  32.                           <xsl:otherwise>
  33.                            <xsl:attribute name="SRC"><xsl:value-of select="@Image" /></xsl:attribute>   
  34.                           </xsl:otherwise>
  35.                         </xsl:choose>
  36.                          <xsl:attribute name="TEMPSRC"><xsl:value-of select="@Image" /></xsl:attribute>
  37.                         <xsl:attribute name="WIDTH"><xsl:eval>(gSmallPictures==0)?this.selectSingleNode("@Width").nodeValue:60</xsl:eval></xsl:attribute>
  38.                        <xsl:attribute name="HEIGHT"><xsl:eval>(gSmallPictures==0)?this.selectSingleNode("@Height").nodeValue:40</xsl:eval></xsl:attribute>
  39.                         <xsl:attribute name="ALIGN">ABSMIDDLE</xsl:attribute>
  40.                         <xsl:attribute name="ALT"><xsl:value-of select="@Name" /></xsl:attribute>
  41.                         <xsl:attribute name="onClick">top.AccessBanner('<xsl:value-of select="@UIN" />')</xsl:attribute>                    
  42.                         <xsl:if test="@IsMap[.='true']"><xsl:attribute name="ISMAP" /></xsl:if>                    
  43.                         <xsl:if expr="gMap"><xsl:attribute name="USEMAP">#MAP<xsl:value-of select="@UIN" /></xsl:attribute></xsl:if>                    
  44.                         </IMG></A> 
  45.                     <INPUT TYPE="button" VALUE="Delete" title="Delete record" class="buttonClass3">
  46.                         <xsl:attribute name="onClick">top.DeleteBanner('<xsl:value-of select="@UIN" />')</xsl:attribute>                    
  47.                     </INPUT>
  48.                 </TD>
  49.             </TR>
  50.         </TABLE> 
  51.     </xsl:if>
  52.  
  53.         <TABLE BORDER="0" CELLSPACING="1" CELLPADDING="3" WIDTH="100%">
  54.         <xsl:attribute name="ID"><xsl:value-of select="@UIN" /></xsl:attribute>          
  55.           <xsl:if expr="IsRowDisplay(1)">
  56.             <TR ALIGN="LEFT" VALIGN="BOTTOM" BGCOLOR="#F3F3F3"> 
  57.                 <TD WIDTH="100" ALIGN="LEFT" VALIGN="CENTER">
  58.                     <FONT SIZE="-1">
  59.                         Name:
  60.                     </FONT>
  61.                 </TD>
  62.                 <TD COLSPAN="3" ALIGN="LEFT" VALIGN="CENTER">
  63.                     <B>
  64.                         <FONT SIZE="-1">
  65.                             <A id="Value"><xsl:attribute name="name">Name</xsl:attribute><xsl:value-of select="@Name" /></A>
  66.                         </FONT>
  67.                     </B>
  68.                     <FONT SIZE="-1" class="noprint">| <A href="#Change" onClick="top.ChangeStringValue(this)"><FONT SIZE="-2"><FONT COLOR="#CC0000">Change</FONT></FONT></A></FONT>
  69.                 </TD>
  70.             </TR>
  71.          </xsl:if>
  72.          <xsl:if expr="IsRowDisplay(4)">
  73.             <TR ALIGN="LEFT" VALIGN="BOTTOM" BGCOLOR="#F3F3F3">     
  74.                 <TD WIDTH="100" ALIGN="LEFT" VALIGN="CENTER">
  75.                     <FONT SIZE="-1">
  76.                         Comment:
  77.                     </FONT>
  78.                 </TD>
  79.                 <TD COLSPAN="3" ALIGN="LEFT" VALIGN="CENTER">
  80.                     <B>
  81.                         <FONT SIZE="-1">
  82.                             <A id="Value"><xsl:attribute name="name">Comment</xsl:attribute><xsl:value-of select="@Comment" /></A>
  83.                         </FONT>
  84.                     </B>
  85.                     <FONT SIZE="-1" class="noprint">| <A href="#Change" onClick="top.ChangeStringValue(this)"><FONT SIZE="-2"><FONT COLOR="#CC0000">Change</FONT></FONT></A></FONT>
  86.                 </TD>
  87.             </TR>
  88.              </xsl:if>
  89.          <xsl:if expr="IsRowDisplay(2)">
  90.             <TR ALIGN="LEFT" VALIGN="BOTTOM" BGCOLOR="#F3F3F3">     
  91.                 <TD WIDTH="100" ALIGN="LEFT" VALIGN="CENTER">
  92.                     <FONT SIZE="-1">
  93.                         Refers to:
  94.                     </FONT>
  95.                 </TD>
  96.                 <TD COLSPAN="3" ALIGN="LEFT" VALIGN="CENTER">
  97.                     <B>
  98.                         <FONT SIZE="-1">                                        
  99.                         <A id="Value"><xsl:attribute name="name">Url</xsl:attribute><xsl:attribute name="href"><xsl:value-of select="@Url" /></xsl:attribute>
  100.                         <xsl:attribute name="TARGET">_blank</xsl:attribute>
  101.                         <xsl:attribute name="onClick">top.AccessBanner('<xsl:value-of select="@UIN" />')</xsl:attribute>
  102.                         <xsl:value-of select="@Url" />
  103.                         </A>                    
  104.                         </FONT>
  105.                     </B>
  106.                     <xsl:if expr="gMap">                               
  107.                     <SPAN ID="MURL">                
  108.                      <FONT SIZE="-1"><B>Multiple URL references</B></FONT>                                                     
  109.                     </SPAN>
  110.                     </xsl:if>                
  111.                     <FONT SIZE="-1" class="noprint">| <A href="#Change" onClick="top.ChangeStringValue(this)"><FONT SIZE="-2"><FONT COLOR="#CC0000">Change</FONT></FONT></A></FONT>
  112.                 </TD>            
  113.             </TR>
  114.               </xsl:if>
  115.           <xsl:if expr="IsRowDisplay(16)">
  116.             <TR ALIGN="LEFT" VALIGN="BOTTOM" BGCOLOR="#F3F3F3">                 
  117.                 <TD WIDTH="100" ALIGN="LEFT" VALIGN="CENTER">
  118.                     <FONT SIZE="-1">
  119.                         From:
  120.                     </FONT>
  121.                 </TD>
  122.                 <TD COLSPAN="3" ALIGN="LEFT" VALIGN="CENTER">
  123.                     <B>
  124.                         <FONT SIZE="-1">
  125.                             <A id="Value"><xsl:attribute name="name">SourceUrl</xsl:attribute><xsl:attribute name="href"><xsl:value-of select="@SourceUrl"/></xsl:attribute>
  126.                             <xsl:attribute name="TARGET">_blank</xsl:attribute>
  127.                             <xsl:value-of select="@SourceUrl" /></A>
  128.                         </FONT>
  129.                     </B>
  130.                 </TD>
  131.             </TR>
  132.          </xsl:if>
  133.          <xsl:if expr="IsRowDisplay(32)">
  134.             <TR ALIGN="LEFT" VALIGN="BOTTOM" BGCOLOR="#F3F3F3">         
  135.                 <TD WIDTH="100" ALIGN="LEFT" VALIGN="CENTER">
  136.                     <FONT SIZE="-1">
  137.                         Category:
  138.                     </FONT>
  139.                 </TD>
  140.                 <TD COLSPAN="3" ALIGN="LEFT" VALIGN="CENTER">
  141.                     <B>
  142.                         <FONT SIZE="-1">
  143.                             <A id="Value"><xsl:attribute name="name">Category</xsl:attribute><xsl:eval>SetCTVal(this.parentNode.parentNode, this)</xsl:eval></A>
  144.                         </FONT>
  145.                     </B>
  146.                     <FONT SIZE="-1" class="noprint">| <A href="#Change" onClick="top.ChangeCategoryValue(this)"><FONT SIZE="-2"><FONT COLOR="#CC0000">Change</FONT></FONT></A></FONT>
  147.                 </TD>
  148.             </TR>        
  149.          </xsl:if> 
  150.          <xsl:if expr="IsRowDisplay(8)">
  151.             <TR ALIGN="LEFT" VALIGN="BOTTOM" BGCOLOR="#F3F3F3">         
  152.                 <TD WIDTH="100" ALIGN="LEFT" VALIGN="CENTER">
  153.                     <FONT SIZE="-1">
  154.                         Date added:
  155.                     </FONT>
  156.                 </TD>
  157.                 <TD COLSPAN="3" ALIGN="LEFT" VALIGN="CENTER">
  158.                  <SPAN style="padding-left:5px; padding-right:2px; BACKGROUND-COLOR: ivory; BORDER-BOTTOM: darkgray 1px outset; BORDER-LEFT: darkgray 1px outset; BORDER-RIGHT: darkgray 1px outset; BORDER-TOP: darkgray 1px outset; COLOR:#6a5acd; FONT-FAMILY: Arial; FONT-SIZE: 8pt; FONT-WEIGHT: 400; width:110"> 
  159.                  <NOBR>
  160.                     <xsl:eval>GetBannerDate (this)</xsl:eval>                                           
  161.                  </NOBR>
  162.                  </SPAN>
  163.                 </TD>
  164.             </TR>
  165.          </xsl:if>
  166.                           
  167.          <TD COLSPAN="10"> 
  168.           <HR SIZE="1"></HR>       
  169.          </TD> 
  170.  
  171.         </TABLE>    
  172.          </DIV>
  173.  </xsl:if>
  174.  <xsl:eval>IncHTMLCount()</xsl:eval>
  175. </xsl:for-each>
  176. </xsl:template>
  177.  
  178.  
  179. <xsl:script><![CDATA[
  180. var nHTMLNodeStart=30;
  181. var nHTMLNodeCount;
  182.  
  183. var gSmallPictures;
  184. var gShowSlots;
  185. var gMap;
  186.  
  187. function Init (rootNode)
  188.  var SPNode = rootNode.selectSingleNode("BANNERBASE\/@SmallPictures"); 
  189.  if (SPNode)
  190.   gSmallPictures = SPNode.nodeValue;
  191.  else
  192.   gSmallPictures = 0; 
  193.   
  194.  var SLNode = rootNode.selectSingleNode ("BANNERBASE\/@ShowSlots");
  195.  if (SLNode)
  196.   gShowSlots =  SLNode.nodeValue;
  197.  else
  198.   gShowSlots = 191;     
  199.  
  200.  nHTMLNodeCount=0; 
  201. }
  202.  
  203. function InitBanner (thisBanner)
  204. {
  205.  Map = thisBanner.selectSingleNode ("@Map");
  206.  if (Map && Map.nodeValue != "")
  207.   gMap = 1;
  208.  else
  209.   gMap = 0;
  210. }
  211.  
  212.  
  213. function  SetCTVal (rootNode, BannerNode)
  214.   var CIDNode = BannerNode.selectSingleNode ("@ID_CATEGORY");  
  215.   var    Categ   = rootNode.selectSingleNode("CTLIST\/CATEGORY[@CID="+CIDNode.nodeValue+"]");    
  216.   var CatName = Categ.selectSingleNode("@Name");
  217.   
  218.   
  219.   if (CatName)  
  220.    return  CatName.nodeValue;            
  221.     
  222.   return "Error!!!";
  223. }
  224.  
  225.  
  226. function IsRowDisplay (RowBitFlag)
  227. {
  228.  if (gShowSlots & RowBitFlag) 
  229.   return 1; 
  230.  return 0;
  231. }
  232.  
  233. function GetBannerDate (node)
  234. {
  235.  var s = new Date(parseInt(node.selectSingleNode("@CreationDate").text, 10)).toLocaleString();
  236.  
  237.  r = s.search (" "); 
  238.  sub1 = s.substr(0, r);
  239.  sub2 = s.substr(r+1, s.length-r-1);
  240.  s = sub1 + String.fromCharCode(160) + sub2; 
  241.  return s;
  242. }
  243.  
  244.  
  245. function IsInSequence ()
  246. {
  247.  if (nHTMLNodeCount > nHTMLNodeStart)
  248.   return 1;
  249.  return 0;
  250. }
  251.  
  252.  
  253. function IncHTMLCount ()
  254. {
  255.   nHTMLNodeCount++;  
  256. }
  257.  
  258.  
  259. ]]></xsl:script>
  260.  
  261. </xsl:stylesheet>
  262.