18 require_once SQ_INCLUDE_PATH.
'/asset_attribute.inc';
55 if (!isset($this->_params[
'allow_negative'])) {
56 $this->_params[
'allow_negative'] = TRUE;
58 if (!isset($this->_params[
'allow_empty'])) {
59 $this->_params[
'allow_empty'] = FALSE;
61 if (!isset($this->_params[
'range_lower'])) {
62 $this->_params[
'range_lower'] = FALSE;
64 if (!isset($this->_params[
'range_upper'])) {
65 $this->_params[
'range_upper'] = FALSE;
69 $this->_edit_params[
'width'] = 0;
85 if (!parent::setEditParams($node))
return FALSE;
86 $this->_edit_params[
'width'] = (int) $node->attributes()->width;
102 function paint($prefix, $read_only=FALSE)
106 if (($this->value ===
'') || is_null($this->value)) {
109 $this->value = (int)$this->value;
117 $range_lower = $this->_params[
'range_lower'];
118 $range_upper = $this->_params[
'range_upper'];
121 if (!is_int($range_lower)) $range_lower = NULL;
122 if (!is_int($range_upper)) $range_upper = NULL;
124 $allow_negative = array_get_index($this->_params,
'allow_negative', TRUE);
126 require_once SQ_LIB_PATH.
'/html_form/html_form.inc';
127 int_text_box($prefix, $this->value, $allow_negative, $this->_edit_params[
'width'], $range_lower, $range_upper, 0, FALSE,
'');
142 if (!isset($_REQUEST[$prefix]))
return FALSE;
143 $value = $_REQUEST[$prefix];
144 if ($value !==
'') $value = (int)$value;
145 if ($this->value !== $value && $this->
setValue($value)) {
146 $this->processed = TRUE;
148 $this->processed = FALSE;
165 if (($value ===
'') || is_null($value)) {
166 $allow_empty = array_get_index($this->_params,
'allow_empty', TRUE);
167 if ($allow_empty && (($value ===
'') || is_null($value))) {
171 $value = (int)$value;
175 $range_lower = array_get_index($this->_params,
'range_lower', FALSE);
176 if (!empty($range_lower) && ($value < $range_lower)) {
180 $range_upper = array_get_index($this->_params,
'range_upper', FALSE);
181 if (!empty($range_upper) && ($value > $range_upper)) {
186 if ($value === 0)
return TRUE;
187 if ($value ===
'0')
return TRUE;
190 if ($value == 0)
return FALSE;
192 $allow_negative = array_get_index($this->_params,
'allow_negative', TRUE);
193 if (!$allow_negative && $value < 0) {