Location: PHPKode > projects > Program E > docs/developer/application/_cms_include_delete_inc_php.html
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos  -->
			<title>Docs for page delete.inc.php</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
						<script src="../media/lib/classTree.js"></script>
												<script language="javascript" type="text/javascript">
				var imgPlus = new Image();
				var imgMinus = new Image();
				imgPlus.src = "../media/images/plus.png";
				imgMinus.src = "../media/images/minus.png";
				
				function showNode(Node){
							switch(navigator.family){
								case 'nn4':
									// Nav 4.x code fork...
							var oTable = document.layers["span" + Node];
							var oImg = document.layers["img" + Node];
									break;
								case 'ie4':
									// IE 4/5 code fork...
							var oTable = document.all["span" + Node];
							var oImg = document.all["img" + Node];
									break;
								case 'gecko':
									// Standards Compliant code fork...
							var oTable = document.getElementById("span" + Node);
							var oImg = document.getElementById("img" + Node);
									break;
							}
					oImg.src = imgMinus.src;
					oTable.style.display = "block";
				}
				
				function hideNode(Node){
							switch(navigator.family){
								case 'nn4':
									// Nav 4.x code fork...
							var oTable = document.layers["span" + Node];
							var oImg = document.layers["img" + Node];
									break;
								case 'ie4':
									// IE 4/5 code fork...
							var oTable = document.all["span" + Node];
							var oImg = document.all["img" + Node];
									break;
								case 'gecko':
									// Standards Compliant code fork...
							var oTable = document.getElementById("span" + Node);
							var oImg = document.getElementById("img" + Node);
									break;
							}
					oImg.src = imgPlus.src;
					oTable.style.display = "none";
				}
				
				function nodeIsVisible(Node){
							switch(navigator.family){
								case 'nn4':
									// Nav 4.x code fork...
							var oTable = document.layers["span" + Node];
									break;
								case 'ie4':
									// IE 4/5 code fork...
							var oTable = document.all["span" + Node];
									break;
								case 'gecko':
									// Standards Compliant code fork...
							var oTable = document.getElementById("span" + Node);
									break;
							}
					return (oTable && oTable.style.display == "block");
				}
				
				function toggleNodeVisibility(Node){
					if (nodeIsVisible(Node)){
						hideNode(Node);
					}else{
						showNode(Node);
					}
				}
			</script>
					</head>
		<body>
			<div class="page-body">			

<h2 class="file-name"><img src="../media/images/Page_logo.png" alt="File" style="vertical-align: middle">/cms/include/delete.inc.php</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
															<a href="#sec-functions">Functions</a>
			</div>
	<div class="info-box-body">	
		<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">filesource:</span> <a href="..//__filesource/fsource_application__cmsincludedelete.inc.php.html">Source Code for this file</a></li>
			</ul>
		
			</div>
</div>
		

	
	
	
	<a name="sec-functions"></a>	
	<div class="info-box">
		<div class="info-box-title">Functions</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<span class="disabled">Functions</span>
		</div>
		<div class="info-box-body">	
			<a name="functiondeleteCheck" id="functiondeleteCheck"><!-- --></a>
