summaryrefslogtreecommitdiffstats
path: root/codebase/Dhtmlx/Connector/Output/JSONMultitableTreeRenderStrategy.php
diff options
context:
space:
mode:
Diffstat (limited to 'codebase/Dhtmlx/Connector/Output/JSONMultitableTreeRenderStrategy.php')
-rwxr-xr-xcodebase/Dhtmlx/Connector/Output/JSONMultitableTreeRenderStrategy.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/codebase/Dhtmlx/Connector/Output/JSONMultitableTreeRenderStrategy.php b/codebase/Dhtmlx/Connector/Output/JSONMultitableTreeRenderStrategy.php
new file mode 100755
index 0000000..98c161b
--- /dev/null
+++ b/codebase/Dhtmlx/Connector/Output/JSONMultitableTreeRenderStrategy.php
@@ -0,0 +1,31 @@
+<?php
+namespace Dhtmlx\Connector\Output;
+
+class JSONMultitableTreeRenderStrategy extends RenderStrategy {
+
+ public function render_set($res, $name, $dload, $sep, $config, $mix){
+ $output=array();
+ $index=0;
+ $conn = $this->conn;
+ $this->mix($config, $mix);
+ while ($data=$conn->sql->get_next($res)){
+ $data = $this->complex_mix($mix, $data);
+ $data[$config->id['name']] = $this->level_id($data[$config->id['name']]);
+ $data = new $name($data,$config,$index);
+ $conn->event->trigger("beforeRender",$data);
+
+ if ($this->is_max_level()) {
+ $data->set_kids(false);
+ } else {
+ if ($data->has_kids()===-1)
+ $data->set_kids(true);
+ }
+ $record = $data->to_xml_start($output);
+ $output[] = $record;
+ $index++;
+ }
+ $this->unmix($config, $mix);
+ return $output;
+ }
+
+}