summaryrefslogtreecommitdiffstats
path: root/codebase
diff options
context:
space:
mode:
Diffstat (limited to 'codebase')
-rw-r--r--codebase/base_connector.php1
-rw-r--r--codebase/data_connector.php4
-rw-r--r--codebase/db_common.php10
3 files changed, 11 insertions, 4 deletions
diff --git a/codebase/base_connector.php b/codebase/base_connector.php
index 2ba92ba..26f1f8b 100644
--- a/codebase/base_connector.php
+++ b/codebase/base_connector.php
@@ -290,6 +290,7 @@ class Connector {
public static $filter_var="dhx_filter";
public static $sort_var="dhx_sort";
+ public static $kids_var="dhx_kids";
public $model=false;
diff --git a/codebase/data_connector.php b/codebase/data_connector.php
index 5bf9bab..7b73066 100644
--- a/codebase/data_connector.php
+++ b/codebase/data_connector.php
@@ -346,7 +346,7 @@ class TreeCommonDataItem extends CommonDataItem{
$str.=" ".$key."='".$this->xmlentities($value)."'";
if ($this->kids === true)
- $str .=" dhx_kids='1'";
+ $str .=" ".Connector::$kids_var."='1'";
return $str.">";
}
@@ -503,7 +503,7 @@ class JSONTreeCommonDataItem extends TreeCommonDataItem{
$data[$key]=$value;
if ($this->kids === true)
- $data["dhx_kids"] = 1;
+ $data[Connector::$kids_var] = 1;
return $data;
}
diff --git a/codebase/db_common.php b/codebase/db_common.php
index 4fe5f77..e2f521e 100644
--- a/codebase/db_common.php
+++ b/codebase/db_common.php
@@ -800,8 +800,14 @@ abstract class DBDataWrapper extends DataWrapper{
else
array_push($sql,$this->escape_name($rules[$i]["name"])." ".$rules[$i]["operation"]." '".$this->escape($rules[$i]["value"])."'");
}
- if ($relation !== false && $relation !== "")
- array_push($sql,$this->escape_name($this->config->relation_id["db_name"])." = '".$this->escape($relation)."'");
+
+ if ($relation !== false && $relation !== ""){
+ $relsql = $this->escape_name($this->config->relation_id["db_name"])." = '".$this->escape($relation)."'";
+ if ($relation == "0")
+ $relsql = "( ".$relsql." OR ".$this->escape_name($this->config->relation_id["db_name"])." IS NULL )";
+
+ array_push($sql,$relsql);
+ }
return implode(" AND ",$sql);
}
/*! convert sorting rules to sql string