<%@ language=VBScript %> <% ' /////////////////////////////////////////////////////// ' // Dimac CMS ' // Copyright 2004-2008 Dimac Development AB, Sweden ' // www.Dimac.net ' // ' // NOTE: ' // You are not allowed to remove this ' // Copyright information without written ' // permission from Dimac Development. ' /////////////////////////////////////////////////////// ImageDir = "../Img/" Url2 = "javascript:ViewNode(" Url3 = "javascript:ViewModule(" Dim mbl:mbl=Session("Member_Level") if Not IsNumeric(mbl) Or mbl="" Then mbl="0" strActiveLanguage=Session("contentLanguage") StartNode = 2 dIcon = "i2" ' ------------------------------------------------------ Function Execute() Dim s s = FindChildren(StartNode, 1) Execute = s End Function ' ------------------------------------------------------ Function GetDStatus(dID,dStatus) ' GetDStatus = "  (" & dID & ":" & dStatus & ")" GetDStatus = "" End Function ' ------------------------------------------------------ Function FindChildren(ID, dpt) Dim s Dim str Dim StrSql Dim i, j, x Dim Con, Rs1, SQL, tmpVar Set Conn = Server.CreateObject("ADODB.Connection") Set Rs1 = Server.CreateObject("ADODB.Recordset") Conn.Open GetConStr ("..\..\SiteResources\Data\") i = 1 'StrSql = "SELECT * FROM Documents " 'StrSql = StrSql & " WHERE (ParentID = " & ID & ")" 'StrSql = StrSql & " AND ((DocumentStatus = 5) OR (ModuleID > 0))" 'StrSql = StrSql & " ORDER BY SortOrder,DocName " StrSql = "SELECT *, DocumentLanguages.DocName AS DocName FROM Documents " StrSql = StrSql & " INNER JOIN DocumentLanguages ON Documents.DocumentID = DocumentLanguages.DocId" StrSql = StrSql & " WHERE (ParentID = " & ID & ")" StrSql = StrSql & " AND (secLevel <= " &mbl& ") " StrSql = StrSql & " AND ((DocumentLanguages.LangId = " & strActiveLanguage & ") AND (DocumentLanguages.LangStatus=5) )" If dbType = "Access" Then ' StrSql = StrSql & " AND (PublishDate <= #" & dtmSQLDate & "#) " ' StrSql = StrSql & " AND (ExpiresDate >= #" & dtmSQLDate & "#) " Else ' StrSql = StrSql & " AND (PublishDate <= " & dtmSQLDate & ") " ' StrSql = StrSql & " AND (ExpiresDate >= " & dtmSQLDate & ") " End If StrSql = StrSql & " ORDER BY SortOrder,DocumentLanguages.DocName " Rs1.Open StrSql , Conn While Not rs1.EOF x = 1 While x < dpt ' // ----------Lägg till tomrum----------------------- s = s & "" x = x + 1 Wend If rs1("isFolder").Value = 0 Then '// Node = dokument , J=last s = s & "" s = s & " " If Rs1("ModuleID").value > 0 Then s = s & "" & rs1("DocName").Value & GetDStatus(rs1("DocumentID").value,rs1("DocumentStatus").value) & "
" & vbCrLf Else s = s & "" & rs1("DocName").Value & GetDStatus(rs1("DocumentID").value,rs1("DocumentStatus").value) & "
" & vbCrLf End If Else If HasChildren(rs1("DocumentID").Value) > 0 Then ' s = s & "" s = s & "" s = s & " " s = s & "" & rs1("DocName").Value & GetDStatus(rs1("DocumentID").value,rs1("DocumentStatus").value) & "
" & vbCrLf s = s & "
" & vbCrLf s = s & FindChildren(rs1("DocumentID").Value, dpt + 1) s = s & "
" & vbCrLf Else s = s & "" s = s & " " s = s & "" & rs1("DocName").Value & GetDStatus(rs1("DocumentID").value,rs1("DocumentStatus").value) & "
" & vbCrLf End If End If i = i + 1 rs1.MoveNext Wend rs1.Close FindChildren = s End Function ' ------------------------------------------------------ ' ------------------------------------------------------ Function HasChildren(vID) Dim Conn2, Rs2, SQL, tmpVar Set Conn2 = Server.CreateObject("ADODB.Connection") Set Rs2 = Server.CreateObject("ADODB.Recordset") Conn2.Open GetConStr ("..\..\SiteResources\Data\") StrSql = "SELECT * FROM Documents WHERE ParentID = " & vID Rs2.Open StrSql , Conn2 If Not Rs2.EOF Then HasChildren = 1 Else HasChildren = 0 End if Set Rs2 = Nothing Set Conn2 = Nothing End Function ' ------------------------------------------------------ Function GetRSSize( vID ) Dim x Dim Conn3, Rs3, SQL, tmpVar Set Conn3 = Server.CreateObject("ADODB.Connection") Set Rs3 = Server.CreateObject("ADODB.Recordset") Conn3.Open GetConStr ("SiteResources\Data\") StrSql = "SELECT * FROM Documents " StrSql = StrSql & " WHERE (ParentID = " & ID & ")" StrSql = StrSql & " AND (DocumentStatus = 5)" StrSql = StrSql & " ORDER BY SortOrder,DocName " Rs3.Open StrSql , Conn x = 0 While Not rs3.EOF x = x + 1 rs3.MoveNext Wend Set Rs3 = Nothing Set Conn3 = Nothing GetRSSize = x End Function ' ------------------------------------------------------ %>
<%=LangLabelSiteMap%>
 
<% Response.Write("" + Execute() + "") %>