The TreeControl provides a class that can be used to generate dynamic tree controls for use in PHP forms (or pages).
More...
The TreeControl provides a class that can be used to generate dynamic tree controls for use in PHP forms (or pages).
Definition at line 321 of file tree.inc.
◆ add()
Adds a child TreeNode (or an array of children)
- Parameters
-
mixed | $n | the child or children to add |
Definition at line 438 of file tree.inc.
442 for($i = 0; $i < count($n); ++$i)
444 $this->children[] = $n[$i];
449 $this->children[] = $n;
◆ setValue()
TreeControl::setValue |
( |
|
$value | ) |
|
Definition at line 411 of file tree.inc.
414 $c = count($this->children);
416 for($i = 0; $i < $c; ++$i)
418 $this->children[$i]->selectByValue(
$value);
◆ TreeControl()
TreeControl::TreeControl |
( |
|
$id, |
|
|
|
$title = "" , |
|
|
|
$style = "tree" , |
|
|
|
$scroll = true , |
|
|
|
$width = 500 , |
|
|
|
$height = 400 |
|
) |
| |
Create a new TreeControl.
- Parameters
-
string | $id | the ID for the control |
string | $title | the title text for the control |
string | $style | the base CSS class for the tree |
boolean | $scroll | flag indicating whether the control should display scrollbars when the contents overflow a fixed width or height. |
integer | $width | width of the control in pixels |
integer | $height | height of the control in pixels |
Definition at line 347 of file tree.inc.
◆ writeHTML()
TreeControl::writeHTML |
( |
| ) |
|
Outputs the TreeControl as HTML to the current output buffer.
Definition at line 368 of file tree.inc.
378 if ($this->selectMode ==
"single")
381 <input type=
'hidden' name=
'<?echo $this->id ?>' id=
'<?echo $this->id?>' value=
'<?echo $this->value ?>'/>
384 ?><table
id=
"<?echo $this->id?>_table" class=
"<? echo $this->style?>" cellpadding=
"0" cellspacing=
"0" <?
if ($this->width) echo
"style='width:{$width}'"; ?>>
390 <th><? echo $this->title?></th>
399 <div style=
"padding: 0; margin: 0; width: <? echo $w?>;<? if ($this->height > 0) { ?> height: <?echo $this->height?>px;<? } ?><?if ($this->scroll) echo "overflow:
auto"?>">
$_activeTree
Global reference to currently drawing tree instance.
◆ writeNodes()
TreeControl::writeNodes |
( |
| ) |
|
Definition at line 422 of file tree.inc.
424 $c = count($this->children);
426 for($i = 0; $i < $c; ++$i)
428 $this->children[$i]->calculateOpenState();
429 $this->children[$i]->writeHTML();
◆ writeScript()
TreeControl::writeScript |
( |
| ) |
|
- Deprecated:
- include the /fakoli/js/tree.js support file instead.
Writes the JavaScript support functions for the tree.
Definition at line 361 of file tree.inc.
◆ $children
◆ $height
◆ $id
◆ $indent
TreeControl::$indent = "16px" |
◆ $scroll
◆ $selectMode
TreeControl::$selectMode = "multi" |
◆ $selectOnRightClick
TreeControl::$selectOnRightClick = false |
◆ $selectOnRightClickMode
TreeControl::$selectOnRightClickMode = "context" |
◆ $style
◆ $title
◆ $value
◆ $width
The documentation for this class was generated from the following file:
- C:/code/cms.sonjara.com/framework/tree.inc