18 require_once SQ_ATTRIBUTES_PATH.
'/int/int.inc';
58 $this->_params[
'allow_empty'] = FALSE;
59 $this->_params[
'allow_negative'] = FALSE;
60 if (!isset($this->_params[
'range_lower'])) {
61 $this->_params[
'range_lower'] = 0;
63 if (!isset($this->_params[
'range_upper'])) {
64 $this->_params[
'range_upper'] = 10;
68 if (!isset($this->_edit_params[
'lower_text'])) {
69 $this->_edit_params[
'lower_text'] =
'Lower';
71 if (!isset($this->_edit_params[
'upper_text'])) {
72 $this->_edit_params[
'upper_text'] =
'upper';
93 $this->_edit_params[
'lower_text'] = translate((
string)$node->attributes()->lower_text);
94 $this->_edit_params[
'upper_text'] = translate((
string)$node->attributes()->upper_text);
109 function paint($prefix, $read_only=FALSE)
111 if ($this->value !==
'') {
112 $this->value = (int)$this->value;
114 $textbox_extras = $read_only ?
'disabled="disabled"' :
'';
115 require_once SQ_LIB_PATH.
'/html_form/html_form.inc';
117 <div
class=
"slider-container">
118 <div
class=
"slider-label-left">
119 <?php echo $this->_edit_params[
'lower_text']; ?>
120 <span>= <?php echo $this->_params[
'range_lower']; ?></span>
122 <?php int_text_box($prefix, $this->value, TRUE, 4, $this->_params[
'range_lower'], $this->_params[
'range_upper'], 0, FALSE, $textbox_extras); ?>
123 <div
class=
"slider-label-right">
124 <?php echo $this->_edit_params[
'upper_text']; ?>
125 <span>= <?php echo $this->_params[
'range_upper']; ?></span>
129 <script
type=
"text/javascript" src=
"<?php echo sq_web_path('lib'); ?>/js/slider_bar.js"></script>
130 <style type=
"text/css">
131 @
import url(<?php echo sq_web_path(
'lib');?>/web/css/slider_bar.css);
148 if (!isset($_REQUEST[$prefix]))
return FALSE;
149 $value = $_REQUEST[$prefix];
150 if ($value !==
'') $value = (int)$value;
151 if ($this->value != $value && $this->
setValue($value)) {
152 $this->processed = TRUE;
154 $this->processed = FALSE;
170 $value = trim($value);
172 $allow_negative = array_get_index($this->_params,
'allow_negative', TRUE);
173 $allow_empty = array_get_index($this->_params,
'allow_empty', TRUE);
175 if ($allow_empty && ($value ===
'')) {
179 if (!$allow_negative && $value < 0) {
183 $new_value = (int)$value;
189 if ((
string)$new_value != $value)
return FALSE;