range=""; } function get_range($p_name) { return $this->range; } function set_range($p_name) { $this->range=' class="'.$p_name.'" '; } /*!\brief show the html input of the widget*/ public function input($p_name=null,$p_value=null,$id="") { $this->name=($p_name==null)?$this->name:$p_name; $this->value=($p_value==null)?$this->value:$p_value; if ( $this->readOnly==true) return $this->display(); $this->id=($this->id=="")?$this->name:$this->id; $check=( $this->selected==true )?"checked":"unchecked"; $r='range; $r.=$this->get_node_attribute(); $r.=' '.$this->disabled." ".$this->javascript.'>'; $r=$r." $this->label"; return $r; } /*!\brief print in html the readonly value of the widget*/ public function display() { $check=( $this->selected==true )?"checked":"unchecked"; $r='value==$p_value)$this->selected=true; } static function toggle_checkbox($p_name,$p_form) { $a=new ICheckBox($p_name); $a->javascript='onclick="toggle_checkbox(\''.$p_form.'\')"'; return $a->input(); } /** * Before calling this function , you must set a range with the function set_range. It will add the event on * click (checkbox_set_range) * * @param string $p_name * @returns javascript to execute string */ static function javascript_set_range($p_name) { $js=sprintf("(function () {activate_checkbox_range('%s');})();",$p_name); return create_script($js); } }