summaryrefslogtreecommitdiffstats
path: root/codebase/Dhtmlx/Connector/Data/CommonDataItem.php
blob: 523cd08e5b03283290d0d069da89ca605266ab08 (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
<?php

namespace DHTMLX\Connector\Data;
/*! DataItem class for DataView component
**/
class CommonDataItem extends DataItem{
    /*! return self as XML string
    */
    function to_xml(){
        if ($this->skip) return "";
        return $this->to_xml_start().$this->to_xml_end();
    }

    function to_xml_start(){
        $str="<item id='".$this->get_id()."' ";
        for ($i=0; $i < sizeof($this->config->text); $i++){
            $name=$this->config->text[$i]["name"];
            $str.=" ".$name."='".$this->xmlentities($this->data[$name])."'";
        }

        if ($this->userdata !== false)
            foreach ($this->userdata as $key => $value)
                $str.=" ".$key."='".$this->xmlentities($value)."'";

        return $str.">";
    }
}