Helix Installation   Getting Started   Reference Documentation   Global Functions   Quick Start
ModulesClassesFunctions
 

Class Reference

class doubleselect extends forminput

Hide Inherited MembersUser Interface
Description
No description.
 
Constants
constantELEMENT ["select"][ doubleselect ]
constantTAGNAME [""][ doubleselect ]
constantCONTENT [false][ doubleselect ]
 
Properties
publicattribute_list[ forminput ]
publicattributes[ element ]
protected_dirty[ obj ]
protected_entities[ forminput ]
protected_index[ doubleselect ]
publicoptions[ doubleselect ]
protected_prefix[ doubleselect ]
publicproperty_objects_array[ obj ]
protected_selected_options[ doubleselect ]
protected_selected_title[ doubleselect ]
protected_suffix[ doubleselect ]
protected_text[ doubleselect ]
protected_unselected_options[ doubleselect ]
protected_unselected_title[ doubleselect ]
protected_valid[ forminput ]
protected_validation[ forminput ]
protected_value[ doubleselect ]
 
Methods
publicadd ( value , text , selected [false] )[ doubleselect ]
Parameters
optionalvalue
optionaltext
optionalselected [false]
Code
239  public function add($value=null, $text=null, $selected=false)
240  {
241      $this->options[] = new option($value,$text,$selected);
242      $this->index = ($selected) ? (count($this->options) - 1) : $this->index;
243  }
publicaddat ( index , value , text , selected [false] )[ doubleselect ]
Parameters
requiredindex
optionalvalue
optionaltext
optionalselected [false]
Code
245  public function addat($index, $value=null, $text=null, $selected=false)
246  {
247      if (is_int($index) && $index <= count($this->options))
248      {
249          $option = new option($value,$text,$selected);
250          array_splice($this->options, $index, 0, array($option));
251      }
252      $this->index = ($selected) ? $index : $this->index;
253  }
protectedbuild_attributes ( )[ forminput ]
Parameters
No parameters for this method
Code
022  protected function build_attributes()
023  {
024      global $controls;
025      if (is_array($controls) && array_key_exists($this->name,$controls))
026      {
027          $valid = $controls[$this->name]->valid;
028          $space = ($this->classname) ? " " : null;
029          $this->classname .= ($valid) ? null : "${space}invalid";
030      }
031      $attributes = "";
032      $this->id = is_null($this->id) ? (is_null($this->name) ? unique() : $this->name) : $this->id; // MAKE SURE ALL INPUTS HAVE AN ID
033      if(strstr($this->id,"[]"))
034      {
035          //for arrays of inputs that were contructed by the name, the id will be invalid
036          //re-assign to a unique number
037          $this->id = unique();
038      }
039      foreach ($this->attribute_list as $k=>$v)
040      {
041          if (preg_match("/selected|checked|readonly|disabled|multiple/i",$k))
042          {
043              $v = ($v) ? $k : null;
044          }
045          if (preg_match("/name/i",$k))
046          {
047              $v .= (keyval($this->attribute_list,"multiple")) ? "[]" : null;
048          }
049          $replace_spaces = ($k=="value") ? true : false;
050          if ($this->_entities)
051          {
052              $attributes .= (!is_null($v)) ? " " . $k . "=\"" . ent($v,$replace_spaces) . "\"" : null;
053          }
054          else
055          {
056              $attributes .= (!is_null($v)) ? " " . $k . "=\"" . $v . "\"" : null;
057          }
058      }
059      return $attributes;
060  }
public__construct ( name )[ doubleselect ]
Parameters
optionalname
Code
017  public function __construct($name=null)
018  {
019      parent::__construct();
020      $this->index = null;
021      $this->options = array();
022      $this->selected_options = array();
023      $this->unselected_options = array();
024      $this->multiple = true;
025      $this->size = null;
026      $this->name = $name;
027      $this->value = null;
028      $this->prefix = null;
029      $this->suffix = null;
030  }
public__get ( p )[ obj ]
Parameters
requiredp
Code
007  public function __get($p)
008  {
009      $methods = get_class_methods($this);
010      $properties = get_object_vars($this);
011      if (in_array("get_$p",$methods))
012      {
013          return $this->{"get_$p"}();
014      }
015      else if (array_key_exists("_$p",$properties))
016      {
017          return $this->{"_$p"};
018      }
019      else if (in_array("get_" . substr($p,strpos($p,"_")+1), $methods))
020      {
021          return $this->{"get_" . substr($p,strpos($p,"_")+1)}(substr($p,0,strpos($p,"_")));
022      }
023      else
024      {
025          trigger_error("This object [" . get_class($this) . ":$this->id] has no private property '_$p' for the requested public property '$p'",E_USER_WARNING);
026          return null;
027      }
028  }
publicget_array ( )[ obj ]
Parameters
No parameters for this method
Code
096  public function get_array()
097  {
098      return get_object_vars($this);
099  }
publicget_attribute_string ( )[ element ]
Parameters
No parameters for this method
Code
017  public function get_attribute_string()
018  {
019      $attributes = array();
020      foreach ($this->attributes as $k=>$v)
021      {
022          $v = preg_match("/selected|checked|readonly|disabled|multiple/i",$k) ? ($v ? $k : null) : $v;
023          $v = ($k=="style") ? $this->style_string : $v;
024          $v = (preg_match("/name/i",$k) && keyval($this->attributes,"multiple")) ? ($v . "[]") : $v;
025          if (is_null($v))
026          {
027              continue;
028          }
029          $attributes[] = $k . "=\"" . ent($v) . "\"";
030      }
031      return implode(" ",$attributes);
032  }
publicget_classname ( )[ forminput ]
Parameters
No parameters for this method
Code
068  public function get_classname() {return keyval($this->attribute_list,"class");}
publicget_direction ( )[ forminput ]
Parameters
No parameters for this method
Code
083  public function get_direction() {return keyval($this->attribute_list,"dir");}
publicget_dirty ( )[ obj ]
Parameters
No parameters for this method
Code
063  public function get_dirty()
064  {
065      if ($this->id === 0)
066      {
067          $this->_dirty = true;
068      }
069      else
070      {
071          foreach (get_object_vars($this) as $k=>$v)
072          {
073              if ($this->_dirty)
074              {
075                  break;
076              }
077              if (preg_match('/_dirty$/',$k))
078              {
079                  $this->_dirty = $this->_dirty || $v;
080              }
081          }
082      }
083      return $this->_dirty;
084  }
publicget_disabled ( )[ forminput ]
Parameters
No parameters for this method
Code
128  public function get_disabled() {return keyval($this->attribute_list,"disabled");}
publicget_id ( )[ forminput ]
Parameters
No parameters for this method
Code
065  public function get_id() {return keyval($this->attribute_list,"id");}
publicget_json ( )[ obj ]
Parameters
No parameters for this method
Code
101  public function get_json()
102  {
103      $class = new ReflectionClass($this->classname);
104      $methods = $class->getMethods();
105      usort($methods,"sort_reflection_objects");
106      $accessors = array();
107      foreach ($methods as $index=>$method)
108      {
109          $declarer = $method->getDeclaringClass()->name;
110          if (preg_match('/^(get|set|)_(.+)$/',$method->name,$matches))
111          {
112              $accessor = $matches[2];
113              $getset = $matches[1];
114              eval("\$accessors[\$accessor] = \$this->".$accessor.";");
115          }
116      }
117      //return json_encode($this->get_array());
118      return json_encode($accessors);
119  }
publicget_lang ( )[ forminput ]
Parameters
No parameters for this method
Code
077  public function get_lang() {return keyval($this->attribute_list,"lang");}
publicget_multiple ( )[ doubleselect ]
Parameters
No parameters for this method
Code
261  public function get_multiple() {return keyval($this->attribute_list,"multiple");}
publicget_name ( )[ forminput ]
Parameters
No parameters for this method
Code
134  public function get_name() {return keyval($this->attribute_list,"name");}
publicget_onblur ( )[ forminput ]
Parameters
No parameters for this method
Code
119  public function get_onblur() {return keyval($this->attribute_list,"onblur");}
publicget_onchange ( )[ forminput ]
Parameters
No parameters for this method
Code
122  public function get_onchange() {return keyval($this->attribute_list,"onchange");}
publicget_onclick ( )[ forminput ]
Parameters
No parameters for this method
Code
086  public function get_onclick() {return keyval($this->attribute_list,"onclick");}
publicget_ondblclick ( )[ forminput ]
Parameters
No parameters for this method
Code
089  public function get_ondblclick() {return keyval($this->attribute_list,"ondblclick");}
publicget_onfocus ( )[ forminput ]
Parameters
No parameters for this method
Code
116  public function get_onfocus() {return keyval($this->attribute_list,"onfocus");}
publicget_onkeydown ( )[ forminput ]
Parameters
No parameters for this method
Code
110  public function get_onkeydown() {return keyval($this->attribute_list,"onkeydown");}
publicget_onkeypress ( )[ forminput ]
Parameters
No parameters for this method
Code
107  public function get_onkeypress() {return keyval($this->attribute_list,"onkeypress");}
publicget_onkeyup ( )[ forminput ]
Parameters
No parameters for this method
Code
113  public function get_onkeyup() {return keyval($this->attribute_list,"onkeyup");}
publicget_onmousedown ( )[ forminput ]
Parameters
No parameters for this method
Code
092  public function get_onmousedown() {return keyval($this->attribute_list,"onmousedown");}
publicget_onmousemove ( )[ forminput ]
Parameters
No parameters for this method
Code
101  public function get_onmousemove() {return keyval($this->attribute_list,"onmousemove");}
publicget_onmouseout ( )[ forminput ]
Parameters
No parameters for this method
Code
104  public function get_onmouseout() {return keyval($this->attribute_list,"onmouseout");}
publicget_onmouseover ( )[ forminput ]
Parameters
No parameters for this method
Code
098  public function get_onmouseover() {return keyval($this->attribute_list,"onmouseover");}
publicget_onmouseup ( )[ forminput ]
Parameters
No parameters for this method
Code
095  public function get_onmouseup() {return keyval($this->attribute_list,"onmouseup");}
publicget_onselect ( )[ forminput ]
Parameters
No parameters for this method
Code
125  public function get_onselect() {return keyval($this->attribute_list,"onselect");}
publicget_properties ( )[ obj ]
Parameters
No parameters for this method
Code
121  public function get_properties()
122  {
123      return array_keys($this->array);
124  }
publicget_selected_options ( )[ doubleselect ]
Parameters
No parameters for this method
Code
264  public function get_selected_options()
265  {
266      foreach ($this->options as $o)
267      {
268          if ($o->selected)
269          {
270              $o->selected = false;
271          }
272      }
273      return $this->_selected_options;
274  }
publicget_size ( )[ doubleselect ]
Parameters
No parameters for this method
Code
258  public function get_size() {return keyval($this->attribute_list,"size");}
protectedget_string ( )[ obj ]
Parameters
No parameters for this method
Code
091  protected function get_string()
092  {
093      return method_exists($this,"__toString") ? $this->__toString() : null;
094  }
publicget_style ( )[ forminput ]
Parameters
No parameters for this method
Code
071  public function get_style() {return keyval($this->attribute_list,"style");}
publicget_style_string ( )[ element ]
Parameters
No parameters for this method
Code
034  public function get_style_string()
035  {
036      $styles = array();
037  //        foreach ($this->style as $k=>$v)
038  //        {
039  //            $styles[] = "$k:$v;";
040  //        }
041  //        $this->attributes["style"] .= implode("",$styles);
042      if (is_null(keyval($this->attributes,"style")))
043      {
044          return null;
045      }
046      else
047      {
048          return $this->attributes["style"];
049      }
050  }
publicget_tabindex ( )[ forminput ]
Parameters
No parameters for this method
Code
131  public function get_tabindex() {return keyval($this->attribute_list,"tabindex");}
publicget_title ( )[ forminput ]
Parameters
No parameters for this method
Code
074  public function get_title() {return keyval($this->attribute_list,"title");}
publicget_unselected_options ( )[ doubleselect ]
Parameters
No parameters for this method
Code
276  public function get_unselected_options()
277  {
278      foreach ($this->options as $o)
279      {
280          if (!$o->selected)
281          {
282              $this->_unselected_options[] = $o;
283          }
284      }
285      return $this->_unselected_options;
286  }
publicget_valid ( )[ doubleselect ]
Parameters
No parameters for this method
Code
255  public function get_valid() {return $this->validation->validate($this->name,$this->_value);}
publicget_value ( )[ forminput ]
Parameters
No parameters for this method
Code
137  public function get_value() {return keyval($this->attribute_list,"value");}
publicget_xml_lang ( )[ forminput ]
Parameters
No parameters for this method
Code
080  public function get_xml_lang() {return keyval($this->attribute_list,"xml:lang");}
publicrender ( )[ doubleselect ]
Parameters
No parameters for this method
Code
032  public function render()
033  {
034      $unselected = new select(unique());
035      $unselected->options = $this->unselected_options;
036      $unselected->id = $unselected->name;
037      $unselected->multiple = true;
038      $unselected->style = "height:150px;width:250px;";
039     
040      $selected = new select("$this->name");
041      $selected->options = $this->selected_options;
042      $selected->id = unique() . "_selected";
043      $selected->multiple=true;
044      $selected->style = "height:150px;width:250px;";
045 
046      $o = "";
047      $o .= "<div class=\"doubleselect\">";
048          $o .= "<table style=\"width:auto;\">";
049              $o .= "<tr>";
050                  $o .= "<td style=\"text-align:center;\">";
051                      $o .= "$this->_unselected_title<br />$unselected";
052         
053                      $btn_az = new button("Sort Asc","btn_all",null,"button");
054                      $btn_az->style = "width:85px;";
055                      $btn_az->onclick = "return (function() {
056                      var ul = document.getElementById('$unselected->id');
057                      var ut = [];
058                      var ops = [];
059                      for (var i=0; i<ul.options.length; i++)
060                      {
061                          ut[ut.length] = ul.options[i].text;
062                      }
063                      ut.sort();
064                      for (var i=0; i<ul.options.length; i++)
065                      {
066                          for (var j=0; j<ul.options.length; j++)
067                          {
068                              if (ul.options[j].text == ut[i])
069                              {
070                                  ops[i] = ul.options[j];
071                                  break;
072                              }
073                          }
074                      }
075                      for (var i=0; i<ops.length; i++)
076                      {
077                          ul.options[i] = ops[i];
078                      }
079                      return false;
080                      })();";
081                      $btn_za = new button("Sort Desc","btn_none",null,"button");
082                      $btn_za->style = "width:85px;";
083                      $btn_za->onclick = "return (function() {
084                      var ul = document.getElementById('$unselected->id');
085                      var ut = [];
086                      var ops = [];
087                      for (var i=0; i<ul.options.length; i++)
088                      {
089                          ut[ut.length] = ul.options[i].text;
090                      }
091                      ut.sort().reverse();
092                      for (var i=0; i<ul.options.length; i++)
093                      {
094                          for (var j=0; j<ul.options.length; j++)
095                          {
096                              if (ul.options[j].text == ut[i])
097                              {
098                                  ops[i] = ul.options[j];
099                                  break;
100                              }
101                          }
102                      }
103                      for (var i=0; i<ops.length; i++)
104                      {
105                          ul.options[i] = ops[i];
106                      }
107                      return false;
108                      })();";
109                      $o .= "<div style=\"margin:10px;\">";
110                      $o .= "<span style=\"margin:10px;\">$btn_az</span>";
111                      $o .= "<span style=\"margin:10px;\">$btn_za</span>";
112                      $o .= "</div>";
113                  $o .= "</td>";
114                  $o .= "<td style=\"padding:40px 0px 0px 0px;\">";
115                      $btn_add = new button(" > ","btn_add",null,"button");
116                      $btn_add->style = "width:75px;";
117                      $btn_add->onclick = "return (function() {
118                      var ul = document.getElementById('$unselected->id');
119                      var sl = document.getElementById('$selected->id');
120                      var sel = [];
121                      for (var i=0; i<ul.options.length; i++)
122                      {
123                          var op = ul.options[i];
124                          if (op.selected)
125                          {
126                              sel[sel.length] = op;
127                          }
128                      }
129                      for (var i=0; i<sel.length; i++)
130                      {
131                          sl.appendChild(ul.removeChild(sel[i]));
132                      }
133                      return false;
134                      })();";
135                      $btn_remove = new button(" < ","btn_remove",null,"button");
136                      $btn_remove->style = "width:75px;";
137                      $btn_remove->onclick = "return (function() {
138                      var ul = document.getElementById('$unselected->id');
139                      var sl = document.getElementById('$selected->id');
140                      var sel = [];
141                      for (var i=0; i<sl.options.length; i++)
142                      {
143                          var op = sl.options[i];
144                          if (op.selected)
145                          {
146                              sel[sel.length] = op;
147                          }
148                      }
149                      for (var i=0; i<sel.length; i++)
150                      {
151                          ul.appendChild(sl.removeChild(sel[i]));
152                      }
153                      return false;
154                      })();";
155                      $o .= "<div style=\"margin:10px;\">$btn_add</div>";
156                      $o .= "<div style=\"margin:10px;\">$btn_remove</div>";
157                  $o .= "</td>";
158                  $o .= "<td style=\"text-align:center;\">";
159                      $o .= "$this->_selected_title<br />$selected";
160         
161                      $btn_up = new button("Up","btn_up",null,"button");
162                      $btn_up->style = "width:75px;";
163                      $btn_up->onclick = "return (function() {
164                      var sl = document.getElementById('$selected->id');
165                      var ind = [];
166                      for (var i=0; i<sl.options.length; i++)
167                      {
168                          var op = sl.options[i];
169                          if (op.selected)
170                          {
171                              ind[ind.length] = i;
172                          }
173                      }
174                      for (var i=0; i<ind.length; i++)
175                      {
176                          if (ind[i] > 0)
177                          {
178                              var newop = sl.options[ind[i]].cloneNode(true);
179                              newop.selected=true;
180                              sl.replaceChild(sl.replaceChild(newop,sl.options[(ind[i]-1)]),sl.options[ind[i]]);
181                          }
182                      }
183                      return false;
184                      })();";
185                      $btn_down = new button("Down","btn_down",null,"button");
186                      $btn_down->style = "width:75px;";
187                      $btn_down->onclick = "return (function() {
188                      var sl = document.getElementById('$selected->id');
189                      var ind = [];
190                      for (var i=0; i<sl.options.length; i++)
191                      {
192                          var op = sl.options[i];
193                          if (op.selected)
194                          {
195                              ind[ind.length] = i;
196                          }
197                      }
198                      for (var i=0; i<ind.length; i++)
199                      {
200                          if (ind[i] < sl.length-1)
201                          {
202                              var newop = sl.options[ind[i]].cloneNode(true);
203                              newop.selected=true;
204                              sl.replaceChild(sl.replaceChild(newop,sl.options[(ind[i]+1)]),sl.options[ind[i]]);
205                          }
206                      }
207                      return false;
208                      })();";
209                      $o .= "<div style=\"margin:10px;\">";
210                      $o .= "<span style=\"margin:10px;\">$btn_up</span>";
211                      $o .= "<span style=\"margin:10px;\">$btn_down</span>";
212                      $o .= "</div>";
213                  $o .= "</td>";
214              $o .= "</tr>";
215          $o .= "</table>";
216          $o .= javascript("
217              (function() {
218                  var f = document.getElementById('$selected->id').form.onsubmit;
219                  document.getElementById('$selected->id').form.onsubmit = function() {
220                      if (typeof(f) == 'function')
221                      {
222                          f();
223                      }
224                      for (var i=0; i<document.getElementById('$unselected->id').options.length; i++)
225                      {
226                          document.getElementById('$unselected->id').options[i].selected = false;
227                      }
228                      for (var i=0; i<document.getElementById('$selected->id').options.length; i++)
229                      {
230                          document.getElementById('$selected->id').options[i].selected = true;
231                      }
232                  };
233              })();
234          ");
235      $o .= "</div>";
236      return $o;
237  }
public__set ( p , v )[ obj ]
Parameters
requiredp
requiredv
Code
030  public function __set($p,$v)
031  {
032      $methods = get_class_methods($this);
033      $properties = get_object_vars($this);
034      if (in_array("set_$p",$methods))
035      {
036          $this->{"set_$p"}($v);
037      }
038      else if (array_key_exists("_$p",$properties))
039      {
040          if (!preg_match('/_dirty$/',$p) && property_exists($this,"_{$p}_dirty"))
041          {
042              if (is_object($this->{"_$p"}))
043              {
044                  $this->{"_$p"}->dirty = true;
045              }
046              else
047              {
048                  $this->{"_{$p}_dirty"} = $this->{$p}==$v ? false : true;
049              }
050          }
051          $this->{"_$p"} = $v;
052      }
053      else if (in_array("set_" . substr($p,strpos($p,"_")+1), $methods))
054      {
055          $this->{"set_" . substr($p,strpos($p,"_")+1)}($v,substr($p,0,strpos($p,"_")));
056      }
057      else
058      {
059          trigger_error("This object [" . get_class($this) . ":$this->id] has no private property '_$p' for the requested public property '$p'",E_USER_WARNING);
060      }
061  }
publicset_classname ( v )[ forminput ]
Parameters
requiredv
Code
069  public function set_classname($v) {$this->attribute_list["class"] = $v;}
publicset_direction ( v )[ forminput ]
Parameters
requiredv
Code
084  public function set_direction($v) {$this->attribute_list["dir"] = $v;}
publicset_disabled ( v )[ forminput ]
Parameters
requiredv
Code
129  public function set_disabled($v) {$this->attribute_list["disabled"] = $v;}
publicset_id ( v )[ forminput ]
Parameters
requiredv
Code
066  public function set_id($v) {$this->attribute_list["id"] = $v;}
publicset_index ( index )[ doubleselect ]
Parameters
requiredindex
Code
288  public function set_index($index)
289  {
290      if (is_null($index))
291      {
292          return null;
293      }
294      $indexes = (is_array($index)) ? $index : array($index);
295 
296      if (count($this->options) > 0)
297      {
298          foreach ($this->options as $option)
299          {
300              $option->selected = false;
301          }
302      }
303      foreach($indexes as $i)
304      {
305          if (is_int($i) && $i < count($this->options))
306          {
307              $this->options[$i]->selected = true;
308              $this->_index = $i;
309              $this->_value = $this->options[$i]->value;
310              $this->_text = $this->options[$i]->text;
311          }   
312      }
313  }
publicset_lang ( v )[ forminput ]
Parameters
requiredv
Code
078  public function set_lang($v) {$this->attribute_list["lang"] = $v;}
publicset_multiple ( v )[ doubleselect ]
Parameters
requiredv
Code
262  public function set_multiple($v) {$this->attribute_list["multiple"] = $v;}
publicset_name ( v )[ forminput ]
Parameters
requiredv
Code
135  public function set_name($v) {$this->attribute_list["name"] = $v;}
publicset_onblur ( v )[ forminput ]
Parameters
requiredv
Code
120  public function set_onblur($v) {$this->attribute_list["onblur"] = $v;}
publicset_onchange ( v )[ forminput ]
Parameters
requiredv
Code
123  public function set_onchange($v) {$this->attribute_list["onchange"] = $v;}
publicset_onclick ( v )[ forminput ]
Parameters
requiredv
Code
087  public function set_onclick($v) {$this->attribute_list["onclick"] = $v;}
publicset_ondblclick ( v )[ forminput ]
Parameters
requiredv
Code
090  public function set_ondblclick($v) {$this->attribute_list["ondblclick"] = $v;}
publicset_onfocus ( v )[ forminput ]
Parameters
requiredv
Code
117  public function set_onfocus($v) {$this->attribute_list["onfocus"] = $v;}
publicset_onkeydown ( v )[ forminput ]
Parameters
requiredv
Code
111  public function set_onkeydown($v) {$this->attribute_list["onkeydown"] = $v;}
publicset_onkeypress ( v )[ forminput ]
Parameters
requiredv
Code
108  public function set_onkeypress($v) {$this->attribute_list["onkeypress"] = $v;}
publicset_onkeyup ( v )[ forminput ]
Parameters
requiredv
Code
114  public function set_onkeyup($v) {$this->attribute_list["onkeyup"] = $v;}
publicset_onmousedown ( v )[ forminput ]
Parameters
requiredv
Code
093  public function set_onmousedown($v) {$this->attribute_list["onmousedown"] = $v;}
publicset_onmousemove ( v )[ forminput ]
Parameters
requiredv
Code
102  public function set_onmousemove($v) {$this->attribute_list["onmousemove"] = $v;}
publicset_onmouseout ( v )[ forminput ]
Parameters
requiredv
Code
105  public function set_onmouseout($v) {$this->attribute_list["onmouseout"] = $v;}
publicset_onmouseover ( v )[ forminput ]
Parameters
requiredv
Code
099  public function set_onmouseover($v) {$this->attribute_list["onmouseover"] = $v;}
publicset_onmouseup ( v )[ forminput ]
Parameters
requiredv
Code
096  public function set_onmouseup($v) {$this->attribute_list["onmouseup"] = $v;}
publicset_onselect ( v )[ forminput ]
Parameters
requiredv
Code
126  public function set_onselect($v) {$this->attribute_list["onselect"] = $v;}
publicset_size ( v )[ doubleselect ]
Parameters
requiredv
Code
259  public function set_size($v) {$this->attribute_list["size"] = $v;}
publicset_style ( v )[ forminput ]
Parameters
requiredv
Code
072  public function set_style($v) {$this->attribute_list["style"] = $v;}
publicset_tabindex ( v )[ forminput ]
Parameters
requiredv
Code
132  public function set_tabindex($v) {$this->attribute_list["tabindex"] = $v;}
publicset_text ( text )[ doubleselect ]
Parameters
requiredtext
Code
346  public function set_text($text)
347  {
348      if (is_null($text))
349      {
350          return null;
351      }
352      $option_texts = array();
353      $texts = (is_array($text)) ? $text : array($text);
354     
355      if (count($this->options) > 0)
356      {
357          foreach ($this->options as $option)
358          {
359              $option->selected = false;
360              $option_texts[] = $option->text;   
361          }
362      }
363      foreach($texts as $text)
364      {
365          $index = array_search($text,$option_texts);
366          if (is_int($index))
367          {
368              $this->options[$index]->selected = true;
369              $this->_index = $index;
370              $this->_value = $this->options[$index]->value;
371              $this->_text = $this->options[$index]->text;
372          }
373      }
374  }
publicset_title ( v )[ forminput ]
Parameters
requiredv
Code
075  public function set_title($v) {$this->attribute_list["title"] = $v;}
publicset_valid ( )[ doubleselect ]
Parameters
No parameters for this method
Code
256  public function set_valid() {return false;}
publicset_value ( value )[ doubleselect ]
Parameters
requiredvalue
Code
315  public function set_value($value)
316  {
317      if (is_null($value))
318      {
319          return null;
320      }
321      $option_values = array();
322      $values = (is_array($value)) ? $value : array($value);
323     
324      if (count($this->options) > 0)
325      {
326          foreach ($this->options as $option)
327          {
328              $option->selected = false;
329              $option_values[] = $option->value;
330          }
331      }
332      foreach($values as $v)
333      {
334          $index = array_search($v,$option_values);
335          if (is_int($index))
336          {
337              $this->options[$index]->selected = true;
338              $this->_index = $index;
339              $this->_value = $this->options[$index]->value;
340              $this->_text = $this->options[$index]->text;
341              $this->_selected_options[] = $this->options[$index];
342          }
343      }
344  }
publicset_xml_lang ( v )[ forminput ]
Parameters
requiredv
Code
081  public function set_xml_lang($v) {$this->attribute_list["xml:lang"] = $v;}
public__toString ( )[ forminput ]
Parameters
No parameters for this method
Code
017  public function __toString()
018  {
019      return $this->render();
020  }
 
