home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 1999 April / APC443.iso / features / grpware / coldfus / coldfusi.exe / data1.cab / Examples / docs / sourcewindow.cfm < prev   
Encoding:
Text File  |  1998-10-08  |  1.5 KB  |  45 lines

  1. <CFSETTING ENABLECFOUTPUTONLY="YES">
  2.  
  3. <CFFILE ACTION="READ" FILE="#URL.Template#" VARIABLE="FileData">
  4. <CFSET CurrentData = HTMLCodeFormat(Replace(FileData,Chr(9),"    ","ALL"))>
  5.  
  6. <CFSET CurrentPosition = 1>
  7. <CFSET LoopFlag = 1>
  8.  
  9. <CFLOOP CONDITION="LoopFlag NEQ 0">
  10.  
  11.     <CFSET CurrentPosition = FindNoCase("<CFINCLUDE TEMPLATE="", CurrentData, CurrentPosition)>
  12.     <CFIF CurrentPosition IS 0>
  13.         <CFSET LoopFlag = 0>
  14.     <CFELSE>
  15.         <CFSET CurrentPosition = CurrentPosition + 29>
  16.         <CFSET NextPosition = FindNoCase(""", CurrentData, CurrentPosition)>
  17.         <CFSET TemplateName = Mid(CurrentData, CurrentPosition, NextPosition - CurrentPosition)>
  18.         <CFSET TextInsert = '<A HREF="sourcewindow.cfm?Template=#URLEncodedFormat(GetDirectoryFromPath(URL.Template))##TemplateName#">#TemplateName#</A>'>
  19.         <CFSET CurrentData = Left(CurrentData, CurrentPosition - 1) & TextInsert & Right(CurrentData, Len(CurrentData) - NextPosition + 1)>
  20.     </CFIF>
  21.  
  22. </CFLOOP>
  23.  
  24.  
  25. <CFSETTING ENABLECFOUTPUTONLY="NO">
  26. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  27.  
  28. <HTML>
  29. <HEAD>
  30.     <TITLE>Source Window</TITLE>
  31. </HEAD>
  32.  
  33. <BODY BGCOLOR="#FFFFD9" TEXT="#663300">
  34.  
  35. <FONT FACE="MS Sans Serif,Helvetica" SIZE="-1" COLOR="#000080">This
  36. is the CFML source for <B><CFOUTPUT>#URL.Template#</CFOUTPUT></B><BR>
  37. (You may want to open this file in Cold Fusion Studio in order
  38. to see the color coding.)</FONT>
  39. <HR>
  40. <PRE><CFOUTPUT>#CurrentData#</CFOUTPUT></PRE>
  41.  
  42.  
  43. </BODY>
  44. </HTML>
  45.