summaryrefslogtreecommitdiffstats
path: root/codebase/Dhtmlx/Connector/Output/JSONMultitableTreeRenderStrategy.php
diff options
context:
space:
mode:
authorEgor <egor.26.93@gmail.com>2015-06-16 15:48:31 +0300
committerEgor <egor.26.93@gmail.com>2015-06-16 15:48:31 +0300
commit67129e12d10b77911d9250b38b42b42dd5b601b4 (patch)
tree1cb3555d8e8148a38a4e6701f2f8dddb3f68c21d /codebase/Dhtmlx/Connector/Output/JSONMultitableTreeRenderStrategy.php
parent4081482ce6cf1a6c0894a8be02a57d21f3cdc7dd (diff)
downloadconnector-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/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;
+ }
+
+}