diff options
author | Egor <egor.26.93@gmail.com> | 2015-06-12 16:06:06 +0300 |
---|---|---|
committer | Egor <egor.26.93@gmail.com> | 2015-06-12 16:06:06 +0300 |
commit | 9abd184a386a2594398df9f5cd7bd6d5b9c240fc (patch) | |
tree | 6b237196dd4ae8bdee61093308f5c3dcdcc5c79e /codebase/Dhtmlx/Connector/TreeDataMultitableConnector.php | |
parent | 5fbd0adda5155853e86001fad4c571008f09f01b (diff) | |
download | connector-php-9abd184a386a2594398df9f5cd7bd6d5b9c240fc.zip connector-php-9abd184a386a2594398df9f5cd7bd6d5b9c240fc.tar.gz connector-php-9abd184a386a2594398df9f5cd7bd6d5b9c240fc.tar.bz2 |
Updated structure. Added connectors.
Diffstat (limited to 'codebase/Dhtmlx/Connector/TreeDataMultitableConnector.php')
-rw-r--r-- | codebase/Dhtmlx/Connector/TreeDataMultitableConnector.php | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/codebase/Dhtmlx/Connector/TreeDataMultitableConnector.php b/codebase/Dhtmlx/Connector/TreeDataMultitableConnector.php new file mode 100644 index 0000000..0021e70 --- /dev/null +++ b/codebase/Dhtmlx/Connector/TreeDataMultitableConnector.php @@ -0,0 +1,45 @@ +<?php +namespace Dhtmlx\Connector; + +class TreeDataMultitableConnector extends TreeDataConnector { + + protected $parent_name = 'parent'; + + public function __construct($res,$type=false,$item_type=false,$data_type=false,$render_type=false){ + if (!$data_type) $data_type="TreeDataProcessor"; + if (!$render_type) $render_type="MultitableTreeRenderStrategy"; + parent::__construct($res,$type,$item_type,$data_type,$render_type); + } + + public function render(){ + $this->dload = true; + return parent::render(); + } + + /*! sets relation for rendering */ + protected function set_relation() { + if (!isset($_GET[$this->parent_name])) + $this->request->set_relation(false); + } + + public function xml_start(){ + if (isset($_GET[$this->parent_name])) { + return "<data parent='".$this->xmlentities($this->render->level_id($_GET[$this->parent_name], $this->render->get_level() - 1))."'>"; + } else { + return "<data parent='0'>"; + } + } + + /*! set maximum level of tree + @param max_level + maximum level + */ + public function setMaxLevel($max_level) { + $this->render->set_max_level($max_level); + } + + public function get_level() { + return $this->render->get_level($this->parent_name); + } + +}
\ No newline at end of file |