File: draw_tree_node.php

package info (click to toggle)
phpldapadmin 1.1.0.5-6%2Blenny2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 5,008 kB
  • ctags: 3,949
  • sloc: php: 17,735; xml: 1,532; sh: 388; makefile: 46
file content (41 lines) | stat: -rw-r--r-- 874 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/draw_tree_node.php,v 1.2.2.1 2007/12/21 12:11:55 wurley Exp $

/**
 * @package phpLDAPadmin
 */

	$entry['dn'] = get_request('dn','REQUEST');
	$entry['server_id'] = get_request('server_id','REQUEST');
	$entry['code'] = get_request('code','REQUEST');
	$entry['action'] = get_request('action','REQUEST');

	$tree = Tree::getInstance($entry['server_id']);
	if (! $tree)
		die();

	$dnentry = $tree->getEntry($entry['dn']);
	if (! $dnentry) {
		$tree->addEntry($entry['dn']);
		$dnentry = $this->getEntry($entry['dn']);
	}

	if (! $dnentry)
		die();

	if ($entry['action'] == 0) {
		$dnentry->close();

	} elseif ($entry['action'] == 2) {
		$dnentry->open();

	} else {
		$dnentry->open();
		if ($entry['dn']) {
			echo $tree->draw_children($dnentry,$entry['code']);
		} else {
			$tree->draw(true);
		}
	}
	die();
?>