summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStanislau Wolski <stanislau.wolski@gmail.com>2016-02-05 16:10:04 +0300
committerStanislau Wolski <stanislau.wolski@gmail.com>2016-02-05 16:10:04 +0300
commitcda38cd377ef1ffeb328ff1e8d0ac787b65fe42f (patch)
tree594dd3da74295d1e48c720beeb051f425b40bae1
parente5b1de813749963e526652d8e8d79e29dca0c6d3 (diff)
downloadconnector-php-cda38cd377ef1ffeb328ff1e8d0ac787b65fe42f.zip
connector-php-cda38cd377ef1ffeb328ff1e8d0ac787b65fe42f.tar.gz
connector-php-cda38cd377ef1ffeb328ff1e8d0ac787b65fe42f.tar.bz2
[add] SelectOptionsConnector3.0.2
-rw-r--r--codebase/Dhtmlx/Connector/Data/OptionsDataItem.php12
-rw-r--r--codebase/Dhtmlx/Connector/SelectOptionsConnector.php26
2 files changed, 38 insertions, 0 deletions
diff --git a/codebase/Dhtmlx/Connector/Data/OptionsDataItem.php b/codebase/Dhtmlx/Connector/Data/OptionsDataItem.php
new file mode 100644
index 0000000..8ea4e69
--- /dev/null
+++ b/codebase/Dhtmlx/Connector/Data/OptionsDataItem.php
@@ -0,0 +1,12 @@
+<?php
+namespace Dhtmlx\Connector\Data;
+
+class OptionsDataItem extends DataItem {
+ function to_xml(){
+ if ($this->skip) return "";
+ $str ="";
+
+ $str .= "<item value=\"".$this->xmlentities($this->data[$this->config->data[0]['db_name']])."\" label=\"".$this->xmlentities($this->data[$this->config->data[1]['db_name']])."\" />";
+ return $str;
+ }
+} \ No newline at end of file
diff --git a/codebase/Dhtmlx/Connector/SelectOptionsConnector.php b/codebase/Dhtmlx/Connector/SelectOptionsConnector.php
new file mode 100644
index 0000000..48b2626
--- /dev/null
+++ b/codebase/Dhtmlx/Connector/SelectOptionsConnector.php
@@ -0,0 +1,26 @@
+<?php
+namespace Dhtmlx\Connector;
+
+/*! wrapper around options collection, used for comboboxes and filters
+**/
+class SelectOptionsConnector extends Connector {
+ 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="Dhtmlx\\Connector\\Data\\DataItem";
+ 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);
+ }
+} \ No newline at end of file