diff options
Diffstat (limited to 'codebase/Dhtmlx/Connector/Data/JSONSchedulerDataItem.php')
-rw-r--r-- | codebase/Dhtmlx/Connector/Data/JSONSchedulerDataItem.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/codebase/Dhtmlx/Connector/Data/JSONSchedulerDataItem.php b/codebase/Dhtmlx/Connector/Data/JSONSchedulerDataItem.php new file mode 100644 index 0000000..5eceb04 --- /dev/null +++ b/codebase/Dhtmlx/Connector/Data/JSONSchedulerDataItem.php @@ -0,0 +1,28 @@ +<?php +namespace Dhtmlx\Connector\Data; + +class JSONSchedulerDataItem extends SchedulerDataItem { + + /*! return self as XML string + */ + function to_xml(){ + if ($this->skip) return ""; + + $obj = array(); + $obj['id'] = $this->get_id(); + $obj['start_date'] = $this->data[$this->config->text[0]["name"]]; + $obj['end_date'] = $this->data[$this->config->text[1]["name"]]; + $obj['text'] = $this->data[$this->config->text[2]["name"]]; + for ($i=3; $i<sizeof($this->config->text); $i++){ + $extra = $this->config->text[$i]["name"]; + $obj[$extra]=$this->data[$extra]; + } + + if ($this->userdata !== false) + foreach ($this->userdata as $key => $value) + $obj[$key]=$value; + + return $obj; + } + +}
\ No newline at end of file |