summaryrefslogtreecommitdiffstats
path: root/codebase/Dhtmlx/Connector/JSONTreeDataMultitableConnector.php
diff options
context:
space:
mode:
authorEgor <egor.26.93@gmail.com>2015-06-12 16:06:06 +0300
committerEgor <egor.26.93@gmail.com>2015-06-12 16:06:06 +0300
commit9abd184a386a2594398df9f5cd7bd6d5b9c240fc (patch)
tree6b237196dd4ae8bdee61093308f5c3dcdcc5c79e /codebase/Dhtmlx/Connector/JSONTreeDataMultitableConnector.php
parent5fbd0adda5155853e86001fad4c571008f09f01b (diff)
downloadconnector-php-9abd184a386a2594398df9f5cd7bd6d5b9c240fc.zip
connector-php-9abd184a386a2594398df9f5cd7bd6d5b9c240fc.tar.gz
connector-php-9abd184a386a2594398df9f5cd7bd6d5b9c240fc.tar.bz2
Updated structure. Added connectors.
Diffstat (limited to 'codebase/Dhtmlx/Connector/JSONTreeDataMultitableConnector.php')
-rw-r--r--codebase/Dhtmlx/Connector/JSONTreeDataMultitableConnector.php37
1 files changed, 37 insertions, 0 deletions
diff --git a/codebase/Dhtmlx/Connector/JSONTreeDataMultitableConnector.php b/codebase/Dhtmlx/Connector/JSONTreeDataMultitableConnector.php
new file mode 100644
index 0000000..a826b8e
--- /dev/null
+++ b/codebase/Dhtmlx/Connector/JSONTreeDataMultitableConnector.php
@@ -0,0 +1,37 @@
+<?php
+namespace Dhtmlx\Connector;
+use Dhtmlx\Connector\Output\OutputWriter;
+
+class JSONTreeDataMultitableConnector extends TreeDataMultitableConnector {
+
+ public function __construct($res,$type=false,$item_type=false,$data_type=false,$render_type=false){
+ if (!$item_type) $item_type="JSONTreeCommonDataItem";
+ if (!$data_type) $data_type="CommonDataProcessor";
+ if (!$render_type) $render_type="JSONMultitableTreeRenderStrategy";
+ parent::__construct($res,$type,$item_type,$data_type,$render_type);
+ }
+
+ protected function output_as_xml($res){
+ $result = $this->render_set($res);
+ if ($this->simple) return $result;
+
+ $data = array();
+ if (isset($_GET['parent']))
+ $data["parent"] = $this->render->level_id($_GET[$this->parent_name], $this->render->get_level() - 1);
+ else
+ $data["parent"] = "0";
+ $data["data"] = $result;
+
+ $result = json_encode($data);
+ if ($this->as_string) return $result;
+
+ $out = new OutputWriter($result, "");
+ $out->set_type("json");
+ $this->event->trigger("beforeOutput", $this, $out);
+ $out->output("", true, $this->encoding);
+ }
+
+ public function xml_start(){
+ return '';
+ }
+} \ No newline at end of file