Location: PHPKode > projects > Content*Builder > contentbuilder/lib/CB_TreeExtensions.class.php
<?php
	class CMTree extends CB_Tree {
		var $startLevel = 0;
		var $folderLevel	 = array();
		var $folderStatus	= array();
		var $folderID		 = array();
		var $folderIDSet	 = array();
		var $folderSpace	 = array();
		var $folderSort	  = array();
		var $folderExtra	 = array();
		var $folderLoadURL  = array();
		var $lastSubElement = array();
		var $lastLevel = 1;
				
		function setMainFolder($id) {
			$this->mainFolder = $id;
		}
		
		function getOpenFolders($openfolder, $limitStructure = 1) {
			$this->limitStructure = $limitStructure;
			$this->openThisFolder[$openfolder] = "1";
			$thisLevel  = $this->flatStructure[$openfolder];
			$thisMother = $this->parentStructure[$openfolder];
			if(empty($this->COLUMN_restriction)) {
				if($thisLevel == 1) {
					$this->rootNode = $openfolder;
				}
				if(($thisLevel - 1) > 0) {
					$this->getOpenFolders($thisMother);
				}
			} else {
				if($thisLevel - $this->COLUMN_restrictStatus == 1) {
					$this->rootNode = $openfolder;
				}
				if(($thisLevel - $this->COLUMN_restrictStatus) > 1) {
					$this->getOpenFolders($thisMother, $limitStructure);
				}
			}
		}
		
		function setOpenFolder($openfolder) {
			$this->openfolder = $openfolder;
		}
		
		function setStartLevel($level) {
			$this->startLevel = $level;
		}
		
		function getRootName() {
			$key = $this->rootNode;
			return $this->folder['1'][$key]['fname'];
		}
		
		function printMenu($fid, $fname, $level) {
			echo $this->test;
			$this->folderName[]	 = $fname;
			$this->folderID[]		= $fid;
			$lev = 2;
			$fold = "&nbsp;&nbsp;&nbsp;&nbsp;|--";
			while ($lev < $level) {
				$fold = $fold."-|--";	
				$lev++;		
			}
			if($fid == $this->mainFolder) {
				$this->folderMainChk[] = "checked";
				$this->folderMainSel[] = "selected";
			} else {
				$this->folderMainChk[] = "";
				$this->folderMainSel[] = "";
			}
			if($level == 1) {
				$this->folderSpace[]	= "|-";
			} else {
				$this->folderSpace[]	= $fold;
			}
			
			$loadURL = "";
			$loadURL = substr($this->nodes[$level][$fid]['loadurl'], 0, 24);
			if(strlen($this->folder[$level][$fid]['loadurl']) > 24) {
				$loadURL .= "...";
			}
			
			$this->folderLevel[]	= $level;
			$this->folderSort[]	 = $this->nodes[$level][$fid]['sort'];
			$this->folderLoadURL[] = $loadURL;
		}
	}
?>
Return current item: Content*Builder