diff options
Diffstat (limited to 'codebase/Data/JSONCommonDataItem.php')
-rw-r--r-- | codebase/Data/JSONCommonDataItem.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/codebase/Data/JSONCommonDataItem.php b/codebase/Data/JSONCommonDataItem.php new file mode 100644 index 0000000..4a69068 --- /dev/null +++ b/codebase/Data/JSONCommonDataItem.php @@ -0,0 +1,29 @@ +<?php +namespace DHTMLX\Connector\Data; + +class JSONCommonDataItem extends DataItem{ + /*! return self as XML string + */ + function to_xml(){ + 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"]; + $data[$extra]=$this->data[$extra]; + if (is_null($data[$extra])) + $data[$extra] = ""; + } + + if ($this->userdata !== false) + foreach ($this->userdata as $key => $value){ + if ($value === null) + $data[$key]=""; + $data[$key]=$value; + } + + return $data; + } +} |