Location: PHPKode > scripts > HTML dbtree > html-dbtree/htmldbtree_doc-2005-04-24.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 Class HtmlDbTree</title>
			<style type='text/css'/>
			a { color: #336699; text-decoration: none; }
a:hover { color: #6699CC; text-decoration: underline; }
a:active { color: #6699CC; text-decoration: underline; }

body { background : #FFFFFF; }
body, table { font-family: Georgia, Times New Roman, Times, serif; font-size: 10pt }
p, li { line-height: 140% }
a img { border: 0px; }
dd { margin-left: 0px; padding-left: 1em; }

/* Page layout/boxes */

.info-box {}
.info-box-title { margin: 1em 0em 0em 0em; padding: .25em; font-weight: normal; font-size: 14pt; border: 2px solid #999999; background-color: #CCCCFF }
.info-box-body { border: 1px solid #999999; padding: .5em; }
.nav-bar { font-size: 8pt; white-space: nowrap; text-align: right; padding: .2em; margin: 0em 0em 1em 0em; }

.oddrow { background-color: #F8F8F8; border: 1px solid #AAAAAA; padding: .5em; margin-bottom: 1em}
.evenrow { border: 1px solid #AAAAAA; padding: .5em; margin-bottom: 1em}

.page-body { max-width: 800px; margin: auto; }
.tree dl { margin: 0px }

/* Index formatting classes */

.index-item-body { margin-top: .5em; margin-bottom: .5em}
.index-item-description { margin-top: .25em }
.index-item-details { font-weight: normal; font-style: italic; font-size: 8pt }
.index-letter-section { background-color: #EEEEEE; border: 1px dotted #999999; padding: .5em; margin-bottom: 1em}
.index-letter-title { font-size: 12pt; font-weight: bold }
.index-letter-menu { text-align: center; margin: 1em }
.index-letter { font-size: 12pt }

/* Docbook classes */

.description {}
.short-description { font-weight: bold; color: #666666; }
.tags {	padding-left: 0em; margin-left: 3em; color: #666666; list-style-type: square; }
.parameters {	padding-left: 0em; margin-left: 3em; font-style: italic; list-style-type: square; }
.redefinitions { font-size: 8pt; padding-left: 0em; margin-left: 2em; }
.package {  }
.package-title { font-weight: bold; font-size: 14pt; border-bottom: 1px solid black }
.package-details { font-size: 85%; }
.sub-package { font-weight: bold; font-size: 120% }
.tutorial { border-width: thin; border-color: #0066ff }
.tutorial-nav-box { width: 100%; border: 1px solid #999999; background-color: #F8F8F8; }
.nav-button-disabled { color: #999999; }
.nav-button:active, 
.nav-button:focus, 
.nav-button:hover { background-color: #DDDDDD; outline: 1px solid #999999; text-decoration: none }
.folder-title { font-style: italic }

/* Generic formatting */

.field { font-weight: bold; }
.detail { font-size: 8pt; }
.notes { font-style: italic; font-size: 8pt; }
.separator { background-color: #999999; height: 2px; }
.warning {  color: #FF6600; }
.disabled { font-style: italic; color: #999999; }

/* Code elements */

.line-number {  }

.class-table { width: 100%; }
.class-table-header { border-bottom: 1px dotted #666666; text-align: left}
.class-name { color: #000000; font-weight: bold; }

.method-summary { padding-left: 1em; font-size: 8pt }
.method-header { }
.method-definition { margin-bottom: .3em }
.method-title { font-weight: bold; }
.method-name { font-weight: bold; }
.method-signature { font-size: 85%; color: #666666; margin: .5em 0em }
.method-result { font-style: italic; }

.var-summary { padding-left: 1em; font-size: 8pt; }
.var-header { }
.var-title { margin-bottom: .3em }
.var-type { font-style: italic; }
.var-name { font-weight: bold; }
.var-default {}
.var-description { font-weight: normal; color: #000000; }

.include-title {  }
.include-type { font-style: italic; }
.include-name { font-weight: bold; }

.const-title {  }
.const-name { font-weight: bold; }

/* Syntax highlighting */

.src-code {  border: 1px solid #336699; padding: 1em; background-color: #EEEEEE; }
*[class="src-code"] {	line-height : 0.5em }

.src-comm { color: green; }
.src-id {  }
.src-inc { color: #0000FF; }
.src-key { color: #0000FF; }
.src-num { color: #CC0000; }
.src-str { color: #66cccc; }
.src-sym { font-weight: bold; }
.src-var { }

.src-php { font-weight: bold; }

.src-doc { color: #009999 }
.src-doc-close-template { color: #0000FF }
.src-doc-coretag { color: #0099FF; font-weight: bold }
.src-doc-inlinetag { color: #0099FF }
.src-doc-internal { color: #6699cc }
.src-doc-tag { color: #0080CC }
.src-doc-template { color: #0000FF }
.src-doc-type { font-style: italic }
.src-doc-var { font-style: italic }

.tute-tag { color: #009999 }
.tute-attribute-name { color: #0000FF }
.tute-attribute-value { color: #0099FF }
.tute-entity { font-weight: bold; }
.tute-comment { font-style: italic }
.tute-inline-tag { color: #636311; font-weight: bold }

/* tutorial */

.authors {  }
.author { font-style: italic; font-weight: bold }
.author-blurb { margin: .5em 0em .5em 2em; font-size: 85%; font-weight: normal; font-style: normal }
.example { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; }
*[class="example"] { line-height : 0.5em }
.listing { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; white-space: nowrap; }
*[class="listing"] { line-height : 0.5em }
.release-info { font-size: 85%; font-style: italic; margin: 1em 0em }
.ref-title-box {  }
.ref-title {  }
.ref-purpose { font-style: italic; color: #666666 }
.ref-synopsis {  }
.title { font-weight: bold; margin: 1em 0em 0em 0em; padding: .25em; border: 2px solid #999999; background-color: #CCCCFF  }
.cmd-synopsis { margin: 1em 0em }
.cmd-title { font-weight: bold }
.toc { margin-left: 2em; padding-left: 0em }
</style>
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			

<h2 class="class-name">Class HtmlDbTree</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-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
						|											<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Htmldbtree object for easy management of Mmodified Preordered Tree Traversal data represetation</p>
		<p class="notes">
			Located in <a class="field" href="_class-htmldbtree_php.html">/class-htmldbtree.php</a> (line <span class="field">23</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>



	<a name="sec-var-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Variable Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
							| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
								</div>
		<div class="info-box-body">
			<div class="var-summary">
								<div class="var-title">
					<span class="var-type">mixed</span>
					<a href="#$datas" title="details" class="var-name">$datas</a>
				</div>
								<div class="var-title">
					<span class="var-type">mixed</span>
					<a href="#$db" title="details" class="var-name">$db</a>
				</div>
								<div class="var-title">
					<span class="var-type">mixed</span>
					<a href="#$default_fields" title="details" class="var-name">$default_fields</a>
				</div>
								<div class="var-title">
					<span class="var-type">mixed</span>
					<a href="#$fields" title="details" class="var-name">$fields</a>
				</div>
								<div class="var-title">
					<span class="var-type">mixed</span>
					<a href="#$Q_STR" title="details" class="var-name">$Q_STR</a>
				</div>
								<div class="var-title">
					<span class="var-type">mixed</span>
					<a href="#$tablename" title="details" class="var-name">$tablename</a>
				</div>
							</div>
		</div>
	</div>

	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																		<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
				 
				|
						<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
								
				<div class="method-definition">
											<span class="method-result">HtmlDbTree</span>
										<a href="#HtmlDbTree" title="details" class="method-name">HtmlDbTree</a>
											([<span class="var-type">mysqldb</span>&nbsp;<span class="var-name">$db</span> = <span class="var-default">null</span>], <span class="var-type">strings</span>&nbsp;<span class="var-name">$tablename</span>, [<span class="var-type">array</span>&nbsp;<span class="var-name">$fields</span> = <span class="var-default">null</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$autoload</span> = <span class="var-default">TRUE</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$Q_STR</span> = <span class="var-default">null</span>])
									</div>
								
				<div class="method-definition">
											<span class="method-result">true</span>
										<a href="#add" title="details" class="method-name">add</a>
											(<span class="var-type">array</span>&nbsp;<span class="var-name">$info</span>, <span class="var-type">Integer/false</span>&nbsp;<span class="var-name">$parent</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result">bool</span>
										<a href="#add_as_brother" title="details" class="method-name">add_as_brother</a>
											(<span class="var-type">array</span>&nbsp;<span class="var-name">$info</span>, <span class="var-type">Integer/false</span>&nbsp;<span class="var-name">$brother</span>, [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$younger</span> = <span class="var-default">TRUE</span>])
									</div>
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#get_childs" title="details" class="method-name">get_childs</a>
											(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$item</span>, [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$depth</span> = <span class="var-default">FALSE</span>])
									</div>
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#get_extended_path" title="details" class="method-name">get_extended_path</a>
											(<span class="var-type">int</span>&nbsp;<span class="var-name">$item</span>, [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$withchild</span> = <span class="var-default">TRUE</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$onlyids</span> = <span class="var-default">FALSE</span>])
									</div>
								
				<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#get_path" title="details" class="method-name">get_path</a>
											(<span class="var-type">int</span>&nbsp;<span class="var-name">$item</span>, [<span class="var-type">bool</span>&nbsp;<span class="var-name">$keep_item</span> = <span class="var-default">TRUE</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$onlyids</span> = <span class="var-default">FALSE</span>])
									</div>
								
				<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#get_tree" title="details" class="method-name">get_tree</a>
											([<span class="var-type">int</span>&nbsp;<span class="var-name">$startnode</span> = <span class="var-default">FALSE</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$depth</span> = <span class="var-default">FALSE</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$inc_startnode</span> = <span class="var-default">TRUE</span>], <span class="var-type">int</span>&nbsp;<span class="var-name">$depth:</span>, <span class="var-type">bool</span>&nbsp;<span class="var-name">$inc_startnode:</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#html_get_options" title="details" class="method-name">html_get_options</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$show_fld</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$val_fld</span> = <span class="var-default">'id'</span>], [<span class="var-type">int</span>&nbsp;<span class="var-name">$selected_value</span> = <span class="var-default">null</span>], [<span class="var-type">int</span>&nbsp;<span class="var-name">$removednode</span> = <span class="var-default">null</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$startnode</span> = <span class="var-default">FALSE</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$depth</span> = <span class="var-default">FALSE</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$inc_startnode</span> = <span class="var-default">TRUE</span>])
									</div>
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#html_get_path" title="details" class="method-name">html_get_path</a>
											(<span class="var-type">str</span>&nbsp;<span class="var-name">$linkexp</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$labelfield</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$item</span>, [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$keep_item</span> = <span class="var-default">TRUE</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$stringglue</span> = <span class="var-default">' / '</span>])
									</div>
								
				<div class="method-definition">
											<span class="method-result">bool</span>
										<a href="#is_child" title="details" class="method-name">is_child</a>
											(<span class="var-type">int</span>&nbsp;<span class="var-name">$child</span>, <span class="var-type">int</span>&nbsp;<span class="var-name">$parent</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#load_tree" title="details" class="method-name">load_tree</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#make_sibling" title="details" class="method-name">make_sibling</a>
											(<span class="var-type">int</span>&nbsp;<span class="var-name">$item</span>, <span class="var-type">int</span>&nbsp;<span class="var-name">$sibling</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#rebuild_tree" title="details" class="method-name">rebuild_tree</a>
											(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$parent_id</span>, [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$left</span> = <span class="var-default">1</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$level</span> = <span class="var-default">-1</span>])
									</div>
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#remove" title="details" class="method-name">remove</a>
											(<span class="var-type">int</span>&nbsp;<span class="var-name">$item</span>, [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$return_removed_tree</span> = <span class="var-default">FALSE</span>])
									</div>
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#reparent" title="details" class="method-name">reparent</a>
											(<span class="var-type">int</span>&nbsp;<span class="var-name">$item</span>, <span class="var-type">int</span>&nbsp;<span class="var-name">$newparent</span>, <span class="var-type">str</span>&nbsp;<span class="var-name">$parent_col</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#set_field" title="details" class="method-name">set_field</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$field</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$field_db</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result">true</span>
										<a href="#set_fields" title="details" class="method-name">set_fields</a>
											([<span class="var-type">array</span>&nbsp;<span class="var-name">$fields</span> = <span class="var-default">null</span>])
									</div>
							</div>
		</div>
	</div>		

	<a name="sec-vars"></a>
	<div class="info-box">
		<div class="info-box-title">Variables</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
						
			
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			<a name="var$datas" id="$datas"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$datas</span>
						(line <span class="line-number">25</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">we'll store the data in this</p>
	
	
		
		

</div>
<a name="var$db" id="$db"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$db</span>
						(line <span class="line-number">27</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">our database object</p>
	
	
		
		

</div>
<a name="var$default_fields" id="$default_fields"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$default_fields</span>
						(line <span class="line-number">33</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">the defaults fields name</p>
	
	
		
		

</div>
<a name="var$fields" id="$fields"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$fields</span>
						(line <span class="line-number">31</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">contain the corresponding fields name for the table</p>
	
	
		
		

</div>
<a name="var$Q_STR" id="$Q_STR"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$Q_STR</span>
			 = <span class="var-default"> null</span>			(line <span class="line-number">35</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">you can assign a SQL query string of your own for tree retrieving by seting this param</p>
	
	
		
		

</div>
<a name="var$tablename" id="$tablename"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$tablename</span>
						(line <span class="line-number">29</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">the database table name</p>
	
	
		
		

</div>

						
		</div>
	</div>
	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
																	<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="methodHtmlDbTree" id="HtmlDbTree"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">Constructor HtmlDbTree</span> (line <span class="line-number">43</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">create a tree object from a database table storing Modified Preordered Tree Traversal datas</p>
	<ul class="tags">
				<li><span class="field">uses:</span> mysqldb,  - sqlitedb</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">HtmlDbTree</span>
		<span class="method-name">
			HtmlDbTree
		</span>
					([<span class="var-type">mysqldb</span>&nbsp;<span class="var-name">$db</span> = <span class="var-default">null</span>], <span class="var-type">strings</span>&nbsp;<span class="var-name">$tablename</span>, [<span class="var-type">array</span>&nbsp;<span class="var-name">$fields</span> = <span class="var-default">null</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$autoload</span> = <span class="var-default">TRUE</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$Q_STR</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">mysqldb</span>
				<span class="var-name">$db</span><span class="var-description">: a mysqldb object (a sqlitedb could be used too)</span>			</li>
					<li>
				<span class="var-type">strings</span>
				<span class="var-name">$tablename</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$fields</span><span class="var-description">: array('right_id'=&gt;'','left_id'=&gt;'','level'=&gt;'','id'=&gt;'','parent'=&gt;'') map the columns names</span>			</li>
				</ul>
		
		
	</div>
<a name="methodadd" id="add"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">add</span> (line <span class="line-number">333</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">add - adds an element from the SQL tree You must call load_tree after this one</p>
	
	<div class="method-signature">
		<span class="method-result">true</span>
		<span class="method-name">
			add
		</span>
					(<span class="var-type">array</span>&nbsp;<span class="var-name">$info</span>, <span class="var-type">Integer/false</span>&nbsp;<span class="var-name">$parent</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$info</span><span class="var-description">: Array   Other coloumns</span>			</li>
					<li>
				<span class="var-type">Integer/false</span>
				<span class="var-name">$parent</span><span class="var-description">: Parent ID (false = root)</span>			</li>
				</ul>
		
		
	</div>
<a name="methodadd_as_brother" id="add_as_brother"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">add_as_brother</span> (line <span class="line-number">396</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">add a new node as a younger or older  brother of the $brother node</p>
	
	<div class="method-signature">
		<span class="method-result">bool</span>
		<span class="method-name">
			add_as_brother
		</span>
					(<span class="var-type">array</span>&nbsp;<span class="var-name">$info</span>, <span class="var-type">Integer/false</span>&nbsp;<span class="var-name">$brother</span>, [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$younger</span> = <span class="var-default">TRUE</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$info</span><span class="var-description">: Array   Other coloumns</span>			</li>
					<li>
				<span class="var-type">Integer/false</span>
				<span class="var-name">$brother</span><span class="var-description">: brother ID (false = root)</span>			</li>
				</ul>
		
		
	</div>
<a name="methodget_childs" id="get_childs"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">get_childs</span> (line <span class="line-number">296</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			get_childs
		</span>
					(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$item</span>, [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$depth</span> = <span class="var-default">FALSE</span>])
			</div>
	
		
		
	</div>
<a name="methodget_extended_path" id="get_extended_path"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">get_extended_path</span> (line <span class="line-number">245</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">return the extended path to the node with all ancestors expanded  the principle is pretty simple we take all nodes and remove nodes that aren't direct child of ancestors.</p>
<p class="description"><p>the first level nodes will always be displayed</p></p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			get_extended_path
		</span>
					(<span class="var-type">int</span>&nbsp;<span class="var-name">$item</span>, [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$withchild</span> = <span class="var-default">TRUE</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$onlyids</span> = <span class="var-default">FALSE</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$item</span>			</li>
				</ul>
		
		
	</div>
<a name="methodget_path" id="get_path"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">get_path</span> (line <span class="line-number">225</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">return parents node of this item</p>
	<ul class="tags">
				<li><span class="field">return:</span> indexed by level</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			get_path
		</span>
					(<span class="var-type">int</span>&nbsp;<span class="var-name">$item</span>, [<span class="var-type">bool</span>&nbsp;<span class="var-name">$keep_item</span> = <span class="var-default">TRUE</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$onlyids</span> = <span class="var-default">FALSE</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$item</span><span class="var-description">: the item to retrieve path to</span>			</li>
					<li>
				<span class="var-type">bool</span>
				<span class="var-name">$keep_item</span><span class="var-description">: include item in path or not</span>			</li>
				</ul>
		
		
	</div>
<a name="methodget_tree" id="get_tree"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">get_tree</span> (line <span class="line-number">121</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">this will return the tree structure.</p>
	<ul class="tags">
				<li><span class="field">usedby:</span> <a href="../DB/HtmlDbTree.html#methodload_tree">HtmlDbTree::load_tree()</a></li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			get_tree
		</span>
					([<span class="var-type">int</span>&nbsp;<span class="var-name">$startnode</span> = <span class="var-default">FALSE</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$depth</span> = <span class="var-default">FALSE</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$inc_startnode</span> = <span class="var-default">TRUE</span>], <span class="var-type">int</span>&nbsp;<span class="var-name">$depth:</span>, <span class="var-type">bool</span>&nbsp;<span class="var-name">$inc_startnode:</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$startnode</span><span class="var-description">: this will be an integer or false,         if its an integer we will get all children,         if its false we will get the entire tree</span>			</li>
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$depth:</span><span class="var-description">: this will be an integer, or false         represents the number of levels to dig for data.</span>			</li>
					<li>
				<span class="var-type">bool</span>
				<span class="var-name">$inc_startnode:</span><span class="var-description">: whether or not to include parent in result set</span>			</li>
				</ul>
		
		
	</div>
<a name="methodhtml_get_options" id="html_get_options"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">html_get_options</span> (line <span class="line-number">164</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">get html option for select form input in a really simple way</p>
	<ul class="tags">
				<li><span class="field">return:</span> or FALSE</li>
				<li><span class="field">uses:</span> HtmlDbTree::get_tree</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			html_get_options
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$show_fld</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$val_fld</span> = <span class="var-default">'id'</span>], [<span class="var-type">int</span>&nbsp;<span class="var-name">$selected_value</span> = <span class="var-default">null</span>], [<span class="var-type">int</span>&nbsp;<span class="var-name">$removednode</span> = <span class="var-default">null</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$startnode</span> = <span class="var-default">FALSE</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$depth</span> = <span class="var-default">FALSE</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$inc_startnode</span> = <span class="var-default">TRUE</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$show_fld</span><span class="var-description">: the column name used as option's labels</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$val_fld</span><span class="var-description">: the column name used as option's values</span>			</li>
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$selected_value</span><span class="var-description">: the optionnal selected option's value</span>			</li>
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$removednode</span><span class="var-description">: | array $removednode the nodes ids to remove</span>			</li>
				</ul>
		
		
	</div>
<a name="methodhtml_get_path" id="html_get_path"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">html_get_path</span> (line <span class="line-number">194</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">return a subset of links to get the path of previous node</p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			html_get_path
		</span>
					(<span class="var-type">str</span>&nbsp;<span class="var-name">$linkexp</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$labelfield</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$item</span>, [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$keep_item</span> = <span class="var-default">TRUE</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$stringglue</span> = <span class="var-default">' / '</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">str</span>
				<span class="var-name">$linkexp</span><span class="var-description">: linkexp is an expression with fields replacement          ie: &quot;index.php?cat=%=id=%&quot; where %=id=% will be replace by the value in the id field          so this could be id, left_id,right_id, level, and so on</span>			</li>
				</ul>
		
		
	</div>
<a name="methodis_child" id="is_child"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">is_child</span> (line <span class="line-number">214</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">check if $child is a descendant of $parent</p>
	
	<div class="method-signature">
		<span class="method-result">bool</span>
		<span class="method-name">
			is_child
		</span>
					(<span class="var-type">int</span>&nbsp;<span class="var-name">$child</span>, <span class="var-type">int</span>&nbsp;<span class="var-name">$parent</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$child</span>			</li>
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$parent</span>			</li>
				</ul>
		
		
	</div>
<a name="methodload_tree" id="load_tree"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">load_tree</span> (line <span class="line-number">107</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">uses:</span> <a href="../DB/HtmlDbTree.html#methodget_tree">HtmlDbTree::get_tree()</a></li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			load_tree
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodmake_sibling" id="make_sibling"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">make_sibling</span> (line <span class="line-number">286</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">move the given node to be the direct brother of the $sibling node</p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			make_sibling
		</span>
					(<span class="var-type">int</span>&nbsp;<span class="var-name">$item</span>, <span class="var-type">int</span>&nbsp;<span class="var-name">$sibling</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$item</span>			</li>
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$sibling</span>			</li>
				</ul>
		
		
	</div>
<a name="methodrebuild_tree" id="rebuild_tree"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">rebuild_tree</span> (line <span class="line-number">87</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">rebuild the tree (right_id,left_id,and level) from the parent column</p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			rebuild_tree
		</span>
					(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$parent_id</span>, [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$left</span> = <span class="var-default">1</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$level</span> = <span class="var-default">-1</span>])
			</div>
	
		
		
	</div>
<a name="methodremove" id="remove"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">remove</span> (line <span class="line-number">303</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">remove an item from the database and re-index left and right ids.</p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			remove
		</span>
					(<span class="var-type">int</span>&nbsp;<span class="var-name">$item</span>, [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$return_removed_tree</span> = <span class="var-default">FALSE</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$item</span><span class="var-description">: id</span>			</li>
				</ul>
		
		
	</div>
<a name="methodreparent" id="reparent"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">reparent</span> (line <span class="line-number">274</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">reparent the given child as a $newparent child</p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			reparent
		</span>
					(<span class="var-type">int</span>&nbsp;<span class="var-name">$item</span>, <span class="var-type">int</span>&nbsp;<span class="var-name">$newparent</span>, <span class="var-type">str</span>&nbsp;<span class="var-name">$parent_col</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$item</span><span class="var-description">: the item id</span>			</li>
					<li>
				<span class="var-type">str</span>
				<span class="var-name">$parent_col</span><span class="var-description">: name of the parent column name in database</span>			</li>
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$newparent</span><span class="var-description">: the new parent id</span>			</li>
				</ul>
		
		
	</div>
<a name="methodset_field" id="set_field"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">set_field</span> (line <span class="line-number">60</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">set the fieldname in database corresponding to the default ones</p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			set_field
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$field</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$field_db</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$field</span><span class="var-description">: the field to retrieve in (right_id,left_id,level,id)</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$field_db</span><span class="var-description">: the corresponding name of the table column</span>			</li>
				</ul>
		
		
	</div>
<a name="methodset_fields" id="set_fields"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">set_fields</span> (line <span class="line-number">72</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">set all fields name at once from an indexed array where</p>
<p class="description"><p>key are right_id, left_id, level ,id and the values are the corresponding column name</p></p>
	
	<div class="method-signature">
		<span class="method-result">true</span>
		<span class="method-name">
			set_fields
		</span>
					([<span class="var-type">array</span>&nbsp;<span class="var-name">$fields</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$fields</span><span class="var-description">: array('right_id'=&gt;'','left_id'=&gt;'','level'=&gt;'','id'=&gt;'') if null will reset to default values</span>			</li>
				</ul>
		
		
	</div>
						
		</div>
	</div>


	<p class="notes" id="credit">
		Documentation generated on Sun, 24 Apr 2005 17:50:36 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.0RC3</a>
	</p>
	</div></body>
</html>
Return current item: HTML dbtree