1: <?php
2:
3: /**
4: * This file contains the tree class.
5: *
6: * @package Core
7: * @subpackage GUI
8: * @author Timo Hummel
9: * @copyright four for business AG <www.4fb.de>
10: * @license http://www.contenido.org/license/LIZENZ.txt
11: * @link http://www.4fb.de
12: * @link http://www.contenido.org
13: */
14:
15: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
16:
17: /**
18: * Tree class.
19: *
20: * @package Core
21: * @subpackage GUI
22: */
23: class cTree extends cTreeItem {
24:
25: /**
26: * Tree icon
27: *
28: * @var string
29: */
30: protected $_treeIcon;
31:
32: /**
33: * Constructor to create an instance of this class.
34: *
35: * @todo The root item currently has to be a "0".
36: * This is a bug, feel free to fix it.
37: *
38: * @param string $name [optional]
39: */
40: public function __construct($name = "") {
41: parent::__construct(0, $name);
42: }
43:
44: /**
45: * Sets a new name for the tree.
46: *
47: * @param string $name
48: * Name of the tree
49: */
50: public function setTreeName($name) {
51: $this->setName($name);
52: }
53:
54: /**
55: * Tree icon setter.
56: * Short form for setTreeIcon().
57: *
58: * @param string $path
59: */
60: public function setIcon($path) {
61: $this->setTreeIcon($path);
62: }
63:
64: /**
65: * Tree icon setter.
66: *
67: * @param string $path
68: */
69: public function setTreeIcon($path) {
70: $this->_treeIcon = $path;
71: }
72:
73: /**
74: * Tree icon getter.
75: *
76: * @return string
77: */
78: public function getTreeIcon() {
79: return $this->_treeIcon;
80: }
81:
82: }
83: