diff options
author | Egor <egor.26.93@gmail.com> | 2015-06-11 16:01:20 +0300 |
---|---|---|
committer | Egor <egor.26.93@gmail.com> | 2015-06-11 16:01:20 +0300 |
commit | 5992398183bf84c87dd4315d1532d10022718e9b (patch) | |
tree | c192dec5f76a7875265659d42dc2a5be22fc319b /codebase/Dhtmlx/Connector/JSONOptionsConnector.php | |
parent | 388e84730286a153c12a77d9f19215f2b74c5c4f (diff) | |
download | connector-php-5992398183bf84c87dd4315d1532d10022718e9b.zip connector-php-5992398183bf84c87dd4315d1532d10022718e9b.tar.gz connector-php-5992398183bf84c87dd4315d1532d10022718e9b.tar.bz2 |
Changed psr-4 structure to psr-0. Added connectors for phpcake, codeigniter frameworks.
Diffstat (limited to 'codebase/Dhtmlx/Connector/JSONOptionsConnector.php')
-rw-r--r-- | codebase/Dhtmlx/Connector/JSONOptionsConnector.php | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/codebase/Dhtmlx/Connector/JSONOptionsConnector.php b/codebase/Dhtmlx/Connector/JSONOptionsConnector.php new file mode 100644 index 0000000..6d25354 --- /dev/null +++ b/codebase/Dhtmlx/Connector/JSONOptionsConnector.php @@ -0,0 +1,43 @@ +<?php + +namespace DHTMLX\Connector; +/*! wrapper around options collection, used for comboboxes and filters +**/ +class JSONOptionsConnector extends JSONDataConnector{ + protected $init_flag=false;//!< used to prevent rendering while initialization + public function __construct($res,$type=false,$item_type=false,$data_type=false){ + if (!$item_type) $item_type="JSONCommonDataItem"; + if (!$data_type) $data_type=""; //has not sense, options not editable + parent::__construct($res,$type,$item_type,$data_type); + } + /*! render self + process commands, return data as XML, not output data to stdout, ignore parameters in incoming request + @return + data as XML string + */ + public function render(){ + if (!$this->init_flag){ + $this->init_flag=true; + return ""; + } + $res = $this->sql->select($this->request); + return $this->render_set($res); + } +} + + +class JSONDistinctOptionsConnector extends JSONOptionsConnector{ + /*! render self + process commands, return data as XML, not output data to stdout, ignore parameters in incoming request + @return + data as XML string + */ + public function render(){ + if (!$this->init_flag){ + $this->init_flag=true; + return ""; + } + $res = $this->sql->get_variants($this->config->text[0]["db_name"],$this->request); + return $this->render_set($res); + } +}
\ No newline at end of file |