18 require_once SQ_INCLUDE_PATH.
'/asset_attribute.inc';
63 if (!parent::setEditParams($node))
return false;
78 function paint($prefix, $read_only=
false)
80 $is_pct = (strpos($this->value,
'%') !==
false);
83 echo (
int) $this->value.($is_pct ?
' '.translate(
'percent') :
' '.translate(
'pixels'));
87 require_once SQ_LIB_PATH.
'/html_form/html_form.inc';
88 text_box($prefix, (
int) $this->value, 4, 0,
false,
'onFocus="javascript: this.__sq_init_value = this.value;" onChange="javascript: if (isNaN(parseInt(this.value))) { this.value = this.__sq_init_value; alert(js_translate(\'cannot_accept_non_digit_characters\')); } else { this.value = parseInt(this.value); } "');
89 combo_box($prefix.
'_pct', Array(0 =>
'Pixels', 1 =>
'Percent'),
false, $is_pct, 0, $extras=
'', $maxlength=0);
104 if (!isset($_REQUEST[$prefix]))
return false;
106 if ($_REQUEST[$prefix.
'_pct'] == 1) {
108 $value = (int) $_REQUEST[$prefix].
'%';
110 $value = (int) $_REQUEST[$prefix];
113 if ((
string)$this->value != (string) $value && $this->
setValue($value)) {
114 $this->processed =
true;
116 $this->processed =
false;
132 if (preg_match(
'/^[0-9a-f]+%?$/i', (
string) $value)) {
134 }
else if (!empty($this->_params[
'allow_blanks']) && strlen($value) == 0) {