function display_tree($expanded, $row = 0, $start = 0) { // display the tree view of conversations global $table_width; echo "<table width = {$table_width}>"; // see if we are displaying the whole list or a sublist if ($start > 0) { $sublist = true; } else { $sublist = false; } // construct tree structure to represent conversation summary $tree = new treenode($start, '', '', '', 1, true, -1, $expanded, $sublist); // tell tree to display itself $tree->display($row, $sublist); echo '</table>'; }
/** * Method to get a tree for sharing nodes * @param string $contextId The Context Id * @param string $mode The type of tree , either DHTML or Dropdown * @return string * @access public */ function getTree($contextId, $mode = NULL, $modeParams = NULL) { $icon = 'folder_up.gif'; $expandedIcon = 'folder-expanded.gif'; $link = ''; $rootnodeid = $this->objDBContext->getRootNodeId($contextId); $rootlabel = ''; //Create a new menu $menu = new treemenu(); $contentlink = $this->URI(array('action', 'contenthome'), $this->module); //create base node $basenode = new treenode(array('text' => $rootlabel, 'link' => $contentlink, 'icon' => 'base.gif', 'expandedIcon' => 'base.gif')); $this->objDBContentNodes->resetTable(); $nodesArr = $this->objDBContentNodes->getAll("WHERE tbl_context_parentnodes_id='{$rootnodeid}'"); $this->objDBContentNodes->changeTable('tbl_context_nodes_has_tbl_context_page_content'); foreach ($nodesArr as $node) { if ($node['parent_Node'] == null) { $basenode->addItem($this->getChildNodes($nodesArr, $node['id'], stripslashes($this->shortenString($node['title'])))); } } $this->objDBContentNodes->resetTable(); $menu->addItem($basenode); //$menu->addItem($this->recurTree($rootnodeid,$rootlabel)); // Create the presentation class $treeMenu =& new dhtml($menu, array('images' => $this->objSkin->getSkinURL() . '/treeimages/imagesAlt2', 'defaultClass' => 'treeMenuDefault')); if ($mode == 'listbox') { $listBox =& new listbox($menu, array('linkTarget' => '_self', 'submitText' => $modeParams['submitText'], 'promoText' => $modeParams['promoText'])); return $listBox->getMenu(); } return '<h5>' . $this->objDBContext->getTitle() . '</h5>' . $treeMenu->getMenu(); }
/** * Method to show a directory tree * ...still working here */ function showDirTree() { $this->icon = 'folder.gif'; $this->expandedIcon = 'folder-expanded.gif'; $menu = new treemenu(); $contentlink = ''; $basenode = new treenode(array('text' => '\\...', 'link' => $contentlink, 'icon' => 'base.gif', 'expandedIcon' => 'base.gif')); //create other nodes and add them to the base node $nodes =& $basenode->addItem($this->_setDirNodes($basenode, $this->objAltConfig->getsiteRootPath())); //add base node to the menu $menu->addItem($basenode); $treeMenu =& new dhtml($menu, array('images' => $this->objSkin->getSkinURL() . '/treeimages/imagesAlt2', 'defaultClass' => 'treeMenuDefault')); $this->setVar('dirtree', $treeMenu->getMenu()); //echo $this->recurseDir($this->objConfig->siteRootPath()); }