home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 1999 April / APC443.iso / features / grpware / coldfus / coldfusi.exe / data1.cab / Examples / publish / admin / deletecontent.cfm < prev    next >
Encoding:
Text File  |  1998-10-08  |  997 b   |  31 lines

  1. <!--- Delete content --->
  2.  
  3. <CFQUERY NAME="GetAll" DATASOURCE="CFexamples">
  4. SELECT * FROM PubContent, PubObjects, PubClassDefinitions, PubDataClasses, PubContentTypes
  5. WHERE PubObjects.ClassID = PubClassDefinitions.ClassID
  6.     AND PubClassDefinitions.TypeID = PubContent.TypeID
  7.     AND PubContent.ObjectID = PubObjects.ObjectID
  8.     AND PubDataClasses.ClassID = PubObjects.ClassID
  9.     AND PubContent.TypeID = PubContentTypes.TypeID
  10.     AND PubContent.ContentID = #ContentID#
  11. </CFQUERY>
  12.  
  13. <CFIF GetAll.Required IS TRUE>
  14.  
  15.     <CFOUTPUT QUERY="GetAll">
  16.         <SCRIPT LANGUAGE="JAVASCRIPT">
  17.         alert('All objects of class #ClassName# must have a #TypeName#.\n\nThis content cannot be deleted.');
  18.         location.replace('properties.cfm?ObjectID=#ObjectID#')
  19.         </SCRIPT>
  20.     </CFOUTPUT>
  21.  
  22. <CFELSE>
  23.  
  24.     <CFQUERY DATASOURCE="CFexamples" NAME="DeleteContent">
  25.     DELETE FROM PubContent
  26.     WHERE ContentID = #ContentID#
  27.     </CFQUERY>
  28.     
  29.     <CFLOCATION URL="properties.cfm?ObjectID=#GetAll.ObjectID#" ADDTOKEN="NO">
  30.  
  31. </CFIF>