diff options
author | Dmitry <dmitry@dhtmlx.com> | 2012-07-12 15:57:45 +0200 |
---|---|---|
committer | Dmitry <dmitry@dhtmlx.com> | 2012-07-12 15:57:45 +0200 |
commit | 49a1420f56c386d89b3f5850e573283879a1549f (patch) | |
tree | f6d46a2b52a23f9a4a06892fd2d0036e6103d061 /codebase/strategy.php | |
parent | 9446d2cc48200e4c6c56adb66b9c1dad97ec9de6 (diff) | |
download | connector-php-49a1420f56c386d89b3f5850e573283879a1549f.zip connector-php-49a1420f56c386d89b3f5850e573283879a1549f.tar.gz connector-php-49a1420f56c386d89b3f5850e573283879a1549f.tar.bz2 |
fix mix
Diffstat (limited to 'codebase/strategy.php')
-rw-r--r-- | codebase/strategy.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/codebase/strategy.php b/codebase/strategy.php index 15328e9..de32270 100644 --- a/codebase/strategy.php +++ b/codebase/strategy.php @@ -16,7 +16,8 @@ class RenderStrategy { */ protected function mix($config, $mix) { for ($i = 0; $i < count($mix); $i++) - $config->add_field($mix[$i]['name']); + if (!$config->is_field($mix[$i]['name'])) + $config->add_field($mix[$i]['name']); } /*! remove mix fields from DataConfig @@ -91,7 +92,7 @@ class RenderStrategy { $this->mix($config, $mix); $conn->event->trigger("beforeRenderSet",$conn,$res,$config); while ($data=$conn->sql->get_next($res)){ - $data = $this->simple_mix($config, $data); + $data = $this->simple_mix($mix, $data); $data = new $name($data,$config,$index); if ($data->get_id()===false) @@ -214,7 +215,7 @@ class JSONTreeRenderStrategy extends TreeRenderStrategy { if ($data->has_kids()===-1 || ( $data->has_kids()==true && !$dload)){ $sub_request = new DataRequestConfig($conn->get_request()); $sub_request->set_relation($data->get_id()); - $temp = $this->render_set($conn->sql->select($sub_request), $name, $dload, $sep, $config); + $temp = $this->render_set($conn->sql->select($sub_request), $name, $dload, $sep, $config, $mix); if (sizeof($temp)) $record["data"] = $temp; } |