This class implements an AJAX based tree.

package phpLDAPadmin
subpackage Tree
see \global\HTMLTree

 Methods

Add an entry in the tree view ; the entry is added in the children array of its parent

addEntry(\dn | string $dn) 
Inherited

inherited_from \Tree::addEntry()
inherited_from \HTMLTree::addEntry()

Parameters

$dn

\dnstring

DN to add

Delete an entry from the tree view ; the entry is deleted from the children array of its parent

delEntry(\dn $dn) 
Inherited

inherited_from \Tree::delEntry()
inherited_from \HTMLTree::delEntry()

Parameters

$dn

\dn

DN to remote

Displays the tree in HTML

draw(boolean $onlytree) 
Inherited

inherited_from \HTMLTree::draw()

Parameters

$onlytree

boolean

Only display the tree, or include the server name and menu items

Expand and draw a child entry, when it is clicked on.

draw_children($parent_entry, $code) 

This is using AJAX just to render this section of the tree.

Parameters

$parent_entry

$code

Get the entries that are BaseDN entries.

getBaseEntries() : array
Inherited

inherited_from \Tree::getBaseEntries()
inherited_from \HTMLTree::getBaseEntries()

Returns

arrayBase DN entries

Work out how deep the "opened" tree is.

getDepth() 
Inherited

inherited_from \HTMLTree::getDepth()

Get a tree entry

getEntry(\dn $dn) : object
Inherited

inherited_from \Tree::getEntry()
inherited_from \HTMLTree::getEntry()

Parameters

$dn

\dn

DN to retrieve

Returns

objectTree DN object

Create an instance of the tree - this is used when we call this class directly Tree::getInstance($index)

getInstance($server_id) : object
Inherited

inherited_from \Tree::getInstance()
inherited_from \HTMLTree::getInstance()

Parameters

$server_id

Returns

objectTree

List the items in the tree that are open

listOpenItems() : array

Returns

arrayList of open nodes

Read the children of a tree entry

readChildren(\dn $dn, boolean $nolimit) 
Inherited

inherited_from \Tree::readChildren()
inherited_from \HTMLTree::readChildren()

Parameters

$dn

\dn

DN of the entry

$nolimit

boolean

LDAP Size Limit

Rename an entry in the tree

renameEntry(\dn $dnOLD, \dn $dnNEW) 
Inherited

inherited_from \Tree::renameEntry()
inherited_from \HTMLTree::renameEntry()

Parameters

$dnOLD

\dn

Old DN

$dnNEW

\dn

New DN

__construct()

__construct($server_id) 
Inherited

inherited_from \Tree::__construct()
inherited_from \HTMLTree::__construct()

Parameters

$server_id

Draw a node of the tree

draw_item(\dn $item, string $level, boolean $first_child, boolean $last_child) 

Parameters

$item

\dn

The Base DN to draw

$level

string

a string of 0 and 1 ; $level == "000101" will draw " | |"

$first_child

boolean

is the first child entry, which is normally the "Create New Entry" option

$last_child

boolean

is the last child entry, which is normally the "Create New Entry" option

Draw the javascript to support the tree.

draw_javascript() 

Draw the Logged in User

draw_logged_in_user() 
Inherited

inherited_from \HTMLTree::draw_logged_in_user()

Draw the tree menu options

draw_menu() 
Inherited

inherited_from \HTMLTree::draw_menu()

Draw the server name

draw_server_name() 
Inherited

inherited_from \HTMLTree::draw_server_name()

Get the server Object for this tree

getServer() : object
Inherited

inherited_from \Tree::getServer()
inherited_from \HTMLTree::getServer()

Returns

objectServer Object for this tree

Get the Server ID for this tree

getServerID() : int
Inherited

inherited_from \Tree::getServerID()
inherited_from \HTMLTree::getServerID()

Returns

intServer ID that this tree is for

get_formatted_dn()

get_formatted_dn($entry, $level) 
Inherited

inherited_from \HTMLTree::get_formatted_dn()

Parameters

$entry

$level

Return the indentation before a node

get_indentation(\$code $code) 

Parameters

$code

\$code

a string of 0 and 1 ; $code == "000101" will return " | |"

get_logout_menu_item()

get_logout_menu_item() 
Inherited

inherited_from \HTMLTree::get_logout_menu_item()

Get the HTML for each tree menu option

get_menu_item($item) 
Inherited

inherited_from \HTMLTree::get_menu_item()

Parameters

$item

Return the number of children an entry has.

readChildrenNumber(\dn $dn, boolean $nolimit) 
Inherited

Optionally autoread the child entry.

inherited_from \Tree::readChildrenNumber()
inherited_from \HTMLTree::readChildrenNumber()

Parameters

$dn

\dn

DN of the entry

$nolimit

boolean

LDAP Size Limit

Draw the "Create New Entry" item after the children.

create_after_child($entry, $level) 

Parameters

$entry

$level

Draw the "Create New Entry" item before the children.

create_before_child($entry, $level) 

Parameters

$entry

$level

Draw the "Create New Entry" item.

draw_create_new_entry($entry, $level, $img) 

Parameters

$entry

$level

$img

This function will take the DN, convert it to lowercase and strip unnessary commas.

indexDN(\dn $dn) : \dn
Inherited

This result will be used as the index for the tree object. Any display of a DN should use the object->dn entry, not the index. The reason we need to do this is because: uid=User A,ou=People,c=AU and uid=User B, ou=PeOpLe, c=au are infact in the same branch, but PLA will show them inconsistently.

inherited_from \Tree::indexDN()
inherited_from \HTMLTree::indexDN()

Parameters

$dn

\dn

DN to clean

Returns

\dnLowercase clean DN

 Properties

 

$entries

$entries 
Inherited

inherited_from \Tree::$$entries
inherited_from \HTMLTree::$$entries
 

$javascript

$javascript 
Inherited

inherited_from \HTMLTree::$$javascript
 

$server_id

$server_id 
Inherited

inherited_from \Tree::$$server_id
inherited_from \HTMLTree::$$server_id