diff options
author | dmitry-radyno <dmitry.radyno@gmail.com> | 2013-09-24 11:49:11 +0300 |
---|---|---|
committer | dmitry-radyno <dmitry.radyno@gmail.com> | 2013-09-24 11:49:11 +0300 |
commit | d15f7f2e3b673306b491c5d3d0ed78e73ac616b3 (patch) | |
tree | 9502b990923abb4d76c4bce2d1032e1d44724415 /codebase | |
parent | 4e84f2ec1bdff3009847aa2831417741f7a4fb1e (diff) | |
download | connector-php-d15f7f2e3b673306b491c5d3d0ed78e73ac616b3.zip connector-php-d15f7f2e3b673306b491c5d3d0ed78e73ac616b3.tar.gz connector-php-d15f7f2e3b673306b491c5d3d0ed78e73ac616b3.tar.bz2 |
fix skipping item in JSON connectors
Diffstat (limited to 'codebase')
-rw-r--r-- | codebase/data_connector.php | 4 | ||||
-rw-r--r-- | codebase/strategy.php | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/codebase/data_connector.php b/codebase/data_connector.php index 2a4e0a3..e4e5e08 100644 --- a/codebase/data_connector.php +++ b/codebase/data_connector.php @@ -266,7 +266,7 @@ class JSONCommonDataItem extends DataItem{ /*! return self as XML string */ function to_xml(){ - if ($this->skip) return ""; + if ($this->skip) return false; $data = array( 'id' => $this->get_id() @@ -437,7 +437,7 @@ class JSONTreeCommonDataItem extends TreeCommonDataItem{ /*! return self as XML string */ function to_xml_start(){ - if ($this->skip) return ""; + if ($this->skip) return false; $data = array( "id" => $this->get_id() ); for ($i=0; $i<sizeof($this->config->text); $i++){ diff --git a/codebase/strategy.php b/codebase/strategy.php index eb579b8..e81e55a 100644 --- a/codebase/strategy.php +++ b/codebase/strategy.php @@ -130,7 +130,9 @@ class JSONRenderStrategy extends RenderStrategy { if ($data->get_id()===false) $data->set_id($conn->uuid()); $conn->event->trigger("beforeRender",$data); - $output[]=$data->to_xml(); + $item = $data->to_xml(); + if ($item !== false) + $output[]=$item; $index++; } $this->unmix($config, $mix); @@ -223,7 +225,8 @@ class JSONTreeRenderStrategy extends TreeRenderStrategy { if (sizeof($temp)) $record["data"] = $temp; } - $output[] = $record; + if ($record !== false) + $output[] = $record; $index++; } $this->unmix($config, $mix); |