grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026_label = $label; $this->_properties['label'] = $label; $this->uid = create_guid(); $this->set_property('id', $id); $this->expanded = $show_expanded; } /** * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead */ public function Node($id, $label, $show_expanded = false) { $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; if (isset($GLOBALS['log'])) { $GLOBALS['log']->deprecated($deprecatedMessage); } else { trigger_error($deprecatedMessage, E_USER_DEPRECATED); } self::__construct($id, $label, $show_expanded); } /** * @param $name * @param $value * @param bool $is_param * * properties set here will be accessible via * node.data object in javascript. * users can add a collection of paramaters that will * be passed to objects responding to tree events */ public function set_property($name, $value, $is_param = false) { if (!empty($name) && ($value === 0 || !empty($value))) { if ($is_param == false) { $this->_properties[$name] = $value; } else { $this->_params[$name] = $value; } } } /** * add a child node. * @param $node */ public function add_node($node) { $this->nodes[$node->uid] = $node; } /** * @return array - definition of the node. the definition is a multi-dimension array and has 3 parts. * data-> definition of the current node. * attributes=> collection of additional attributes such as style class etc.. * nodes: definition of children nodes. */ public function get_definition() { $ret = array(); $ret['data'] = $this->_properties; if (count($this->_params) > 0) { $ret['data']['param'] = $this->_params; } $ret['custom']['dynamicload'] = $this->dynamic_load; $ret['custom']['dynamicloadfunction'] = $this->dynamicloadfunction; $ret['custom']['expanded'] = $this->expanded; foreach ($this->nodes as $node) { $ret['nodes'][] = $node->get_definition(); } return $ret; } }