summaryrefslogtreecommitdiffstats
path: root/codebase/Dhtmlx/Connector/JSONOptionsConnector.php
diff options
context:
space:
mode:
Diffstat (limited to 'codebase/Dhtmlx/Connector/JSONOptionsConnector.php')
-rw-r--r--codebase/Dhtmlx/Connector/JSONOptionsConnector.php43
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