home *** CD-ROM | disk | FTP | other *** search
- <!--- This template gets user input for REQUIRED content types.
- The Session variable Session.AddContent.ReqContentTypes
- holds a list of content types to be added, and the variable
- URL.CurrPos indicates which item on the list we are dealing
- with. --->
-
- <CFSET CurrID = ListGetAt(Session.AddContent.ReqContentTypes, URL.CurrPos)>
- <CFSET CurrName = ListGetAt(Session.AddContent.ReqContentTypeNames, URL.CurrPos)>
-
- <!--- Find out whether this content type is a file --->
- <CFQUERY DATASOURCE="CFexamples" NAME="GetContentType">
- SELECT * FROM PubContentTypes
- WHERE TypeID = #CurrID#
- </CFQUERY>
-
- <CFIF GetContentType.RecordCount NEQ 0>
- <CFIF "Headline,Teaser,Body" CONTAINS GetContentType.TypeName>
- <CFSET SampleText = "Enter your text...">
- <CFELSEIF GetContentType.TypeName IS "HREF">
- <CFSET SampleText = "http://your.server.com/">
- </CFIF>
- </CFIF>
- <CFPARAM NAME="SampleText" DEFAULT="">
-
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-
- <HTML>
- <HEAD>
- <TITLE>Add Content</TITLE>
- <STYLE TYPE="text/css">
- <!-- A {text-decoration: none} -->
- </STYLE>
- </HEAD>
-
- <BODY BGCOLOR="#660000" TEXT="#FFFFFF" LINK="#FFFF00" VLINK="#FFFF00">
-
- <TABLE ALIGN="RIGHT" CELLPADDING="0" CELLSPACING="0">
- <TR>
- <TD ALIGN="RIGHT">
- <FONT FACE="MS Sans Serif, Helvetica" SIZE="-2">
- <A HREF="index.cfm">Administrator Home</A>
- </FONT>
- </TD>
- </TR>
- </TABLE>
-
- <P><IMG SRC="images/addcontent.gif" WIDTH=109 HEIGHT=20 BORDER=0 ALT="Add Content"></P>
-
- <FORM ACTION="addcontent2.req.cfm" METHOD="POST">
-
- <CFOUTPUT>
- <INPUT TYPE="HIDDEN" NAME="CurrPos" VALUE="#URL.CurrPos#">
- <INPUT TYPE="HIDDEN" NAME="CurrItem" VALUE="#CurrID#">
- </CFOUTPUT>
-
- <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
- <TR>
-
- <TD VALIGN="TOP" WIDTH="100">
-
- <P><FONT FACE="MS Sans Serif, Helvetica" SIZE="-1">
- <CFLOOP LIST="#Session.AddContent.ReqContentTypeNames#" INDEX="TypeName">
- <CFIF TypeName IS CurrName>
- <B><CFOUTPUT>#TypeName#</CFOUTPUT></B><BR>
- <CFELSE>
- <FONT COLOR="#999999"><CFOUTPUT>#TypeName#</CFOUTPUT></FONT><BR>
- </CFIF>
- </CFLOOP>
- </FONT></P>
-
- <P><FONT FACE="MS Sans Serif, Helvetica" SIZE="-1">
- <CFLOOP LIST="#Session.AddContent.OptContentTypeNames#" INDEX="TypeName">
- <FONT COLOR="#999999"><CFOUTPUT>#TypeName#</CFOUTPUT></FONT><BR>
- </CFLOOP>
- </FONT></P>
-
- </TD>
-
- <TD> </TD>
-
- <TD VALIGN="TOP">
-
- <CFIF GetContentType.TypeFile IS TRUE>
-
- <CFDIRECTORY ACTION="LIST" DIRECTORY="#ExpandPath("../binarydata")#" NAME="BinDir">
-
- <CFOUTPUT><SELECT NAME="Type#CurrID#" SIZE="#Min(10,BinDir.RecordCount)#" onChange="if (this.selectedIndex == 1) this.selectedIndex = 0"></CFOUTPUT>
- <OPTION VALUE="|0">Upload new file...
- <OPTION VALUE="|1">------------------------
- <CFOUTPUT QUERY="BinDir">
- <CFIF NOT (Name IS "." OR Name IS "..")><OPTION>#Name#</CFIF>
- </CFOUTPUT>
- </SELECT>
-
- <CFELSE>
-
- <CFIF IsDefined("Session.AddContent.Content.Type" & CurrID)>
- <CFSET PreviousText = evaluate("Session.AddContent.Content.Type" & CurrID)>
- <CFELSE>
- <CFSET PreviousText = "">
- </CFIF>
-
- <CFOUTPUT>
- <CFIF PreviousText IS "">
- <TEXTAREA COLS="40" ROWS="12" NAME="Type#CurrID#">#SampleText#</TEXTAREA>
- <CFELSE>
- <TEXTAREA COLS="40" ROWS="12" NAME="Type#CurrID#">#evaluate("Session.AddContent.Content.Type" & CurrID)#</TEXTAREA>
- </CFIF>
- </CFOUTPUT>
-
- </CFIF>
-
- <P><INPUT TYPE="SUBMIT" VALUE="Next >"></P>
-
- </TD>
-
- </TR>
- </TABLE>
-
- </FORM>
-
- </BODY>
- </HTML>
-