home *** CD-ROM | disk | FTP | other *** search
- <!--- Delete content --->
-
- <CFQUERY NAME="GetAll" DATASOURCE="CFexamples">
- SELECT * FROM PubContent, PubObjects, PubClassDefinitions, PubDataClasses, PubContentTypes
- WHERE PubObjects.ClassID = PubClassDefinitions.ClassID
- AND PubClassDefinitions.TypeID = PubContent.TypeID
- AND PubContent.ObjectID = PubObjects.ObjectID
- AND PubDataClasses.ClassID = PubObjects.ClassID
- AND PubContent.TypeID = PubContentTypes.TypeID
- AND PubContent.ContentID = #ContentID#
- </CFQUERY>
-
- <CFIF GetAll.Required IS TRUE>
-
- <CFOUTPUT QUERY="GetAll">
- <SCRIPT LANGUAGE="JAVASCRIPT">
- alert('All objects of class #ClassName# must have a #TypeName#.\n\nThis content cannot be deleted.');
- location.replace('properties.cfm?ObjectID=#ObjectID#')
- </SCRIPT>
- </CFOUTPUT>
-
- <CFELSE>
-
- <CFQUERY DATASOURCE="CFexamples" NAME="DeleteContent">
- DELETE FROM PubContent
- WHERE ContentID = #ContentID#
- </CFQUERY>
-
- <CFLOCATION URL="properties.cfm?ObjectID=#GetAll.ObjectID#" ADDTOKEN="NO">
-
- </CFIF>