diff options
author | Egor <egor.26.93@gmail.com> | 2015-06-16 15:48:31 +0300 |
---|---|---|
committer | Egor <egor.26.93@gmail.com> | 2015-06-16 15:48:31 +0300 |
commit | 67129e12d10b77911d9250b38b42b42dd5b601b4 (patch) | |
tree | 1cb3555d8e8148a38a4e6701f2f8dddb3f68c21d /codebase/Dhtmlx/Connector/Data | |
parent | 4081482ce6cf1a6c0894a8be02a57d21f3cdc7dd (diff) | |
download | connector-php-67129e12d10b77911d9250b38b42b42dd5b601b4.zip connector-php-67129e12d10b77911d9250b38b42b42dd5b601b4.tar.gz connector-php-67129e12d10b77911d9250b38b42b42dd5b601b4.tar.bz2 |
Added namespaces for dhtmlx components.3.0.0
Diffstat (limited to 'codebase/Dhtmlx/Connector/Data')
-rw-r--r-- | codebase/Dhtmlx/Connector/Data/JSONTreeCommonDataItem.php | 32 | ||||
-rwxr-xr-x | codebase/Dhtmlx/Connector/Data/TreeCommonDataItem.php | 33 |
2 files changed, 65 insertions, 0 deletions
diff --git a/codebase/Dhtmlx/Connector/Data/JSONTreeCommonDataItem.php b/codebase/Dhtmlx/Connector/Data/JSONTreeCommonDataItem.php new file mode 100644 index 0000000..3bae29a --- /dev/null +++ b/codebase/Dhtmlx/Connector/Data/JSONTreeCommonDataItem.php @@ -0,0 +1,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 ""; + } + +}
\ No newline at end of file diff --git a/codebase/Dhtmlx/Connector/Data/TreeCommonDataItem.php b/codebase/Dhtmlx/Connector/Data/TreeCommonDataItem.php new file mode 100755 index 0000000..e43fbec --- /dev/null +++ b/codebase/Dhtmlx/Connector/Data/TreeCommonDataItem.php @@ -0,0 +1,33 @@ +<?php +namespace Dhtmlx\Connector\Data; + +class TreeCommonDataItem extends CommonDataItem { + + protected $kids=-1; + + 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)."'"; + + if ($this->kids === true) + $str .=" ".Connector::$kids_var."='1'"; + + return $str.">"; + } + + function has_kids(){ + return $this->kids; + } + + function set_kids($value){ + $this->kids=$value; + } + +}
\ No newline at end of file |