12 public function setValue($value, $refill=
false, $key=null) {
13 if (is_array($value)) {
14 $value = array_map(create_function(
'$v',
'return str_replace(",", ".", $v);'), $value);
16 $value = str_replace(
',',
'.', $value);
18 parent::setValue($value, $refill, $key);
22 $ret = parent::toHtml();
24 if ($this->cfg->useJs) {
25 $id = $this->makeid($this->name.
'-slider');
27 $ret =
'<div id="'.$id.
'" class="range-slider"></div>'.$ret;
29 $min = $this->cfg->getInarray(
'allowedRange',
'min');
30 $max = $this->cfg->getInarray(
'allowedRange',
'max');
33 if (!$max) $max = 100;
37 if (!$minVal) $minVal = $min;
38 if (!$maxVal) $maxVal = $max;
41 $resp->addJs(
'jqueryui');
42 $resp->blockJquery(
'$("#'.$id.
'").slider({ 46 values: ['.$minVal.
','.$maxVal.
'], 47 slide: function(event, ui) { 48 $("#'.$this->makeId($this->name.
'[0]').
'").val(ui.values[0]); 49 $("#'.$this->
makeId($this->name.
'[1]').
'").val(ui.values[1]); 52 $("#'.$this->
makeId($this->name.
'[0]').
'").change(); 53 $("#'.$this->
makeId($this->name.
'[1]').
'").change(); 55 })'.($this->cfg->disabled?
'.next(".range").find("input").attr("disabled", "disabled")' : null).
'; 63 return '<textbox type="number" id="'.$this->name.
'" value="'.$this->value.
'" min="'.$this->min.
'" max="'.$this->max.
'" increment="'.$this->step.
'" '.
utils::htmlAttribute($this->more).
'/>';
static htmlAttribute(array $prm)