Accessors
publicarray[ obj ]
Code
096  public function get_array()
097  {
098      return get_object_vars($this);
099  }
publicattribute_string[ element ]
Code
017  public function get_attribute_string()
018  {
019      $attributes = array();
020      foreach ($this->attributes as $k=>$v)
021      {
022          $v = preg_match("/selected|checked|readonly|disabled|multiple/i",$k) ? ($v ? $k : null) : $v;
023          $v = ($k=="style") ? $this->style_string : $v;
024          $v = (preg_match("/name/i",$k) && keyval($this->attributes,"multiple")) ? ($v . "[]") : $v;
025          if (is_null($v))
026          {
027              continue;
028          }
029          $attributes[] = $k . "=\"" . ent($v) . "\"";
030      }
031      return implode(" ",$attributes);
032  }
publicclassname[ forminput ]
Code
068  public function get_classname() {return keyval($this->attribute_list,"class");}
Code
069  public function set_classname($v) {$this->attribute_list["class"] = $v;}
publicdirection[ forminput ]
Code
083  public function get_direction() {return keyval($this->attribute_list,"dir");}
Code
084  public function set_direction($v) {$this->attribute_list["dir"] = $v;}
publicdirty[ obj ]
Code
063  public function get_dirty()
064  {
065      if ($this->id === 0)
066      {
067          $this->_dirty = true;
068      }
069      else
070      {
071          foreach (get_object_vars($this) as $k=>$v)
072          {
073              if ($this->_dirty)
074              {
075                  break;
076              }
077              if (preg_match('/_dirty$/',$k))
078              {
079                  $this->_dirty = $this->_dirty || $v;
080              }
081          }
082      }
083      return $this->_dirty;
084  }
publicdisabled[ forminput ]
Code
128  public function get_disabled() {return keyval($this->attribute_list,"disabled");}
Code
129  public function set_disabled($v) {$this->attribute_list["disabled"] = $v;}
publicid[ forminput ]
Code
065  public function get_id() {return keyval($this->attribute_list,"id");}
Code
066  public function set_id($v) {$this->attribute_list["id"] = $v;}
publicindex[ doubleselect ]
Code
288  public function set_index($index)
289  {
290      if (is_null($index))
291      {
292          return null;
293      }
294      $indexes = (is_array($index)) ? $index : array($index);
295 
296      if (count($this->options) > 0)
297      {
298          foreach ($this->options as $option)
299          {
300              $option->selected = false;
301          }
302      }
303      foreach($indexes as $i)
304      {
305          if (is_int($i) && $i < count($this->options))
306          {
307              $this->options[$i]->selected = true;
308              $this->_index = $i;
309              $this->_value = $this->options[$i]->value;
310              $this->_text = $this->options[$i]->text;
311          }   
312      }
313  }
publicjson[ obj ]
Code
101  public function get_json()
102  {
103      $class = new ReflectionClass($this->classname);
104      $methods = $class->getMethods();
105      usort($methods,"sort_reflection_objects");
106      $accessors = array();
107      foreach ($methods as $index=>$method)
108      {
109          $declarer = $method->getDeclaringClass()->name;
110          if (preg_match('/^(get|set|)_(.+)$/',$method->name,$matches))
111          {
112              $accessor = $matches[2];
113              $getset = $matches[1];
114              eval("\$accessors[\$accessor] = \$this->".$accessor.";");
115          }
116      }
117      //return json_encode($this->get_array());
118      return json_encode($accessors);
119  }
publiclang[ forminput ]
Code
077  public function get_lang() {return keyval($this->attribute_list,"lang");}
Code
078  public function set_lang($v) {$this->attribute_list["lang"] = $v;}
publicmultiple[ doubleselect ]
Code
261  public function get_multiple() {return keyval($this->attribute_list,"multiple");}
Code
262  public function set_multiple($v) {$this->attribute_list["multiple"] = $v;}
publicname[ forminput ]
Code
134  public function get_name() {return keyval($this->attribute_list,"name");}
Code
135  public function set_name($v) {$this->attribute_list["name"] = $v;}
publiconblur[ forminput ]
Code
119  public function get_onblur() {return keyval($this->attribute_list,"onblur");}
Code
120  public function set_onblur($v) {$this->attribute_list["onblur"] = $v;}
publiconchange[ forminput ]
Code
122  public function get_onchange() {return keyval($this->attribute_list,"onchange");}
Code
123  public function set_onchange($v) {$this->attribute_list["onchange"] = $v;}
publiconclick[ forminput ]
Code
086  public function get_onclick() {return keyval($this->attribute_list,"onclick");}
Code
087  public function set_onclick($v) {$this->attribute_list["onclick"] = $v;}
publicondblclick[ forminput ]
Code
089  public function get_ondblclick() {return keyval($this->attribute_list,"ondblclick");}
Code
090  public function set_ondblclick($v) {$this->attribute_list["ondblclick"] = $v;}
publiconfocus[ forminput ]
Code
116  public function get_onfocus() {return keyval($this->attribute_list,"onfocus");}
Code
117  public function set_onfocus($v) {$this->attribute_list["onfocus"] = $v;}
publiconkeydown[ forminput ]
Code
110  public function get_onkeydown() {return keyval($this->attribute_list,"onkeydown");}
Code
111  public function set_onkeydown($v) {$this->attribute_list["onkeydown"] = $v;}
publiconkeypress[ forminput ]
Code
107  public function get_onkeypress() {return keyval($this->attribute_list,"onkeypress");}
Code
108  public function set_onkeypress($v) {$this->attribute_list["onkeypress"] = $v;}
publiconkeyup[ forminput ]
Code
113  public function get_onkeyup() {return keyval($this->attribute_list,"onkeyup");}
Code
114  public function set_onkeyup($v) {$this->attribute_list["onkeyup"] = $v;}
publiconmousedown[ forminput ]
Code
092  public function get_onmousedown() {return keyval($this->attribute_list,"onmousedown");}
Code
093  public function set_onmousedown($v) {$this->attribute_list["onmousedown"] = $v;}
publiconmousemove[ forminput ]
Code
101  public function get_onmousemove() {return keyval($this->attribute_list,"onmousemove");}
Code
102  public function set_onmousemove($v) {$this->attribute_list["onmousemove"] = $v;}
publiconmouseout[ forminput ]
Code
104  public function get_onmouseout() {return keyval($this->attribute_list,"onmouseout");}
Code
105  public function set_onmouseout($v) {$this->attribute_list["onmouseout"] = $v;}
publiconmouseover[ forminput ]
Code
098  public function get_onmouseover() {return keyval($this->attribute_list,"onmouseover");}
Code
099  public function set_onmouseover($v) {$this->attribute_list["onmouseover"] = $v;}
publiconmouseup[ forminput ]
Code
095  public function get_onmouseup() {return keyval($this->attribute_list,"onmouseup");}
Code
096  public function set_onmouseup($v) {$this->attribute_list["onmouseup"] = $v;}
publiconselect[ forminput ]
Code
125  public function get_onselect() {return keyval($this->attribute_list,"onselect");}
Code
126  public function set_onselect($v) {$this->attribute_list["onselect"] = $v;}
publicproperties[ obj ]
Code
121  public function get_properties()
122  {
123      return array_keys($this->array);
124  }
publicselected_options[ doubleselect ]
Code
264  public function get_selected_options()
265  {
266      foreach ($this->options as $o)
267      {
268          if ($o->selected)
269          {
270              $o->selected = false;
271          }
272      }
273      return $this->_selected_options;
274  }
publicsize[ doubleselect ]
Code
258  public function get_size() {return keyval($this->attribute_list,"size");}
Code
259  public function set_size($v) {$this->attribute_list["size"] = $v;}
publicstring[ obj ]
Code
091  protected function get_string()
092  {
093      return method_exists($this,"__toString") ? $this->__toString() : null;
094  }
publicstyle[ forminput ]
Code
071  public function get_style() {return keyval($this->attribute_list,"style");}
Code
072  public function set_style($v) {$this->attribute_list["style"] = $v;}
publicstyle_string[ element ]
Code
034  public function get_style_string()
035  {
036      $styles = array();
037  //        foreach ($this->style as $k=>$v)
038  //        {
039  //            $styles[] = "$k:$v;";
040  //        }
041  //        $this->attributes["style"] .= implode("",$styles);
042      if (is_null(keyval($this->attributes,"style")))
043      {
044          return null;
045      }
046      else
047      {
048          return $this->attributes["style"];
049      }
050  }
publictabindex[ forminput ]
Code
131  public function get_tabindex() {return keyval($this->attribute_list,"tabindex");}
Code
132  public function set_tabindex($v) {$this->attribute_list["tabindex"] = $v;}
publictext[ doubleselect ]
Code
346  public function set_text($text)
347  {
348      if (is_null($text))
349      {
350          return null;
351      }
352      $option_texts = array();
353      $texts = (is_array($text)) ? $text : array($text);
354     
355      if (count($this->options) > 0)
356      {
357          foreach ($this->options as $option)
358          {
359              $option->selected = false;
360              $option_texts[] = $option->text;   
361          }
362      }
363      foreach($texts as $text)
364      {
365          $index = array_search($text,$option_texts);
366          if (is_int($index))
367          {
368              $this->options[$index]->selected = true;
369              $this->_index = $index;
370              $this->_value = $this->options[$index]->value;
371              $this->_text = $this->options[$index]->text;
372          }
373      }
374  }
publictitle[ forminput ]
Code
074  public function get_title() {return keyval($this->attribute_list,"title");}
Code
075  public function set_title($v) {$this->attribute_list["title"] = $v;}
publicunselected_options[ doubleselect ]
Code
276  public function get_unselected_options()
277  {
278      foreach ($this->options as $o)
279      {
280          if (!$o->selected)
281          {
282              $this->_unselected_options[] = $o;
283          }
284      }
285      return $this->_unselected_options;
286  }
publicvalid[ doubleselect ]
Code
255  public function get_valid() {return $this->validation->validate($this->name,$this->_value);}
Code
256  public function set_valid() {return false;}
publicvalue[ forminput ]
[ doubleselect ]
Code
137  public function get_value() {return keyval($this->attribute_list,"value");}
Code
315  public function set_value($value)
316  {
317      if (is_null($value))
318      {
319          return null;
320      }
321      $option_values = array();
322      $values = (is_array($value)) ? $value : array($value);
323     
324      if (count($this->options) > 0)
325      {
326          foreach ($this->options as $option)
327          {
328              $option->selected = false;
329              $option_values[] = $option->value;
330          }
331      }
332      foreach($values as $v)
333      {
334          $index = array_search($v,$option_values);
335          if (is_int($index))
336          {
337              $this->options[$index]->selected = true;
338              $this->_index = $index;
339              $this->_value = $this->options[$index]->value;
340              $this->_text = $this->options[$index]->text;
341              $this->_selected_options[] = $this->options[$index];
342          }
343      }
344  }
publicxml_lang[ forminput ]
Code
080  public function get_xml_lang() {return keyval($this->attribute_list,"xml:lang");}
Code
081  public function set_xml_lang($v) {$this->attribute_list["xml:lang"] = $v;}
Get Helix PHP Framework at SourceForge.net. Fast, secure and Free Open Source software downloads