summaryrefslogtreecommitdiffstats
path: root/codebase/Dhtmlx/Connector/Data/JSONTreeCommonDataItem.php
blob: 3bae29ae434b1d7b4fbb03b0d567df877c7ddd08 (plain)
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
<?php
namespace Dhtmlx\Connector\Data;

class JSONTreeCommonDataItem extends TreeCommonDataItem {

    /*! return self as XML string
    */
    function to_xml_start(){
        if ($this->skip) return false;

        $data = array( "id" => $this->get_id() );
        for ($i=0; $i<sizeof($this->config->text); $i++){
            $extra = $this->config->text[$i]["name"];
            if (isset($this->data[$extra]))
                $data[$extra]=$this->data[$extra];
        }

        if ($this->userdata !== false)
            foreach ($this->userdata as $key => $value)
                $data[$key]=$value;

        if ($this->kids === true)
            $data[Connector::$kids_var] = 1;

        return $data;
    }

    function to_xml_end(){
        return "";
    }

}