<div class="oddrow">
	
	<div>
		<img src="../media/images/Function.png" />
		<span class="method-title">deleteCheck</span> (line <span class="line-number"><a href="..//__filesource/fsource_application__cmsincludedelete.inc.php.html#a187">187</a></span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Check if it is safe to delete node.</p>
<p class="description"><p>In order to be able to delete a node from a tree, there shouldn't be any  other records referencing to it. This function checks this for this  these types of references. So it checks to see if it's safe to delete this  node. TRUE -&gt; safe, FALSE -&gt; not safe.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> TRUE/FALSE.</li>
				<li><span class="field">usedby:</span> <a href="../application/_cms_include_delete_inc_php.html#functiondelete_category">delete_category()</a></li>
			</ul>
	<div class="method-signature">
		<span class="method-result">boolean</span>
		<span class="method-name">
			deleteCheck
		</span>
					(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$parentID</span>, <span class="var-type">integer</span>&nbsp;<span class="var-name">$patternID</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$patternID</span><span class="var-description">: The word's pattern ID</span>			</li>
				</ul>
		
	
</div>
<a name="functiondeletePatternElement" id="functiondeletePatternElement"><!-- --></a>
<div class="evenrow">
	
	<div>
		<img src="../media/images/Function.png" />
		<span class="method-title">deletePatternElement</span> (line <span class="line-number"><a href="..//__filesource/fsource_application__cmsincludedelete.inc.php.html#a122">122</a></span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Delete the word from the Pattern Table.</p>
<p class="description"><p>Remove the record from the pattern table using it's unique ID.</p></p>
	<ul class="tags">
				<li><span class="field">usedby:</span> <a href="../application/_cms_include_delete_inc_php.html#functiondelete_category">delete_category()</a></li>
				<li><span class="field">uses:</span> <a href="../application/_cms_include_common_inc_php.html#functiondebugger">debugger()</a></li>
			</ul>
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			deletePatternElement
		</span>
					(<span class="var-type">integer</span>&nbsp;<span class="var-name">$patternID</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$patternID</span><span class="var-description">: The word's pattern ID</span>			</li>
				</ul>
		
	
</div>
<a name="functiondeleteTemplate" id="functiondeleteTemplate"><!-- --></a>
<div class="oddrow">
	
	<div>
		<img src="../media/images/Function.png" />
		<span class="method-title">deleteTemplate</span> (line <span class="line-number"><a href="..//__filesource/fsource_application__cmsincludedelete.inc.php.html#a142">142</a></span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Delete the template from the Template Table.</p>
<p class="description"><p>Delete the template record with a particular ID.</p></p>
	<ul class="tags">
				<li><span class="field">usedby:</span> <a href="../application/_cms_include_delete_inc_php.html#functiondelete_category">delete_category()</a></li>
				<li><span class="field">uses:</span> <a href="../application/_cms_include_common_inc_php.html#functiondebugger">debugger()</a></li>
			</ul>
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			deleteTemplate
		</span>
					(<span class="var-type">integer</span>&nbsp;<span class="var-name">$templateID</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$templateID</span><span class="var-description">: The category's ID</span>			</li>
				</ul>
		
	
</div>
<a name="functiondelete_category" id="functiondelete_category"><!-- --></a>
<div class="evenrow">
	
	<div>
		<img src="../media/images/Function.png" />
		<span class="method-title">delete_category</span> (line <span class="line-number"><a href="..//__filesource/fsource_application__cmsincludedelete.inc.php.html#a49">49</a></span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Delete a category using template ID</p>
<p class="description"><p>This is the container function for a set of other functions for the  deletion of a category. It will travel the AIML tree backwards checking  if a word-node is used by other categories, if not then deletes it and  travels onward to the next word-node. If it it is used, then breaks of  the routine, it has then accomplised what it needed to do.</p></p>
	<ul class="tags">
				<li><span class="field">uses:</span> <a href="../application/_cms_include_delete_inc_php.html#functiondeleteCheck">deleteCheck()</a></li>
				<li><span class="field">uses:</span> <a href="../application/_cms_include_common_inc_php.html#functionfindParent">findParent()</a></li>
				<li><span class="field">uses:</span> <a href="../application/_cms_include_delete_inc_php.html#functiondeletePatternElement">deletePatternElement()</a></li>
				<li><span class="field">uses:</span> <a href="../application/_cms_include_delete_inc_php.html#functionupdateGmcache">updateGmcache()</a></li>
				<li><span class="field">uses:</span> <a href="../application/_cms_include_delete_inc_php.html#functiondeleteTemplate">deleteTemplate()</a></li>
				<li><span class="field">uses:</span> <a href="../application/_cms_include_common_inc_php.html#functiondebugger">debugger()</a></li>
				<li><span class="field">uses:</span> <a href="../application/_cms_include_common_inc_php.html#functiontemplateCheck">templateCheck()</a></li>
				<li><span class="field">uses:</span> <a href="../application/_cms_include_delete_inc_php.html#functionfindprevioustemplate">findprevioustemplate()</a></li>
				<li><span class="field">uses:</span> <a href="../application/_cms_include_common_inc_php.html#functionfindmainnode">findmainnode()</a></li>
			</ul>
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			delete_category
		</span>
					(<span class="var-type">integer</span>&nbsp;<span class="var-name">$templateID</span>, <span class="var-type">integer</span>&nbsp;<span class="var-name">$botid</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$templateID</span><span class="var-description">: The template's ID</span>			</li>
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$botid</span><span class="var-description">: The bot's ID.</span>			</li>
				</ul>
		
	
</div>
<a name="functionfindprevioustemplate" id="functionfindprevioustemplate"><!-- --></a>
<div class="oddrow">
	
	<div>
		<img src="../media/images/Function.png" />
		<span class="method-title">findprevioustemplate</span> (line <span class="line-number"><a href="..//__filesource/fsource_application__cmsincludedelete.inc.php.html#a219">219</a></span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Retrieve the previous category's reference to the template Table.</p>
<p class="description"><p>Categories are put in the database in sequence with the last record being  the reference to the template table. Thus a category (roughly) would exist  from template reference to template reference.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> pattern/template ID.</li>
				<li><span class="field">usedby:</span> <a href="../application/_cms_include_delete_inc_php.html#functiondelete_category">delete_category()</a></li>
			</ul>
	<div class="method-signature">
		<span class="method-result">integer</span>
		<span class="method-name">
			findprevioustemplate
		</span>
					(<span class="var-type">integer</span>&nbsp;<span class="var-name">$templateID</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$templateID</span><span class="var-description">: The category's ID</span>			</li>
				</ul>
		
	
</div>
<a name="functionupdateGmcache" id="functionupdateGmcache"><!-- --></a>
<div class="evenrow">
	
	<div>
		<img src="../media/images/Function.png" />
		<span class="method-title">updateGmcache</span> (line <span class="line-number"><a href="..//__filesource/fsource_application__cmsincludedelete.inc.php.html#a166">166</a></span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Disable record in GMcache table.</p>
<p class="description"><p>The GMcache is used to speed up the bot's response time, by checking the  cache first before waking the AIML tree. But also means that if a category  is deleted, all Cached references need to be deleted or edited too.  Currently the records are edited, the Combined contents is replaced by  REMOVED and the template ID is replaced by 0</p></p>
	<ul class="tags">
				<li><span class="field">usedby:</span> <a href="../application/_cms_include_delete_inc_php.html#functiondelete_category">delete_category()</a></li>
				<li><span class="field">uses:</span> <a href="../application/_cms_include_common_inc_php.html#functiondebugger">debugger()</a></li>
			</ul>
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			updateGmcache
		</span>
					(<span class="var-type">integer</span>&nbsp;<span class="var-name">$templateID</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$templateID</span><span class="var-description">: The category's ID</span>			</li>
				</ul>
		
	
</div>
		</div>
	</div>
	
	<p class="notes" id="credit">
		Documentation generated on Tue, 11 Jan 2005 18:41:03 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.0RC3</a>
	</p>
	</div></body>
</html>
Return current item: Program E